Nothing Special   »   [go: up one dir, main page]

Amyuni Document Converter Developer Manual

Download as pdf or txt
Download as pdf or txt
You are on page 1of 13

Amyuni Document Converter

Version 5.5 Professional

Quick Start Guide for Developers


Updated 04 November, 2015

AMYUNI Consultants – AMYUNI Technologies

www.amyuni.com
Contents
Legal Information ............................................................................................................... 3
Important Note for developers .................................................................................... 3
Acknowledgments............................................................................................................... 3
New in Version 5.5 ............................................................................................................. 4
Introduction......................................................................................................................... 5
Using the Developer Version of the Document Converter Products .................................. 6
Using the Developer Version of the Amyuni Document Converter ................................... 7
Note about Legacy Platforms...................................................................................... 7
Sample............................................................................................................................. 8
Important Note for Version 5.5................................................................................... 8
Important Note for developers .................................................................................... 9
DLL Interface.................................................................................................................... 10
ActiveX Interface.............................................................................................................. 10
Note to VB6 Users .................................................................................................... 11
Note on Function Calls ..................................................................................................... 12
ActiveX Methods .......................................................................................................... 12
DLL Methods................................................................................................................ 12
Links to Support and Documentation: .............................................................................. 13
Online Documentation: ................................................................................................. 13
Frequently Asked Questions: ........................................................................................ 13
Technical Notes: ........................................................................................................... 13
User forum: ................................................................................................................... 13
Posting questions to our technical support staff:........................................................... 13
Legal Information
Information in this document is subject to change without notice and does not represent a
commitment on the part of AMYUNI Technologies. The software described in this document is
provided under a license agreement or nondisclosure agreement.

The software may be used or copied only in accordance with the terms of the agreement. It is
against the law to copy the software on any medium except as specifically allowed in the license
or nondisclosure agreement.
The licensee may make one copy of the software for backup purposes. No part of this guide may
be reproduced or transmitted in any form or by any means, electronic or mechanical, including
photocopying, recording, or information storage and retrieval systems, for any purpose other than
the licensee’s personal use, without express written permission of AMYUNI Technologies.
Copyright 2000-2015, AMYUNI Consultants – AMYUNI Technologies. All rights reserved.
Amyuni and the Amyuni logo are trademarks of Amyuni Technologies Inc. Adobe, the Adobe
logo, Acrobat, the Acrobat logo are trademarks of Adobe Systems Incorporated.
Microsoft, the Microsoft logo, Microsoft Windows, Microsoft Windows NT and their logos are
trademarks of Microsoft Corporation.
All other trademarks are the property of their respective owners.

Important Note for developers


The activation code that is provided to you by Amyuni should be kept confidential and not
be revealed to end-users, even in this case where the developer’s products are sub-
licensed to other developers.

Acknowledgments
This software uses the deflate algorithm developed by Jean-loup Gailly (jloup@gzip.org) and
Mark Adler (madler@alumni.caltech.edu). This software is also based in part on the work of the
Independent JPEG Group and on parts of the FreeType library.

3
New in Version 5.5

 WHQL Tested and Certified for Windows 10.


 Improved down-sampling algorithm allows new options for bit depth and down-sampling
method.
 Third Generation Postscript interpreter.
o Includes wider coverage of the Postscript language including support for all
shading types, DeviceN and Separation color spaces, shfill operator, among
others.
o Direct processing of Postscript files through the PDF printer for applications that
generate direct Postscript data.
o Full support for EPS files including all the various Postscript font formats.
o Changed the algorithm for converting Postscript patterns for more efficiency and
smoother output.
 Wider coverage of image raster operations allows better handling of transparencies in
applications that do not support Postscript.
 Generate PDF/A-3 compatible documents in addition to PDF/A-1. Conformance levels
A, B and U are supported.
 Improved TIFF export module. Support for 8-bit LZW compressed images to reduce the
file size and improve reader compatibility.

4
Introduction
This manual is a supplement to the Amyuni Document Converter series of products. These
include the PDF, HTML, RTF, Excel, TIFF, and Jpeg Converter products or any combination of
these formats. Each of these products ships with a user’s manual that describes the overall
operation of the product. The developer should be familiar with the operation of the specific
product that he or she is using before reading the developer’s manual.
All Amyuni Document Converter products share the same interface DLL named the “Common
Driver Interface”. This interface resides in a DLL named CDINTF550.DLL that should be in the
system or system32 directory.
CDINTF550 provides the developer with three calling conventions. Depending on their
development platform and programming habits, developers might choose one these three
interfaces:
 A standard DLL interface.
 An ActiveX interface.
 A .NET Managed Code Interface.

