- Text is correct using IE Browser or Adobe Reader
- Text is not showing up in Chrome or FF
- 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
Chrome or FF display: