Unable to intialize PDF printer queue

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
chretienj
Posts: 2
Joined: Tue Nov 29 2005

Unable to intialize PDF printer queue

Post by chretienj »

Hello,

The following piece of code is constantly failing when I am trying to initalize the printer. We are using version 2.1 and have re-installed several times. Any ideas? Thanks for your help.
Set PDFPrinter = New CDIntfEx.CDIntfEx
If PDFPrinter Is Nothing Then
MsgBox "Unable to create CDIntfEx object for PDF printer driver.", vbCritical
Exit Function
End If
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

The above code doesn't really initialize the printer, it only creates an instance of CDIntfEx.

To initialise the printer you need to call PDFDriverInit to install the printer or DriverInit to initialize an already installed printer on the system and then you need to call EnablePrinter.

Here is a modified version of your code:

Code: Select all

Set PDFPrinter = New CDIntfEx.CDIntfEx 
     If PDFPrinter Is Nothing Then 
     MsgBox "Unable create an instance of CDIntf, check if CDIntf is referenced in the application.", vbCritical 
     End If 
PDFPrinter.PDFDriverInit("My PDF Export Printer") // To create the Printer
PDFPrinter.DriverInit("My PDF Export Printer")  // To keep the printer on system when closing your application
      If PDFPrinter Is Nothing Then 
      MsgBox "Unable to install the PDF Printer.", vbCritical 
      Exit Function 
      End If 
Hope this helps.
chretienj
Posts: 2
Joined: Tue Nov 29 2005

Post by chretienj »

I guess what I meant to say is that my code is unable to create an instance of CDIntfEx. In the code, once the instance is created then I call PDFPrinter.DriverInit and so forth. But creating the CDIntfEx object is always failing. Any ideas? -thanks
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

Creating an instance of CDIntfEx would fail if CDIntfEx is not registered properly on the system or is not added as a reference to your application.

If you are using version 2.50 of the PDF Converter please check that CDIntf250.dll is in registered in your system32 directory, you can use Regsvr32 to register CDIntf250.dll.

Also please check that you add CDIntfEx to your application before trying to create an instance of it.

If Creating an instance of CDIntfEx is still failing please tell us what is the message you are getting.

Hope this helps.
Post Reply