On 13/08/2014 16:16, Pichtchikov, Alexandre wrote:
> Here is an example of tagged pdf I tried to use with iText.

Hi Alexandre,

Your tagged PDF seems fine.  The problem is that you're merging a tagged 
and untagged PDF.

In your appendPDF() method, you now use:
target.addPage(target.getImportedPage(source, i, true));

This is okay for the tagged PDF, but for the untagged it will try to 
preserve the structure which is not there.  A simple fix:
target.addPage(target.getImportedPage(source, i, source.isTagged()));


Alternatively, you can replace your appendPDF() method with 
PdfCopy.addDocument().  This method detects if the document is tagged or 
not.  In your code:
newPDF.addDocument(basePDF);
newPDF.addDocument(legendInformation);


Also, make sure you are creating tagged output.  In your code:
newPDF.setTagged();


Best regards,

Raf Hens
iText Software

------------------------------------------------------------------------------
Want excitement?
Manually upgrade your production database.
When you want reliability, choose Perforce
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to