DynamicPDF api to render PDF forms in Java -


i have pdf forms , used adobe acrobat pro version 9 add hidden fields, buttons , validation in javascript it.

also using dynamicpdf api (first time) in java read pdf , pre-populate few fields values (eg date current date , url fields) , drawing byte array , sending render.

but while rendering dynamic pdf messing forms. not showing buttons added using adobe. buttons displayed no label on , if click shows * on it. don't know why.

i using dynamic pdf replacement fdf merge. want same functionality dynamicpdf , total beginner both apis.

any suggestion?

this helper class write , pdf---

public class pdfmerge {      private mergedocument document = null;        public pdfmerge(file template) throws exception {          if (templatepdffile == null)  {             throw new exception( );                 document = new mergedocument(template.getabsolutepath(), new mergeoptions(true));         }              }      public mergedocument mergepdf(string pdfformid, string url,             ) {          calendar cal = calendar.getinstance();          if (document != null) {                                 //hidden fields on pdf form                    if (document.getform().getfields().getformfield("url_to_submit") != null) {                     document.getform().getfields().getformfield("url_to_submit")                             .setvalue(url);                  }                   //date fields prepopulate before rendered on browser                  if (document.getform().getfields().getformfield("date.mm") != null) {                     document                             .getform()                             .getfields()                             .getformfield("date.mm")                             .setvalue(                                     string.valueof(cal.get(calendar.month) + 1));                  }                  if (document.getform().getfields().getformfield("date.dd") != null) {                     .....                  }                  if (document.getform().getfields().getformfield("date.yyyy") != null) {                     ....                 }                 }         }                 //document drawn byte array in servlet send output stream.          return document;      }   } 

on servlet/caller (struts action) side ----

pdfmerge pdfmerge = new pdfmerge(form.gettemplatefile()); mergedocument mergedpdf = printtool.mergepdf(string .valueof(form.getformid()), url);   byte[] pdfarray = mergedpdf.draw(); 

this byte array forwarded onto jsp rendered. doesnt display buttons correctly.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -