Export pdf files to desktop

I’m having a problem with printing documents from PMI, it usally takes several minutes for the printer box to display and then for the document to print, the code I’m using is as follows:

table = event.source.parent.getComponent(“PDF Viewer”)
table.print()

I did notice however that if I save the document to my desktop and then open and print the document this only takes a few seconds. Is it possible to first save the pdf document from the pdf viewer to the desktop and then second have it automactically print from the desktop? If not then how would I just do the first part and save the pdf document from the pdf viewer to the desktop.

Or

Would it be possible to print the document from it’s storage location on a shared drive if the path is provided?

Mick

To save the document as a pdf programmatically:

table = event.source.parent.getComponent("PDF Viewer") fpmi.file.writeFile("C:\\Path\\To\\MyReport.pdf", table.getBytesPDF())
I don’t know of any way to print the PDF after it has been written to the hard drive.

Now that that is out of the way, it sounds like your printer driver is not allowing Java to print in vector mode, which means that the document is being rasterized, which is slow. Try printing to a different printer and/or updating your printer driver and see if the print performance is improved.

If the print driver/settings don’t help…

Acrobat supports printing from the command line according to their web site. You would run something like this with fpmi.system.execute():

AcroRd32.exe /t "C:\test.pdf" "\\servername\printername"