PDFDriverInit and DriverEnd causes error

The Amyuni PDF Converter is our Printer Driver that enables you to convert any documents to PDF format. If you have any questions about installing and using the Amyuni PDF Converter please post them here.
Post Reply
ecd1973
Posts: 1
Joined: Tue Jun 10 2008

PDFDriverInit and DriverEnd causes error

Post by ecd1973 »

I'm using v2.5 of the PDF Converter. I use PDFDriverInit to initialize the printer, I print to it, and call DriverEnd which removes the printer from the list of printers. This all works fine. The next time I run my application and call PDFDriverInit, I get an "Unable to install printer" error. Looking at the GetLastErrorMsg property, I see "printer driver is unknown". It looks like DriverEnd is blowing the driver and everything away. Is there any way around this?

ECD
Devteam
Posts: 119
Joined: Fri Oct 14 2005
Location: Montreal
Contact:

Re: PDFDriverInit and DriverEnd causes error

Post by Devteam »

The recommended way of using our PDF Converter (http://www.amyuni.com/en/developer/index.html) printer driver is to install the printer when the application is installed and not every time you print to it or every time the application is launched. Problems can arise if you try to add/remove the printer frequently, there are also associated security issues. Please refer to the installation and distribution section of the documentation for how to properly distribute and install the printer.

Once the printer is installed, you can call DriverInit instead of PDFDriverInit, in which case DriverEnd will not remove the driver from the system.

If you insist on running PDFDriverInit when your application starts, what you are describing seems to indicate that the driver was already installed the first time, so PDFDriverInit succeeded, then the driver was removed by DriverEnd (which is the normal behaviour of this method after a PDFDriverInit) and the next time around PDFDriverInit fails. There are only 2 reasons why PDFDriverInit fails:
1 - You do not have enough permissions to add a printer driver to the system.
2 - You do not have all the DLLs and acfpdf.txt file at the same location as CDINTF (i.e. some DLL could not be found.)

Hope this helps...
Amyuni Development Team

Efficient and accurate conversion to PDF, XPS, PDF/A and more. Free trials at - https://www.amyuni.com
Post Reply