I have written a Visual FoxPro application that generates 1 report and 3 Word documents through VBA commands. Each document is one page. The 4 documents go as a batch to either a physical printer or to individual disk files in PDF format. When the documents are sent to a printer, the process takes less than 2 seconds but when they go to PDF files, it takes 23 seconds. While that's not speedy, it’s much better than the 45 seconds it took before I spent the weekend optimizing it!
The majority of the additional time is required for switching printers in Word; the same process in VFP occurs almost instantaneously. I’m using these commands for the task:
oPDFPrinter.SetDefaultPrinter
oWord.ActivePrinter = ‘Application PDF Converter’
oPDFPrinter. RestoreDefaultPrinter
Is there a faster way to do this? I am using Amyuni PDF Converter version 2.06, Windows XP Professional and Word 2000 in my testing. The client uses Word 2003 on their workstations.
Faster way to change printer drivers in Word?
Hello Version 2.06 is quite old. I don't know of a similar problem in our latest version, i suggest that you try version 3.0.
Also I suggest that you turn background printing in Word off, printing delay might be due to background printing.
Finally please note that if you are setting the PDF Printer to default using SetDefaultPrinter(), you need to call SetDefaultPrinter() once when launching your application and once before closing, and Not before each printout.
Hope this helps.
Also I suggest that you turn background printing in Word off, printing delay might be due to background printing.
Finally please note that if you are setting the PDF Printer to default using SetDefaultPrinter(), you need to call SetDefaultPrinter() once when launching your application and once before closing, and Not before each printout.
Hope this helps.
Custom Brand the Amyuni PDF Printer Driver http://www.amyuni.com/en/developer/branding/index.html
Amyuni PDF Converter tested for true PDF performance. View results - http://www.amyuni.com/benchmark
Amyuni PDF Converter tested for true PDF performance. View results - http://www.amyuni.com/benchmark
Hello,
So you can try turning background printing off in Word. And check that you are not calling SetDefaultPrinter() each time you print.
Hope this helps.
So you can try turning background printing off in Word. And check that you are not calling SetDefaultPrinter() each time you print.
Hope this helps.
Custom Brand the Amyuni PDF Printer Driver http://www.amyuni.com/en/developer/branding/index.html
Amyuni PDF Converter tested for true PDF performance. View results - http://www.amyuni.com/benchmark
Amyuni PDF Converter tested for true PDF performance. View results - http://www.amyuni.com/benchmark
Thanks. That did help to reduce the time for the printjob from 45 seconds to 23 seconds. It still seems to take about 10 seconds to switch to the PDF printer and another 10 to switch back.
Speed may become irrelevant though since the process doesn't work at the client site! The PDF DriverInit() call fails. I've tried both local and server installs of the PDF Converter. The error code is 1801. I can't find a reference to that in the documentation.
Speed may become irrelevant though since the process doesn't work at the client site! The PDF DriverInit() call fails. I've tried both local and server installs of the PDF Converter. The error code is 1801. I can't find a reference to that in the documentation.
Your client has administrative rightes?
I sugest to install the printer using install.exe and connect to it using DriverInit. This should resolve the problem.
I sugest to install the printer using install.exe and connect to it using DriverInit. This should resolve the problem.
Custom Brand the Amyuni PDF Printer Driver http://www.amyuni.com/en/developer/branding/index.html
Amyuni PDF Converter tested for true PDF performance. View results - http://www.amyuni.com/benchmark
Amyuni PDF Converter tested for true PDF performance. View results - http://www.amyuni.com/benchmark
Installing the Converter permanently on the workstation did resolve many issues. Printing from Word through OLE automation works perfectly, even if the switching of printers is still slow.
However, printing reports from VFP doesn't work at all now. The "Set Printer to Name" command generates this message: "Error accessing printer spooler." I'd like to deploy this application but need this feature to work. Is there something else I can try?
However, printing reports from VFP doesn't work at all now. The "Set Printer to Name" command generates this message: "Error accessing printer spooler." I'd like to deploy this application but need this feature to work. Is there something else I can try?
Hello,
Actually, it is advised to install the printer permanently on the system and use DriverInit to attach to it.
I am not sure what do you mean exactly by switching of printers, i.e i am not sure if you are setting the PDF Printer to default and printing to it or you are selecting and unselecting it each time you print, bu in both cases you need to minimise printer switching to improve the speed of your application.
For VFP, you need to set the printer you want to use inside the report. You can do this using the report settings.
Hope this helps.
Actually, it is advised to install the printer permanently on the system and use DriverInit to attach to it.
I am not sure what do you mean exactly by switching of printers, i.e i am not sure if you are setting the PDF Printer to default and printing to it or you are selecting and unselecting it each time you print, bu in both cases you need to minimise printer switching to improve the speed of your application.
For VFP, you need to set the printer you want to use inside the report. You can do this using the report settings.
Hope this helps.
Custom Brand the Amyuni PDF Printer Driver http://www.amyuni.com/en/developer/branding/index.html
Amyuni PDF Converter tested for true PDF performance. View results - http://www.amyuni.com/benchmark
Amyuni PDF Converter tested for true PDF performance. View results - http://www.amyuni.com/benchmark
Just to clarify, the problem isn't with the VFP reports, it is with the Word automation documents produced by VFP. The command
oWord.ActivePrinter = PDF_Converter_Name
directs output to the converter and a similar command restores the previous printer setting when the job is complete. After much experimentation, I've decided this is a Word problem, not a PDF Converter problem. Each of those commands takes 10 seconds to execute in Word 2000 but requires less time in later versions of Word.
Thanks for your help. I'm considering the problem solved!
oWord.ActivePrinter = PDF_Converter_Name
directs output to the converter and a similar command restores the previous printer setting when the job is complete. After much experimentation, I've decided this is a Word problem, not a PDF Converter problem. Each of those commands takes 10 seconds to execute in Word 2000 but requires less time in later versions of Word.
Thanks for your help. I'm considering the problem solved!