Skip to content Skip to sidebar Skip to footer

Pdfbox Setopenaction To Print

I'm new to PDFBox, I have a requirement to send the PDF to the printer when it is opened. We are using PDFBox api to generate the PDFs. I have used the below code to try setting th

Solution 1:

You can do this without JS:

PDActionNamedaction=newPDActionNamed();
    action.setN("Print");
    doc.getDocumentCatalog().setOpenAction(action);

Solution 2:

try this PDActionJavaScript("this.print({bUI: false, bSilent: true, bShrinkToFit: true});");

Post a Comment for "Pdfbox Setopenaction To Print"