5
Using the Developer Version of the Document
Converter Products
The developer version of the Amyuni Document Converter products is a special version of these
products that can be distributed with the developers’ applications without paying any additional
royalties to Amyuni Technologies.
By special version, we mean a version that:
 Does not need to be pre-installed on the client system (although recommended).
 Does not have any properties dialog box.
 Does not have any "File Save As" dialog box.
All printer configurations, file destinations and options settings should be done programmatically
by the main application.
Using the Developer Version of the Amyuni Document
Converter
The following is a step-by-step procedure for using the developer version of the Amyuni
Converter.
1. Copy all distributable files to the application’s main directory
The application’s main directory is usually where the executable file is located. The list of
distributable files is as follows:

Operating Systems Dynamic Link Libraries (DLLs)


Common to all versions install.exe, acfpdf.txt, amyuni.inf,
atpdf550.cat
Windows 32-bits cdintf.dll, acfpdfu.dll, acfpdfui.dll
Windows 64-bits, AMD or Intel cdintf64.dll, acfpdfuamd64.dll,
64 based acfpdfuiamd64.dll

Note about Legacy Platforms


Windows 98/Me, NT4 and IA64 drivers have not been updated since version 2.5. These
drivers are not included with the products but can be downloaded separately from:
http://www.amyuni.com/downloads/legacy_drivers.zip

2. Initialize the Document Converter printer on the end-user’s system.


Method 1 (Recommended)
By launching Install.exe during the installation of the main application. Install.exe
should be launched followed by a printer name specific to the developer’s company or
application:

Command Line Parameters Description


-s (Optional) Runs in silent mode

Printer Name Name of printer as it will appear on the list of


system printers

-N License Name

-C Activation Code

-O Port name – Install printer attached to a specific


port

-l Do not generate a log file

All command line parameters should be surrounded by double quotes when they contain
spaces.

7
Sample
Install -s "My Company Printer" -n "Evaluation Developer License" -c
"07ABCDA0A12301230123".
Method 2
By calling PDFDriverInit at the initialisation of the application. The documentation for
PDFDriverInit provides details about how to use this function to initialize the printer and
activate it.
3. (Optional) When using the DLL interface of CDIntf, copy CDIntf.dll or CDIntf64.dll to
your application’s folder. This will guarantee that your version of this DLL will not be
overwritten by other developers installing a different version.
4. (Optional) Register the CDIntf ActiveX. When using the ActiveX interface, the ActiveX
control should be registered in the system by calling RegSvr32 from your application’s
directory: REGSVR32 CDINTF.DLL or REGSVR32 CDINTF64.DLL.
CDIntf can be used through the DLL interface without the need for registering or creating
ActiveXs.

Important Note for Version 5.5


For 32-bit applications running on a 64-bit OS, the application is responsible of
registering the 32-bit ActiveX control using the 32-bit version of REGSVR32 or through
the call to the DllRegisterServer API. This is because the 64-bit printer driver is not
capable of registering 32-bit ActiveX controls and will only register the 64-bit
CDIntf64.dll.

5. Initialize the printer at start-up of your application by calling DriverInit followed by the
printer name.
6. Export to the format of your choice by printing from your application. When the user
chooses the export function of your application to generate a PDF, HTML, RTF, JPEG,
TIFF or Excel file, you need to set up the output file name using SetDefaultFileName,
the file generation options using SetFileNameOptions( NoPrompt + UseFileName + … )
and print to the "My Company Printer" as you would do when printing to any other
printer.
The developer can be in one of three situations:
o The developer licensed a product that generates only one format, e.g. PDF only or
RTF only. In this case, the printer will generate the right format without any
specific option to set.
o The developer licensed a product that generates multiple formats including PDF,
e.g. PDF and RTF. In this case, to export to either RTF, HTML, JPEG, TIFF or
Excel, the corresponding option should be set in the call to SetFileNameOptions.
The PDF file will be generated in all cases and should be deleted by the developer
if not needed. There is no method to have the Converter generate an
RTF/HTML/JPEG/TIFF/Excel file only without generating a PDF.
o The developer licensed a product that generates multiple formats excluding PDF,
e.g. RTF and HTML. In this case, to export to either RTF, HTML, the
corresponding option should be set in the call to SetFileNameOptions. A
temporary file will be generated in these cases and will be deleted by the printer
when the print job is finished.

