Create a PDF from Webview on Android

WebView has built-in functionality to generate PDFs which is made available by using PrintManager Service. For your use case, I would suggest you to write/store the final output of WebView’s PrintAdapter which is a PDF file to a local file and go from there. This link will walk you through the details and implementation. http://www.annalytics.co.uk/android/pdf/2017/04/06/Save-PDF-From-An-Android-WebView/ … Read more

Automatically open the printer dialog after providing PDF download

With JasperReports When using JasperReports, simply add this parameter to JasperReports exporter: exporter.setParameter(JRPdfExporterParameter.PDF_JAVASCRIPT, “this.print();”); This basically instructs Adobe Acrobat to execute the script this.print() when opening the PDF. See also page 79-80 of Adobe Acrobat Scripting Guide. Below is an extract of relevance: Printing PDF Documents It is possible to use Acrobat JavaScript to specify … Read more

How to watermark PDFs using text or images?

Please take a look at the TransparentWatermark2 example. It adds transparent text on each odd page and a transparent image on each even page of an existing PDF document. This is how it’s done: public void manipulatePdf(String src, String dest) throws IOException, DocumentException { PdfReader reader = new PdfReader(src); int n = reader.getNumberOfPages(); PdfStamper stamper … Read more

External signing PDF with iText

There are a number of issues in your code. First of all your code mixes different iText signing API generations. There is the older API generation which requires you to work very near to the PDF internals, and there is the newer (since version 5.3.x) API which is implemented as a layer over the older … Read more

How to extract images from a PDF with iText in the correct order?

I found an answer elsewhere, namely the iText mailing list. The following code works for me – please note that I switched to PdfBox: PDDocument document = null; document = PDDocument.load(inFile); List pages = document.getDocumentCatalog().getAllPages(); Iterator iter = pages.iterator(); while (iter.hasNext()) { PDPage page = (PDPage) iter.next(); PDResources resources = page.getResources(); Map pageImages = resources.getImages(); … Read more

What does “Not LTV-enabled” mean?

LTV (Long Term Validation) and PDF signatures The term LTV-enabled 4 Profile for PAdES-LTV 4.1 Overview Validation of an electronic signature requires data to validate the signature such as CA certificates, Certificate Revocation List (CRLs) or Certificate status information (OCSP) commonly provided by an online service (referred to in the present document as validation data). … Read more