Hi All,
How can I Print PDF in Servoy directly ? . I am using apache PDF box library . I am successful in it. Is it possible with out using any library ? . The solution should be generic one for all the OS .
Hi All,
How can I Print PDF in Servoy directly ? . I am using apache PDF box library . I am successful in it. Is it possible with out using any library ? . The solution should be generic one for all the OS .
Hi,
You can use the pdf_output plugin. You can see it in the developer, Solution Explorer view under “Plugins”.
https://wiki.servoy.com/display/public/DOCS/pdf_output
Regards,
Edit
You cannot print a pdf file with the pdf_output plugin.
The pdf_output plugin and Apache PDFBox are quite similar, they both allow you to create PDF documents or change existing documents.
But what exactly are you trying to do?
Hi ,
Thanks for your reply . I want to directly print it in the printer.
Unfortunately this is not possible without using other libraries.
We found an older post https://servoy.com/forum/viewtopic.php?f=22&t=20604 which states it is possible with PDFbox.
Hi All ,
I am using this .
desktop = Packages.java.awt.Desktop;
/**@type {java.io.File} */
attachPDF = new Packages.java.io.File(attachPDFJS.getAbsolutePath());
if (desktop.isDesktopSupported())
desktop.getDesktop().print(new Packages.java.io.File(attachPDF));
But this is very inconsistent . Most of the times saying - “There was an error opening this document . This file cannot be found” . I have installed the Adobe reader 11. Please share your thoughts on this
Located a script that calls PDFbox and the files are open source. You’ll have to verify the licensing yourself.
I’m putting it here in case I need to locate the original again.
I found this: Printing PDF Silently in Servoy- CodeProject
To get it to work at 7.4.8, I downloaded a prior version of pdfbox, but it may work with the current version after requiring an install of both
fontbox-1.8.9.jar and pdfbox-1.8.9.jar downloaded from https://pdfbox.apache.org/ into the application_server/beans directory.
I literally struggled with Velocity Report setting up the Report folder set up , an appropriate template file and the css file, along with what is permissible with template variables and incoming data.
Left only to have to silently print the PDF file when in use on a web client, although that test remains to be seen whether I’d done it correctly to print on the server’s printer rather than the client’s.
The file did open in the PDF viewer from Smart Client for another purpose, while I went round and round with attempting to send a joined foundset instead of a dataset.
btw, the class docs for PDFbox are here Apache PDFBox 1.8.10 API.
Hope this helps someone else.
–Joe.