[iText-questions] Import pages to PdfWriter
Hiyas I've got a PDF with form fields that I want to fill with different values and, for each database record, fill up a huge PDF with a copy of the PDF Form I just read and filled out. The filling of the values works perfectly, but this code here: private void copyPages(final byte[] pdfArray, PdfWriter writer) throws IOException, DocumentException { PdfReader reader = new PdfReader(pdfArray); try { for (int i=1; i=reader.getNumberOfPages(); i++) { PdfImportedPage importedPage = writer.getImportedPage(reader, i); writer.getDirectContent().addTemplate(importedPage, 0, 0); writer.newPage(); } } finally { writer.freeReader(reader); } } Somehow doesn't want to add a new page in the huge PDF. For each database record I fetch, it simply puts one page over each other, never incrementing the page number of the writer (the huge PDF has exactly one page after everything is written). Shouldn't newPage() on the PdfWriter create a new page that I can fill when the next record is found or am I doing something wrong here? Thanks Rog /* * Roger Misteli - ABACUS Research AG * email: [EMAIL PROTECTED] * Klingon function calls do not have 'parameters' - they have 'arguments'.. * and they ALWAYS WIN THEM. */ --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_ide95alloc_id396op=click ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions
Re: [iText-questions] Import pages to PdfWriter
It's Document.newPage(). --- Roger Misteli [EMAIL PROTECTED] wrote: Hiyas I've got a PDF with form fields that I want to fill with different values and, for each database record, fill up a huge PDF with a copy of the PDF Form I just read and filled out. The filling of the values works perfectly, but this code here: private void copyPages(final byte[] pdfArray, PdfWriter writer) throws IOException, DocumentException { PdfReader reader = new PdfReader(pdfArray); try { for (int i=1; i=reader.getNumberOfPages(); i++) { PdfImportedPage importedPage = writer.getImportedPage(reader, i); writer.getDirectContent().addTemplate(importedPage, 0, 0); writer.newPage(); } } finally { writer.freeReader(reader); } } Somehow doesn't want to add a new page in the huge PDF. For each database record I fetch, it simply puts one page over each other, never incrementing the page number of the writer (the huge PDF has exactly one page after everything is written). Shouldn't newPage() on the PdfWriter create a new page that I can fill when the next record is found or am I doing something wrong here? Thanks Rog /* * Roger Misteli - ABACUS Research AG * email: [EMAIL PROTECTED] * Klingon function calls do not have 'parameters' - they have 'arguments'.. * and they ALWAYS WIN THEM. */ --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_ide95alloc_id396op=click ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions __ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions
[iText-questions] Import pages
Hi, current iText version doesn't support real copy of pages. I've added new funcionality that it allow to copy also outlines. My problem is in the copy of Annotations. Is there someone that can help me? Thanks, Paolo Aldovini --- This sf.net email is sponsored by: See the NEW Palm Tungsten T handheld. Power Color in a compact size! http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en ___ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions
Re: [iText-questions] Import pages
At 10:19 AM +0100 11/8/02, [EMAIL PROTECTED] wrote: current iText version doesn't support real copy of pages. Correct, though it is coming... I've added new funcionality that it allow to copy also outlines. My problem is in the copy of Annotations. Is there someone that can help me? What type of help do you need? Please be specific. Leonard -- --- Leonard Rosentholmailto:leonardr;pdfsages.com Chief Technical Officer http://www.pdfsages.com PDF Sages, Inc. 215-629-3700 (voice) 215-629-0789 (fax) --- This sf.net email is sponsored by: See the NEW Palm Tungsten T handheld. Power Color in a compact size! http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en ___ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions
[iText-questions] Re: [iText-questions] Import pages
I've gotten successfully all informations about annotations in the input page, but I'm not able to write them into output page. I've tried to use PdfAnnotation.createLink method but without success. How can I write PdfAnnotation? Paolo At 10:19 AM +0100 11/8/02, [EMAIL PROTECTED] wrote: current iText version doesn't support real copy of pages. Correct, though it is coming... I've added new funcionality that it allow to copy also outlines. My problem is in the copy of Annotations. Is there someone that can help me? What type of help do you need? Please be specific. Leonard -- -- - Leonard Rosentholmailto:leonardr;pdfsages .com Chief Technical Officer http://www.pdfsages.com PDF Sages, Inc. 215-629-3700 (voice) 215-629-0789 (fax) --- This sf.net email is sponsored by: See the NEW Palm Tungsten T handheld. Power Color in a compact size! http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en ___ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions
Re: [iText-questions] Import pages
Leonard, this is a sympathetic comment: Doesn't it make you feel bad always having to tell people what you're going to give them and never having time to perfect it for delivery? I've been going through this for over a year with a particular project I am working on and it fills me with guilt every time I mention it to its user community... :) -Matt --- Leonard Rosenthol [EMAIL PROTECTED] wrote: At 4:02 PM +0100 11/8/02, [EMAIL PROTECTED] wrote: I've gotten successfully all informations about annotations in the input page, but I'm not able to write them into output page. I've tried to use PdfAnnotation.createLink method but without success. How can I write PdfAnnotation? Well, the page copier that will appear in future iText's doesn't attempt to convert input stuctures to output structures (PdfAnnotation is for output only) - instead it actually copies the lower level PDF data. In order to do the approach that you are doing, I suspect that you are going to need to extend PdfAnnotation to support a wider set of functions to be able to losslessly convert. Leonard -- --- Leonard Rosenthol mailto:leonardr;pdfsages.com Chief Technical Officer http://www.pdfsages.com PDF Sages, Inc. 215-629-3700 (voice) 215-629-0789 (fax) --- This sf.net email is sponsored by: See the NEW Palm Tungsten T handheld. Power Color in a compact size! http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en ___ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions __ Do you Yahoo!? U2 on LAUNCH - Exclusive greatest hits videos http://launch.yahoo.com/u2 --- This sf.net email is sponsored by: See the NEW Palm Tungsten T handheld. Power Color in a compact size! http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en ___ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions
Re: [iText-questions] Import pages
At 7:38 AM -0800 11/8/02, Matt Benson wrote: Doesn't it make you feel bad always having to tell people what you're going to give them and never having time to perfect it for delivery? I FINALLY sent the code to Paolo last night ;). Leonard -- --- Leonard Rosentholmailto:leonardr;pdfsages.com Chief Technical Officer http://www.pdfsages.com PDF Sages, Inc. 215-629-3700 (voice) 215-629-0789 (fax) --- This sf.net email is sponsored by: See the NEW Palm Tungsten T handheld. Power Color in a compact size! http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en ___ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions
Re: [iText-questions] Import pages
Great, don't know when or whether I'll need it but it's always nice to see iText grow, which it's done a lot since I first started using it. -Matt --- Leonard Rosenthol [EMAIL PROTECTED] wrote: At 7:38 AM -0800 11/8/02, Matt Benson wrote: Doesn't it make you feel bad always having to tell people what you're going to give them and never having time to perfect it for delivery? I FINALLY sent the code to Paolo last night ;). Leonard -- --- Leonard Rosenthol mailto:leonardr;pdfsages.com Chief Technical Officer http://www.pdfsages.com PDF Sages, Inc. 215-629-3700 (voice) 215-629-0789 (fax) __ Do you Yahoo!? U2 on LAUNCH - Exclusive greatest hits videos http://launch.yahoo.com/u2 --- This sf.net email is sponsored by: See the NEW Palm Tungsten T handheld. Power Color in a compact size! http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en ___ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions
Re: [iText-questions] Import pages
Quoting Leonard Rosenthol [EMAIL PROTECTED]: I FINALLY sent the code to Paolo last night ;). I will make the time to put Paulo's release on CVS and on my site maximum 1 week after it is published on his site. Bruno --- This sf.net email is sponsored by: See the NEW Palm Tungsten T handheld. Power Color in a compact size! http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en ___ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions
[iText-questions] import pages
hello, what am I doing wrong in the following: public class DummyPDF{ DummyPDF(String name, String file, int dest) { Document document = new Document(); try { PdfWriter writer = PdfWriter.getInstance (document, new FileOutputStream(name)); PdfReader reader = new PdfReader(file); document.open(); document.add( new Paragraph( initial document + name)); PdfImportedPage pip = writer.getImportedPage(m_reader, dest); document.close(); } catch(Exception e){ } } public static void main(String[] args) { if (args.length = 3) { try { int i = Integer.parseInt(args[2]); new DummyPDF(args[0], args[1], i); } catch (NumberFormatException e) {} } } } When I run java DummyPDF file1.pdf file2.pdf 7, the resulting file1.pdf only shows the inserted paragraph in Acrobat Reader. On the other hand, something seems to be written to file1.pdf and its size will depend on what is to be imported. appreciating any help Jezebel --- Bavaria ubique -- __ Do you Yahoo!? Y! Web Hosting - Let the expert host your web site http://webhosting.yahoo.com/ --- This sf.net emial is sponsored by: Influence the future of Java(TM) technology. Join the Java Community Process(SM) (JCP(SM)) program now. http://ad.doubleclick.net/clk;4699841;7576301;v? http://www.sun.com/javavote ___ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions