Banawalikar, Omkar
2014-12-17 10:49:36 UTC
Hi,
I am generating a PDF file using iText 5.5.3. The sample java code which I am using for generating the file is as follows:
Rectangle pageConfig = PageSize.A4;
Document doc = new Document(pageConfig);
try {
PdfWriter writer = PdfWriter.getInstance(doc, out);
writer.setPdfVersion(PdfWriter.PDF_VERSION_1_7);
String country = Locale.getDefault().getLanguage();
writer.setTagged();
doc.addTitle(fileTitle);
writer.setViewerPreferences(PdfWriter.DisplayDocTitle);
doc.addLanguage(country);
writer.createXmpMetadata();
doc.open();
for (Iterator iter = this.elements.iterator(); iter.hasNext();) {
Object elt = iter.next();
//adding the itext high level blocks to the pdf doc
this.process(doc, elt);
}
doc.close();
} catch (DocumentException ex) {
throw new IOException(ex.getMessage());
}
The PDF file is generated properly with all the tags, but when I try to read the same pdf using JAWS (screen reader software), it is only announcing the title of the file. It does not reads the content of the file. Can you tell us what are we missing in the above code?
PFA the pdf file generated by itext.
Thanks,
Omkar B.
I am generating a PDF file using iText 5.5.3. The sample java code which I am using for generating the file is as follows:
Rectangle pageConfig = PageSize.A4;
Document doc = new Document(pageConfig);
try {
PdfWriter writer = PdfWriter.getInstance(doc, out);
writer.setPdfVersion(PdfWriter.PDF_VERSION_1_7);
String country = Locale.getDefault().getLanguage();
writer.setTagged();
doc.addTitle(fileTitle);
writer.setViewerPreferences(PdfWriter.DisplayDocTitle);
doc.addLanguage(country);
writer.createXmpMetadata();
doc.open();
for (Iterator iter = this.elements.iterator(); iter.hasNext();) {
Object elt = iter.next();
//adding the itext high level blocks to the pdf doc
this.process(doc, elt);
}
doc.close();
} catch (DocumentException ex) {
throw new IOException(ex.getMessage());
}
The PDF file is generated properly with all the tags, but when I try to read the same pdf using JAWS (screen reader software), it is only announcing the title of the file. It does not reads the content of the file. Can you tell us what are we missing in the above code?
PFA the pdf file generated by itext.
Thanks,
Omkar B.