I have a tagged pdf doc with the following header:
/Type/Catalog/Pages 2 0 R/Lang(en-CA) /StructTreeRoot 10 0
R/MarkInfo<</Marked true
I read in the contents, replace some of the text and create a new doc. I copy
the document information from the original doc and set marked to true.
newDoc = new PDDocument();
newDoc.setDocumentInformation(PTConstants.pdfDoc.getDocumentInformation());
PDMarkInfo markinfo = new PDMarkInfo();
markinfo.setMarked(true);
newDoc.getDocumentCatalog().setMarkInfo(markinfo);
and when I check that it was set, it returns true:
PDMarkInfo markInfo =
PTConstants.pdfDoc.getDocumentCatalog().getMarkInfo();
if ((markInfo != null) && (markInfo.isMarked()))
System.out.println("true");
But, while the resulting document displays correctly, the header indicates that
it is not tagged:
/Type /Catalog
/Version /1.4
/Pages 2 0 R
/MarkInfo 3 0 R
Any idea what is going on?
Colette