Hi,

I wante change the page size of an exisiting pdf without scaling the 
content. I tried this:

Rectangle pageSize = new Rectangle(urx, ury);
Document doc = new Document(pageSize);
PdfCopy copy = new PdfCopy(doc, new FileOutputStream(outputURI));    
doc.open();
for (int i = 0; i < this.numberOfPages;) {
     ++i;
    copy.addPage(copy.getImportedPage(reader, i));
}
doc.close();

There were two problems:

1. the page size is still the original page size from the reader, not 
changed.
2. the xmp metadata is lost in the copy.

Is there any better way in iText to change the page size that I haven't 
known? Or I have to touch stuff like crop box and media box? Thanks very 
much for any hints!
I can stamp the xmp metadata to the copy to work around the second 
problem. Is there any better solution? Thanks!

Best Regards,
Ellen N. Zhao
-- 

HaCon Ingenieurgesellschaft mbH
Lister Str. 15
30163 Hannover
Germany/Deutschland
Tel. +49 511 33699-363
Fax. +49 511 33699-99
Email: [EMAIL PROTECTED]
http://www.hacon.de

Registry Court/Amtsgericht Hannover HRB 1712
Managing Directors/Geschäftsführer: Michael Frankenberg,
Dr.-Ing. Marian Gaidzik, Dr.-Ing. Werner Kretschmer,
Werner Sommerfeld, Dr.-Ing. Volker Sustrate, Peter Talke 


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Do you like iText?
Buy the iText book: http://www.1t3xt.com/docs/book.php
Or leave a tip: https://tipit.to/itexttipjar

Reply via email to