8
7. Restore the printer to its previous setting. When printing is over, the developer needs to
call SetFileNameOptions (0) to prevent other applications or users from overwriting the
file that has just been generated from the application.
8. Uninitialize the printer before exiting. Before exiting the application, the DriverEnd
function should be called. This function will remove the printer if installed using
PDFDriverInit, otherwise it will simply disconnect from the printer.

Important Note for developers


To avoid confusion with other applications and with the single-user versions of the
Document Converter products, developers are required to use a printer name specific
to their application or company. Using the default printer names of "Amyuni
Document Converter" or "Amyuni PDF Converter" is not allowed. The activation
code that is provided to you by Amyuni should be kept confidential and not be
revealed to end-users, even in this case where the developer’s products are sub-
licensed to other developers.

9
DLL Interface
Before using the DLL interface of CDINTF550, the C or C++ developer might need to download
the header and library files from:
https://www.amyuni.com/downloads/CDIntf550.zip
The zip file also contains the latest version of CDIntf550.DLL.
The library file is compatible with Visual Studio 2005 and higher. When using other compilers
such as Borland C++, the developer needs to import the library from the DLL instead of using the
library from our “downloads” section.
Visual Basic users can import the included CDIntf550.txt file to get the entire constant and
function declarations of CDIntf550. VB users are encouraged however to use the ActiveX
interface as it remains more versatile and easier to use from within VB.

ActiveX Interface
Before using the Common Driver Interface as an ActiveX component from any ActiveX aware
application, the developer should register the DLL in the system by calling RegSvr32 from the
location where this DLL is installed:
Regsvr32 CDINTF550.DLL
This is done automatically by the default installation procedure of any of the document converter
product.
The CDIntf control starting with version 5.5 has been renamed to CDIntfEx.CDIntfEx.5.5 to
avoid confusion with the previous versions. The control can either be created dynamically
through code or placed on a form like any other VB control. When placed on a form, the control
remains invisible at run time.
To dynamically create the CDIntfEx object, the CDINTF550 DLL should first be imported into
the project. The procedure is quite similar in all programming environments.
Here is what it would look like in VB:

10
To place the CDIntfEx control on a form, it should be imported into the project using the
Project's Components menu:

It should then appear in the components toolbar as follows:

Note to VB6 Users


VB6 users that had used previous versions of CDIntf or are trying to switch from
dynamically created object to the visual component placed on a form, might receive the
following error message from VB:

If this happens, the control should be manually removed from the project by following
these steps:

1. Close the VB project


2. Open the .VBP file using any text editor
3. Locate and remove the line:

11
Reference=*\G{4856F146-7516-11D3-BBE5-D53DCBD65107}#1.0#0#
c:\WINDOWS\System32\cdintf.dll#CDIntf.
4. Reload the project in VB and import the control.

Note on Function Calls


ActiveX Methods
On Success ActiveX methods will have a return relevant to their functionality. On failure, most
ActiveX calls will raise an exception. The caller should properly catch any exceptions generated
from a call to the ActiveX.
If the library was not initialized properly, an exception will be thrown. To get extended error
information, call GetLastErrorMsg.

DLL Methods
On Failure, most DLL functions will return zero (NULL). To get extended error information, call
GetLastErrorMsg.
On success, DLL methods that return a HANDLE will return a handle for the virtual printer that
will be used as an argument for other method calls. The hPrinter handle returned by the
functions is not to be confused with the hPrinter handle returned by the Windows API
OpenPrinter and CreatePrinter functions.

12
Links to Support and Documentation:
If you have any questions or problems with our products, the following resources are available to
you through our web site:

Online Documentation:
https://www.amyuni.com/WebHelp/Developer_Documentation.htm#index.htm

Frequently Asked Questions:


https://www.amyuni.com/forum/viewforum.php?f=18

Technical Notes:
https://www.amyuni.com/en/resources/technicalnotes/

User forum:
https://www.amyuni.com/forum/index.php

Posting questions to our technical support staff:


https://www.amyuni.com/en/support/getsupport/

We also provide some additional tools that can be downloaded free of charge and used with the
PDF Converter product. These tools are available at:
https://www.amyuni.com/en/resources/freetools/

13

You might also like