I'm using the code below to remove the header and footer from multiple pages
of a pdf file. The header and footer is removed but the file size is bigger
than before. Any idea why that is happening? Any ideas suggestions will be
really help ful.
private static void removeHeaderFooter( PdfCopy copier)
throws IOException, DocumentException,
FileNotFoundException {
PdfReader reader;
PdfDictionary pageDict =null;
//now read the temp file and remove header and footer
reader = new PdfReader(tempFile);
reader.consolidateNamedDestinations();
int n = reader.getNumberOfPages();
for (int i = 0; i < n; ) {
++i;
pageDict = reader.getPageN(i);
pageDict.put(PdfName.CROPBOX, new PdfRectangle(newBounds));
}
PdfStamper stamper = new PdfStamper(reader, new
FileOutputStream(temp_clipped));
stamper.close();
}
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
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