文字未显示在Chrome或FF中,但显示在IE和Reader中

时间:2015-07-15 12:57:26

标签: java pdf livecycle adobe-reader pdf-reader

  1. 使用IE浏览器或Adobe Reader
  2. 的文本正确无误
  3. 文字未显示在Chrome或FF中
  4. 使用名为Adobe live cycle designer和Java(XPAA.jar)的工具制作
  5. 可能是什么问题?

        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或Reader显示

    Screenshot

    Chrome或FF显示:

    Screenshot

0 个答案:

没有答案