Beppe Costagliola wrote:
Thanks Bruno.
I really need it !!!
Here's a snippet to help you on your way
(I took me a while because I made a newbie mistake):
PdfReader reader = new PdfReader(src.getAbsolutePath());
System.out.println("The original file had " +
reader.getNumberOfPages() + " pages.");
reader.selectPages(selection);
int pages = reader.getNumberOfPages();
System.err.println("The new file has " + pages + " pages.");
Document document = new
Document(reader.getPageSizeWithRotation(1));
PdfCopy copy = new PdfCopy(document, new
FileOutputStream(dest.getAbsolutePath()));
document.open();
PdfImportedPage page;
for (int i = 0; i < pages; ) {
++i;
System.out.println("Processed page " + i);
page = copy.getImportedPage(reader, i);
copy.addPage(page);
}
----- Original Message -----
From: "bruno" <[EMAIL PROTECTED]>
I still have to add selectedPages example I promised (will be a Toolbox
plugin).
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions