Amyuni Document Converter
Version 4.5 Professional
Quick Start Guide for Developers
Updated October, 2010
AMYUNI Consultants – AMYUNI Technologies
www.amyuni.com
Contents
Legal Information ........................................................................................................................................................ 3
Important Note for developers ............................................................................................................................ 3
Acknowledgments ....................................................................................................................................................... 3
New In Version 4.5 ...................................................................................................................................................... 4
Introduction................................................................................................................................................................. 5
Using the Developer Version of the Amyuni Document Converter ............................................................................ 7
Note about Legacy Platforms .............................................................................................................................. 7
Sample ..................................................................................................................................................................... 7
Important Note for Version 4.5 ........................................................................................................................... 8
DLL Interface................................................................................................................................................................ 9
ActiveX Interface ......................................................................................................................................................... 9
Note to VB6 Users.............................................................................................................................................. 10
Note on Function Calls............................................................................................................................................... 11
ActiveX Methods ................................................................................................................................................... 11
DLL Methods.......................................................................................................................................................... 11
Links to Support and Documentation:....................................................................................................................... 12
Online Documentation: ......................................................................................................................................... 12
Frequently Asked Questions:................................................................................................................................. 12
Technical Notes: .................................................................................................................................................... 12
User forum:............................................................................................................................................................ 12
Posting questions to our technical support staff: ................................................................................................. 12
3
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-2010, 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 ([email protected]) and Mark Adler
([email protected]). This software is also based in part on the work of the Independent JPEG Group and
on parts of the FreeType library.
4
New In Version 4.5
WHQL Testing and Certification for 32 and 64-bit Windows 2008 and Windows 7
64-bit SDK improves performance and compatibility with 64-bit applications
Preview window integrated within the SDK does not require launching external applications
Improved performance and reliability for post-processing of PDF documents such as Appending,
Merging, Watermarking or Printing
Improved conversion of EPS objects embedded into Office documents using an updated Postscript 2
interpreter
Improved marked content generation for customizing the resulting PDF
Direct conversion of TIFF to PDF through the SDK. OCR module can be purchased separately as an add-
on to PDF Converter
OEM licensees are now offered the ability to customize the user-interface and add their own
configuration tabs to the printer
5
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 CDINTF450.DLL that should be in the system or system32 directory.
CDINTF450 provides the developer with three calling conventions. Depending on their development platform and
programming habits, developers might chose one these three interfaces:
A standard DLL interface.
An ActiveX interface.
A .NET Managed Code Interface.
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.
7
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,
atpdf450.cat
Windows 32-bits
cdintf.dll, acfpdfu.dll, acfpdfui.dll
Windows 64-bits, AMD or Intel
64 based
cdintf64.dll, acfpdfuamd64.dll,
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.
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.
8
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.
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.
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.
Important Note for Version 4.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.
9
DLL Interface
Before using the DLL interface of CDINTF450, the C or C++ developer might need to download the header and
library files from:
http://www.amyuni.com/downloads/cdintf450.zip
The zip file also contains the latest version of CDIntf450.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 CDIntf450.txt file to get the entire constant and function declarations
of CDIntf450. 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 CDINTF450.DLL
This is done automatically by the default installation procedure of any of the document converter product.
The CDIntf control starting with version 4.5 has been renamed to CDIntfEx.CDIntfEx.4.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 CDINTF450 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
11
3.
Locate and remove the line:
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:
http://www.amyuni.com/WebHelp/Developer_Documentation.htm#index.htm
Frequently Asked Questions:
http://www.amyuni.com/forum/viewforum.php?f=18
Technical Notes:
http://www.amyuni.com/en/resources/technicalnotes/
User forum:
http://www.amyuni.com/forum/index.php
Posting questions to our technical support staff:
http://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:
http://www.amyuni.com/en/resources/freetools/