On 2012-04-02 10:27, iText Info wrote: > Op 2/04/2012 10:19, Michel Onoff schreef: >> Just out of curiosity, I tried the brand new latest release of iText but >> the result does not change: with the code below (adapted from section >> 6.2 of the iText book) the OCGs somehow are not transferred correctly. > Er... > I quote p193 Table 6.1 item PdfWriter: "The major downside is that all > interactive features of the imported page (...) are lost in the process." > OCG is an interactive feature, so it gets lost. You haven't told us what > you're trying to do, but in any case: you're using the wrong class! Why > aren't you using PdfStamper? >
"Optional Content" is described in section 4.10 of chapter "Graphics" of the PDF Reference 1.7 while "Interactive Features" is the subject of chapter 8. Hence, it comes as a surprise to me that iText designers decided to make OCGs part of the interactive features (user preferences, doc navigation, actions, forms, etc.). But, OK, I'll try with PdfStamper, although in my understanding this class is useful to add new contents or to alter existing one, not to merely copy contents from an existing doc to a new one. What I'm trying to do is explained in my previous posts but I can try to describe it anew here. I want to parse existing documents (not necessarily created with iText), resize the pages if necessary and create a new doc which is essentially is a copy of the original. The original docs are not always syntactically and structurally 100% correct. Thus, I rely on PdfReader tolerance to parse them anyway when possible and on PdfWriter (or PdfStamper?) to produce correct syntax. Apart from the size of the pages, the copy produced by iText should have the same overall appearance as the original, although the internal details can be different (syntax, page tree, object IDs, etc.) ------------------------------------------------------------------------------ This SF email is sponsosred by: Try Windows Azure free for 90 days Click Here http://p.sf.net/sfu/sfd2d-msazure _______________________________________________ iText-questions mailing list [email protected] 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
