Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>if you want a Java code, here's a snippet I got from one a blog. But it uses pdf Nitro, in case this helps or let me know</p> <pre><code>private ByteArrayOutputStream editPdfDocument() throws Exception { PdfReader reader = null; PdfStamper stamper = null; ByteArrayOutputStream baosPDF = new ByteArrayOutputStream(); HashMap fieldsWithValues = new HashMap(); int user_id = 1234; // unique key for the object String dirPath = “D:/abc”;// directory path String fileName = “def.pdf”;// name of the file try { reader = new PdfReader(dirPath + “/” + fileName); stamper = new PdfStamper(reader, baosPDF); AcroFields form = stamper.getAcroFields(); HashMap fields = form.getFields(); Set keys = fields.keySet(); // keys represents the names of all the form fields fieldsWithValues = fetchFieldValuesForObject(user_id, keys); // fetchFieldValuesForObject(user_id, keys) method will fetch the values of the fields from Database for object identified by user_id Iterator itr = keys.iterator(); while (itr.hasNext()) { String fieldName = (String) itr.next(); String fieldValue = fieldsWithValues.get(fieldName) != null ? (String)(fieldsWithValues.get(fieldName)) : “”; form.setField(fieldName, fieldValue); } stamper.setFormFlattening(true); } catch (Exception dex) { if (stamper != null) stamper.close(); if (reader != null) reader.close(); throw dex; } return baosPDF; }`enter code here` </code></pre> <p>It's Pdf form filling using Java that directly retrieves data from database, hope it works <a href="http://www.trigent.com/blog/2013/08/14/java-application-development-automatic-form-filling-in-pdf-using-java-codes/" rel="nofollow">Visit Java Codes for Automatic form fill</a> </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload