Hello Dirk
Your response sounds promising. Can you send me an example if you have
something. The code what you have written below is little confusing for me, as
we cannot instantiate PdfTemplate(constructor is private) and also it doesn't
take 3 parameters. Please respond back as soon as possible.
Thanks
Venkat
Dirk Wellmann <dw <at> pdsoft.de> writes:

>
> Hi Venkat,
>
> I used the Template of the Document. Just make an Instance of a PdfWriter
with a
> new empty PDF-Document, add the existing one via a PdfReader as
> DirectContentUnder, then you can add your own Content in the normal way,
> using addParagraph .... :
>
> com.lowagie.text.pdf.PdfReader pReader = null;
> com.lowagie.text.pdf.PdfWriter pWriter = null;
>
> pReader = new pdfTemplate(this.getDokumentIdent (), this.getFormName (),
true);
> pWriter = com.lowagie.text.pdf.PdfWriter.getInstance (pdfDoc, new
>           FileOutputStream (getFile ()));
>
> // get DirectContentUnder from your created Writer
> PdfContentByte cb = pWriter.getDirectContentUnder();
>
> // Read the first Page of your exsisting Document
> PdfImportedPage p1 = pWriter.getImportedPage (pReader,1);
>
> // add it as Template in the Backround of your new Document
> cb.addTemplate(p1,0,0);
>
> // now add your own stuff
> .....
>
> this can be done for every page you can read with the pReader
>
>
> Your Mail from Wed, 10 Nov 2004 16:08:08-0600(Venkat
> Pabbati[Venkat Pabbati<vpabbati <at> theocc.com>]):
> > Hello
> > I have a requirement in my curret project that there is an existing pdf
> > document, I will have to add few lines and an image to the start of the
> > exisitng document. Also will have to add some text at the end of the
> > document. If I use 'PdfCopy' I am having the content added is shown in one
> > different page at the start. But we want it to be part of the same page of
> > the rest of the document. Please give me solution, we need it urgently.
> >
> > Thank you very much in advance.
> > Venkat
>
>

Reply via email to