Amyuni Dcument Cnverter Versin 5.0 Prfessinal Quick Start Guide fr Develpers Updated May, 2013 AMYUNI Cnsultants AMYUNI Technlgies
www.amyuni.cm 2
Cntents Cntents... 3 Legal Infrmatin... 4 Imprtant Nte fr develpers... 4 Acknwledgments... 4 New in Versin 5.0... 5 Intrductin... 6 Using the Develper Versin f the Dcument Cnverter Prducts... 7 Using the Develper Versin f the Amyuni Dcument Cnverter... 8 Nte abut Legacy Platfrms... 8 Sample... 8 Imprtant Nte fr Versin 5.0... 9 Imprtant Nte fr develpers... 9 DLL Interface... 10 ActiveX Interface... 10 Nte t VB6 Users... 11 Nte n Functin Calls... 12 ActiveX Methds... 12 DLL Methds... 12 Links t Supprt and Dcumentatin:... 13 Online Dcumentatin:... 13 Frequently Asked Questins:... 13 Technical Ntes:... 13 User frum:... 13 Psting questins t ur technical supprt staff:... 13
Legal Infrmatin Infrmatin in this dcument is subject t change withut ntice and des nt represent a cmmitment n the part f AMYUNI Technlgies. The sftware described in this dcument is prvided under a license agreement r nndisclsure agreement. The sftware may be used r cpied nly in accrdance with the terms f the agreement. It is against the law t cpy the sftware n any medium except as specifically allwed in the license r nndisclsure agreement. The licensee may make ne cpy f the sftware fr backup purpses. N part f this guide may be reprduced r transmitted in any frm r by any means, electrnic r mechanical, including phtcpying, recrding, r infrmatin strage and retrieval systems, fr any purpse ther than the licensee s persnal use, withut express written permissin f AMYUNI Technlgies. Cpyright 2000-2013, AMYUNI Cnsultants AMYUNI Technlgies. All rights reserved. Amyuni and the Amyuni lg are trademarks f Amyuni Technlgies Inc. Adbe, the Adbe lg, Acrbat, the Acrbat lg are trademarks f Adbe Systems Incrprated. Micrsft, the Micrsft lg, Micrsft Windws, Micrsft Windws NT and their lgs are trademarks f Micrsft Crpratin. All ther trademarks are the prperty f their respective wners. Imprtant Nte fr develpers The activatin cde that is prvided t yu by Amyuni shuld be kept cnfidential and nt be revealed t end-users, even in this case where the develper s prducts are sub-licensed t ther develpers. Acknwledgments This sftware uses the deflate algrithm develped by Jean-lup Gailly (jlup@gzip.rg) and Mark Adler (madler@alumni.caltech.edu). This sftware is als based in part n the wrk f the Independent JPEG Grup and n parts f the FreeType library.
New in Versin 5.0 WHQL Tested and Certified fr 32 and 64-bit Windws 7, Windws 8, Windws Server 2008 and Windws Server 2012. Fully redesigned Pstscript parser imprves the speed and accuracy f Pstscript and EPS cnversin Added the ability t d direct Pstscript t PDF cnversin withut the use f a printer driver Imprved accuracy and reliability f mixed mde GDI/Pstscript applicatins based n GDI+ (e.g. MS Office) JBIG2 cmpressin f Black and White images directly thrugh the printer driver Remves the need fr re-prcessing PDF files t apply JBIG2 Reduces the size f PDF files made f scanned B&W images Versin 5.0 uses a redesigned JBIG2 cmpressr engine fr higher cmpressin and cnversin speed. JBIG2 cmpressin can be easily activated thrugh the ImageOptins prperty. Imprved Emailing features with: Supprt fr extra character sets in the SMTP library Supprt fr MAPI under 64-bit perating systems Imprved cnversin f EPS bjects embedded int Office dcuments using an updated Pstscript 2 interpreter Imprved marked cntent generatin fr custmizing the resulting PDF Generatin f Ge-registered PDF files
Intrductin This manual is a supplement t the Amyuni Dcument Cnverter series f prducts. These include the PDF, HTML, RTF, Excel, TIFF, and JPeg Cnverter prducts r any cmbinatin f these frmats. Each f these prducts ships with a user s manual that describes the verall peratin f the prduct. The develper shuld be familiar with the peratin f the specific prduct that he r she is using befre reading the develper s manual. All Amyuni Dcument Cnverter prducts share the same interface DLL named the Cmmn Driver Interface. This interface resides in a DLL named CDINTF500.DLL that shuld be in the system r system32 directry. CDINTF500 prvides the develper with three calling cnventins. Depending n their develpment platfrm and prgramming habits, develpers might chse ne these three interfaces: A standard DLL interface. An ActiveX interface. A.NET Managed Cde Interface.
Using the Develper Versin f the Dcument Cnverter Prducts The develper versin f the Amyuni Dcument Cnverter prducts is a special versin f these prducts that can be distributed with the develpers applicatins withut paying any additinal ryalties t Amyuni Technlgies. By special versin, we mean a versin that: Des nt need t be pre-installed n the client system (althugh recmmended). Des nt have any prperties dialg bx. Des nt have any "File Save As" dialg bx. All printer cnfiguratins, file destinatins and ptins settings shuld be dne prgrammatically by the main applicatin.
Using the Develper Versin f the Amyuni Dcument Cnverter The fllwing is a step-by-step prcedure fr using the develper versin f the Amyuni Cnverter. 1. Cpy all distributable files t the applicatin s main directry The applicatin s main directry is usually where the executable file is lcated. The list f distributable files is as fllws: Operating Systems Cmmn t all versins Windws 32-bits Windws 64-bits, AMD r Intel 64 based Dynamic Link Libraries (DLLs) install.exe, acfpdf.txt, amyuni.inf, atpdf500.cat cdintf.dll, acfpdfu.dll, acfpdfui.dll cdintf64.dll, acfpdfuamd64.dll, acfpdfuiamd64.dll Nte abut Legacy Platfrms Windws 98/Me, NT4 and IA64 drivers have nt been updated since versin 2.5. These drivers are nt included with the prducts but can be dwnladed separately frm: http://www.amyuni.cm/dwnlads/legacy_drivers.zip 2. Initialize the Dcument Cnverter printer n the end-user s system. Methd 1 (Recmmended) By launching Install.exe during the installatin f the main applicatin. Install.exe shuld be launched fllwed by a printer name specific t the develper s cmpany r applicatin: Cmmand Line Parameters Descriptin -s (Optinal) Runs in silent mde Printer Name Name f printer as it will appear n the list f system printers -N License Name -C Activatin Cde -O Prt name Install printer attached t a specific prt -l D nt generate a lg file All cmmand line parameters shuld be surrunded by duble qutes when they cntain spaces. Sample Install -s "My Cmpany Printer" -n "Evaluatin Develper License" -c "07ABCDA0A12301230123". Methd 2 By calling PDFDriverInit at the initialisatin f the applicatin. The dcumentatin fr PDFDriverInit prvides details abut hw t use this functin t initialize the printer and activate it.
3. (Optinal) When using the DLL interface f CDIntf, cpy CDIntf.dll r CDIntf64.dll t yur applicatin s flder. This will guarantee that yur versin f this DLL will nt be verwritten by ther develpers installing a different versin. 4. (Optinal) Register the CDIntf ActiveX. When using the ActiveX interface, the ActiveX cntrl shuld be registered in the system by calling RegSvr32 frm yur applicatin s directry: REGSVR32 CDINTF.DLL r REGSVR32 CDINTF64.DLL. CDIntf can be used thrugh the DLL interface withut the need fr registering r creating ActiveXs. Imprtant Nte fr Versin 5.0 Fr 32-bit applicatins running n a 64-bit OS, the applicatin is respnsible f registering the 32-bit ActiveX cntrl using the 32-bit versin f REGSVR32 r thrugh the call t the DllRegisterServer API. This is because the 64-bit printer driver is nt capable f registering 32-bit ActiveX cntrls and will nly register the 64-bit CDIntf64.dll. 5. Initialize the printer at start-up f yur applicatin by calling DriverInit fllwed by the printer name. 6. Exprt t the frmat f yur chice by printing frm yur applicatin. When the user chses the exprt functin f yur applicatin t generate a PDF, HTML, RTF, JPEG, TIFF r Excel file, yu need t set up the utput file name using SetDefaultFileName, the file generatin ptins using SetFileNameOptins( NPrmpt + UseFileName + ) and print t the "My Cmpany Printer" as yu wuld d when printing t any ther printer. The develper can be in ne f three situatins: The develper licensed a prduct that generates nly ne frmat, e.g. PDF nly r RTF nly. In this case, the printer will generate the right frmat withut any specific ptin t set. The develper licensed a prduct that generates multiple frmats including PDF, e.g. PDF and RTF. In this case, t exprt t either RTF, HTML, JPEG, TIFF r Excel, the crrespnding ptin shuld be set in the call t SetFileNameOptins. The PDF file will be generated in all cases and shuld be deleted by the develper if nt needed. There is n methd t have the Cnverter generate an RTF/HTML/JPEG/TIFF/Excel file nly withut generating a PDF. The develper licensed a prduct that generates multiple frmats excluding PDF, e.g. RTF and HTML. In this case, t exprt t either RTF, HTML, the crrespnding ptin shuld be set in the call t SetFileNameOptins. A temprary file will be generated in these cases and will be deleted by the printer when the print jb is finished. 7. Restre the printer t its previus setting. When printing is ver, the develper needs t call SetFileNameOptins (0) t prevent ther applicatins r users frm verwriting the file that has just been generated frm the applicatin. 8. Uninitialize the printer befre exiting. Befre exiting the applicatin, the DriverEnd functin shuld be called. This functin will remve the printer if installed using PDFDriverInit, therwise it will simply discnnect frm the printer. Imprtant Nte fr develpers T avid cnfusin with ther applicatins and with the single-user versins f the Dcument Cnverter prducts, develpers are required t use a printer name specific t their applicatin r cmpany. Using the default printer names f "Amyuni Dcument Cnverter" r "Amyuni PDF Cnverter" is nt allwed.the activatin cde that is prvided t yu by Amyuni shuld be kept cnfidential and nt be revealed t end-users, even in this case where the develper s prducts are sub-licensed t ther develpers.
DLL Interface Befre using the DLL interface f CDINTF500, the C r C++ develper might need t dwnlad the header and library files frm: http://www.amyuni.cm/dwnlads/cdintf500.zip The zip file als cntains the latest versin f CDIntf500.DLL. The library file is cmpatible with Visual Studi 2005 and higher. When using ther cmpilers such as Brland C+ +, the develper needs t imprt the library frm the DLL instead f using the library frm ur dwnlads sectin. Visual Basic users can imprt the included CDIntf500.txt file t get the entire cnstant and functin declaratins f CDIntf500. VB users are encuraged hwever t use the ActiveX interface as it remains mre versatile and easier t use frm within VB. ActiveX Interface Befre using the Cmmn Driver Interface as an ActiveX cmpnent frm any ActiveX aware applicatin, the develper shuld register the DLL in the system by calling RegSvr32 frm the lcatin where this DLL is installed: Regsvr32 CDINTF500.DLL This is dne autmatically by the default installatin prcedure f any f the dcument cnverter prduct. The CDIntf cntrl starting with versin 5.0 has been renamed t CDIntfEx.CDIntfEx.5.0 t avid cnfusin with the previus versins. The cntrl can either be created dynamically thrugh cde r placed n a frm like any ther VB cntrl. When placed n a frm, the cntrl remains invisible at run time. T dynamically create the CDIntfEx bject, the CDINTF500 DLL shuld first be imprted int the prject. The prcedure is quite similar in all prgramming envirnments. Here is what it wuld lk like in VB:
T place the CDIntfEx cntrl n a frm, it shuld be imprted int the prject using the Prject's Cmpnents menu: It shuld then appear in the cmpnents tlbar as fllws: Nte t VB6 Users VB6 users that had used previus versins f CDIntf r are trying t switch frm dynamically created bject t the visual cmpnent placed n a frm, might receive the fllwing errr message frm VB: If this happens, the cntrl shuld be manually remved frm the prject by fllwing these steps: 1. Clse the VB prject 2. Open the.vbp file using any text editr
3. Lcate and remve the line: Reference=*\G{4856F146-7516-11D3-BBE5-D53DCBD65107}#1.0#0# c:\windows\system32\cdintf.dll#cdintf. 4. Relad the prject in VB and imprt the cntrl. Nte n Functin Calls ActiveX Methds On Success ActiveX methds will have a return relevant t their functinality. On failure, mst ActiveX calls will raise an exceptin. The caller shuld prperly catch any exceptins generated frm a call t the ActiveX. If the library was nt initialized prperly, an exceptin will be thrwn. T get extended errr infrmatin, call GetLastErrrMsg. DLL Methds On Failure, mst DLL functins will return zer (NULL). T get extended errr infrmatin, call GetLastErrrMsg. On success, DLL methds that return a HANDLE will return a handle fr the virtual printer that will be used as an argument fr ther methd calls. The hprinter handle returned by the functins is nt t be cnfused with the hprinter handle returned by the Windws API OpenPrinter and CreatePrinter functins.
Links t Supprt and Dcumentatin: If yu have any questins r prblems with ur prducts, the fllwing resurces are available t yu thrugh ur web site: Online Dcumentatin: http://www.amyuni.cm/webhelp/develper_dcumentatin.htm#index.htm Frequently Asked Questins: http://www.amyuni.cm/frum/viewfrum.php?f=18 Technical Ntes: http://www.amyuni.cm/en/resurces/technicalntes/ User frum: http://www.amyuni.cm/frum/index.php Psting questins t ur technical supprt staff: http://www.amyuni.cm/en/supprt/getsupprt/ We als prvide sme additinal tls that can be dwnladed free f charge and used with the PDF Cnverter prduct. These tls are available at: http://www.amyuni.cm/en/resurces/freetls/