[Solved] PDFDriverInit problem

If you are a VB developer and have questions about using our products from VB, here is the place to post them.
Post Reply
reluscorp
Posts: 4
Joined: Wed Jan 15 2003
Location: Romania
Contact:

[Solved] PDFDriverInit problem

Post by reluscorp »

Hello all,
I'm trying to print a word document and I use the PDFDriverInit with a printer name that doesn't exists on my system, but the init function doesn't create this printer and I get this error message:

Run-time error '1797':
PDFDriverInit failed

Bellow is the code I used to initialize the printer driver:

Dim objPDFPrinter As New CDIntf.CDIntf
objPDFPrinter.PDFDriverInit "Amyuni PDF Converter xx"

Anyone knows what the problem might be?
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

PDFDriverInit will install a printer on your system for the time your application is running. This printer will be removed at the end of your application when calling DriverEnd.
Note: PDFDriverInit should be called at the beginning of your application (and not each time you print) and DriverEnd should be called at the end of your application (and not when printing ends).

Under Windows NT, 2000 and XP only Administators have the right to install a printer on the system. So if you are under any of these operating systems and If you or your users don't have administrative rights to add and remove a printer from the system PDFDriverInit will fail.

In this case you can install the printer on the system using Install.exe (Install.exe should be run by an administrator). And inside your application you replace PDFDriverInit by DriverInit. (the printer will remain on the system even when the application ends.
DriverInit will take as parameter a string containing the printer name as it appears in your printers' folder.

For easier maintenance, It advisable to give to the printer a name related to your company.

Please note that:
Install " My Printer" : Will install a printer called "My Printer" on the system.
Install -s : Will install the printer in silent mode.

Hope this helps !
reluscorp
Posts: 4
Joined: Wed Jan 15 2003
Location: Romania
Contact:

Post by reluscorp »

Thank you for your reply, I'am using using Windows 2000, and I'm running on an administrator account, I've tried to call the PDFDriverInit function in OnLoad event for the main form but no success. Using DriverInit with "Amyuni PDF Converter" works fine.

I will use the second option, to install the printer with a name, and I think that this will be just fine.

Thank you.
Aurelian Georgescu
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Ok, if Install + DriverInit is working for you than this is fine. But PDFDriverInit should also work if you are logged in as administrator and if all the needed files (mentioned in Distribs.pdf that you received with the product) are in the same folder as your application.

Maybe some of the needed files is missing this is why PDFDriverInit is not working.
reluscorp
Posts: 4
Joined: Wed Jan 15 2003
Location: Romania
Contact:

Post by reluscorp »

Thank you very much, this may be the reason, I didn't have those files in the application folder, sorry to bother you with problem. I choose the first variant with DriverInit, in this way I will not have problems if I don't use the administrator account.

Regards,
Aurelian Georgescu
Post Reply