Thomas Hauk wrote: > Let's say I have a PdfReader object and I want to get a PdfTemplate > object from it for the first page. > > Is the only way to do this through a PdfWriter object? > > pdfTemplate = writer.getImportedPage(pdfReader, 1); > > If not, what is the better way? > > If so, why do I have to create a *writer* object to get a PdfTemplate? > It seems very strange to me -- I don't want to write out anything at > that point. Everything's in-memory up to that point.
That's explained in the book. A page = a page content stream + resources When you get a PdfTemplate (containing the content stream), the resources are already copied to the writer. The PdfTemplate only keeps a reference to those resources (so that you don't have to keep MBs of images and fonts in memory). -- This answer is provided by 1T3XT BVBA http://www.1t3xt.com/ - http://www.1t3xt.info ------------------------------------------------------------------------------ _______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
