0
  1. Text is correct using IE Browser or Adobe Reader
  2. Text is not showing up in Chrome or FF
  3. Made using tool called Adobe live cycle designer and Java (XPAA.jar)

What could be the problem?

    FileInputStream src= new FileInputStream(new File(path));// PDF Form
    PDFDocument pdf= PDFFactory.openDocument(src);

    String data="<root><name>company</name><tel>000000</tel></root>";        
    byte[] byteData = data.getBytes("UTF8"); 
    InputStream formInputStream= new ByteArrayInputStream(byteData); 

    pdf.importFormData(formInputStream);  // Data Binding

    outWriteStream(inSrcPdf.save(), ServiceContext.getOutputStream());

    //----------------
    private void outWriteStream(InputStream in, OutputStream out) throws    IOException{
        byte[] buffer = new byte[10240];
        int len = 0;
        while (true) {
            len = in.read(buffer);
            if (len == -1) break;           
            out.write(buffer, 0, len);
        }
        out.close();
    }

IE or Reader display

Screenshot

Chrome or FF display:

Screenshot

halfer
  • 19,824
  • 17
  • 99
  • 186
Marthin
  • 21
  • 4
  • What format do these screenshots represent - is it PDF? What are you using in FF or Chrome to render this format? If it is the PDF JavaScript thing in Firefox, it is worth looking to see what status that is in - it works for me generally, but maybe it is not regarded as "stable" yet? Is there any such thing as a PDF linter you can run your file through? – halfer Jul 15 '15 at 17:10
  • Can you share the PDF in question? What kind of form technology is used? Pure AcroForm? Pure XFA? Hybrid? The observation would easily be explained in the latter case if the form contents are only present in the XFA representation. – mkl Jul 15 '15 at 20:14
  • @halfer i find the PDF Javascript thing in FireFox, but there is not having something. /r/n `
    Company
    Partner
    `
    – Marthin Jul 16 '15 at 01:13
  • @mkl i making contents is only present in the adobe liveCycle designer. this configuration PDF such as form, and xml such as data, and xsd. So then i used to XPAA.jar and to complete PDF file. – Marthin Jul 16 '15 at 01:25
  • thank you your answer. I share the PDF [Link](http://blogattach.naver.net/7aef66d6c79b9e426c8beed8e4017806a0f30ae88c/20150716_126_blogfile/thtlsgkrtod_1437008371191_s4bahM_pdf/test.pdf?type=attachment) - FF Version : 39.0 - Chrome Version : Version – Marthin Jul 16 '15 at 01:33
  • i saw console log in firefox. So then I think this problem is seem to not support in pdf.js for AcroForm/XFA... is it right? "PDF 752766c5f1ccbe4d97fe138f02486fe9 [1.6 Adobe LiveCycle Designer ES 9.0 / Adobe LiveCycle Designer ES 9.0] (PDF.js: 1.1.24)" viewer.js:6225:1 "Warning: AcroForm/XFA is not supported" viewer.js:6249:9 "Warning: fontRes not available" pdf.worker.js:235:5 "Warning: Error during font loading: Font TimesNewRomanPSMT is not available" pdf.js:235:5 "Warning: JavaScript is not supported" viewer.js:6154:13 "Warning: fontRes not available" – Marthin Jul 16 '15 at 04:18
  • 1
    (Would you delete the comments above that are really question updates, and [edit them into the question](http://stackoverflow.com/posts/31431073/edit)? Thanks - this keeps things readable for future readers). – halfer Jul 16 '15 at 11:03
  • 1
    It sounds as though you have discovered the problem too - if you can add the final comment as an answer, that might be helpful for others. I imagine there are good security reasons not to support JavaScript in PDFs. – halfer Jul 16 '15 at 11:04
  • I find the problem. the reason that why can't showing it is binding text of dynamic pdf. All pdf viewer don't support binding text of dynamic pdf file. so then I'm lookking find to convert to dynamic from static using itext. – Marthin Jul 17 '15 at 06:07
  • :-) i was solved myself. – Marthin May 16 '18 at 05:33

0 Answers0