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: ning.zhao@...
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
|