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?
[Solved] PDFDriverInit problem
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 !
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 !
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
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
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.
Maybe some of the needed files is missing this is why PDFDriverInit is not working.