Amyuni Document Converter Developer Manual
Amyuni Document Converter Developer Manual
Amyuni Document Converter Developer Manual
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.
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
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:
-N License Name
-C Activation Code
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.
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.
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:
If this happens, the control should be manually removed from the project by following
these steps:
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.
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
Technical Notes:
https://www.amyuni.com/en/resources/technicalnotes/
User forum:
https://www.amyuni.com/forum/index.php
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