On Mon, Nov 30, 2009 at 4:58 AM, Fabrizio Arosio <devlst-it...@yahoo.it>wrote:
> If you need to copy a PDF with annotations to a new PDF without
> annotations, you can use PdfWriter to create a new pdf with all pages
> imported from the source pdf. PdfImportedPage with PdfWriter does not
> preserve annotations.
> Something similar to:
>
> Document document = new Document(PageSize.A4);
> PdfWriter writer = PdfWriter.getInstance(document, new
> FileOutputStream("output.pdf"));
> PdfReader reader = new PdfReader("source.pdf");
> document.open();
> PdfContentByte canvas = writer.getDirectContent();
> for (int i = 1; i <= reader.getNumberOfPages(); i++) {
> canvas.addTemplate(writer.getImportedPage(reader, i), 0, 0);
> document.newPage();
> }
> document.close();
>
> you should also consider source page size and rotation.
> ...
>
Thank you; there might also be a need eventually to strip out annotations.
My current requirement, though, is to "render" the annotations so they
become part of the page images.
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
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/