Hi, 

I am adding the page numbers to my existing PDFs using stamper as below,

BaseFont bf = BaseFont.createFont(BaseFont.TIMES_ROMAN, BaseFont.WINANSI,
BaseFont.NOT_EMBEDDED);
                        PdfContentByte cb1;
                        PdfImportedPage page;
                        
                        for (int i = 1; i <= reader.getNumberOfPages(); i++) {
                                
                                page = stamp.getImportedPage(reader, i);        
                        
                                cb1 = stamp.getOverContent(i);
                                cb1.setFontAndSize(bf, 7);
                                cb1.beginText();
                                cb1.setTextMatrix(page.getWidth()/2, 20);
                                if(pageNumberMap == null){
                                
                                        cb1.showText("Page 
"+i+"/"+reader.getNumberOfPages());
                                }else{
                                        cb1.showText("Page " + 
pageNumberMap.get(sortedKeys.get(i-1)));
                                }
                                cb1.endText();
                        }
                        stamp.close();
                        reader.close();
                        pdfOut.close();




But for some PDFs (large pdfs) size of the PDS is increasing very
significantly. From 1.36 MB to 2.89MB :(
Where am I doing it wrong?
Note: I am not embedding the font. 


--
View this message in context: 
http://itext-general.2136553.n4.nabble.com/Adding-page-number-with-pdf-stamper-increases-the-pdf-size-tp4015574p4015574.html
Sent from the iText - General mailing list archive at Nabble.com.

------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
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

Reply via email to