pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Colette Joubarne <cjouba...@privacyanalytics.ca>
Subject Unable to mark document as tagged
Date Fri, 13 Jun 2014 12:21:06 GMT
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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message