> If this is currently not supported in iText (I suppose it isn't), is > there any possibility to get this added through sponsoring?
Yep. http://www.itextsoftware.com > Or can > anyone give me some clues on how I could add this myself? Lets see here... Examples of how to add optional content (aka "layers") to a PDF: http://itextdocs.lowagie.com/tutorial/directcontent/optionalcontent/index.php Adding optional content doesn't look at that hard... the difficulty comes in identifying existing OC when creating the PdfImportedPage. If you wanted to cheat a bit, you could probably grab all the OC info out of the original PDF and cram it into the new one without too much trouble. You'll want to look at section 4.10 of the PDF reference for details: http://www.adobe.com/devnet/pdf/pdfs/PDFReference16.pdf With that information, you can use iTexts low-level object classes (PdfDictionary, PdfArray, etc) to read/write the information you need. --Mark Storer Senior Software Engineer Cardiff.com #include <disclaimer> typedef std::Disclaimer<Cardiff> DisCard; > -----Original Message----- > From: Markus Meyer [mailto:[email protected]] > Sent: Thursday, October 08, 2009 4:17 AM > To: [email protected] > Subject: [iText-questions] Preserving layers when placing > PDFs as image > > > Hi, > > I have code like the following: > > PdfReader reader = new PdfReader("image.pdf"); > PdfImportedPage page = writer.getImportedPage(reader, 1); > Image image = Image.getInstance(page); > image.setAbsolutePosition(0, 0); > image.scalePercent(15f); > document.add(image); > > However, when "image.pdf" contains layers, the layer > information is lost > in the resulting PDF. I'd like to preserve the layer information. > > I found some older posts on this mailing list regarding > layers but I'm > not sure if this exact scenario was already answered. > > > Thanks in advance! > > > Markus > > > -------------------------------------------------------------- > ---------------- > Come build with us! The BlackBerry(R) Developer Conference in SF, CA > is the only developer event you need to attend this year. > Jumpstart your > developing skills, take BlackBerry mobile applications to > market and stay > ahead of the curve. Join us from November 9 - 12, 2009. Register now! > http://p.sf.net/sfu/devconference > _______________________________________________ > iText-questions mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/itext-questions > > Buy the iText book: http://www.1t3xt.com/docs/book.php > Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/ ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.1t3xt.com/docs/book.php Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
