GaneshPrakhya wrote:

> - I used your example (BatchFill.java) and able to write document and fill 
> acro fields on both pages.
>
OK, if you have two pages, you will need to keep track of the pages in 
onEndPage.

>Meantime, I even tried to move to next page also, because if I say,
>System.out.println("page No:  " + writer.getPageNumber()); its always showing 
>page 1.
>  
>
That's only possible if nothing was added to the page.
newPage is ignored if nothing was added!

>coordinates[i] = new Rectangle(positions[1], positions[2] + 3,
>positions[3], positions[4] + 3);
>  
>
The +3 is an adjustment (Google for setExtraMargin for more info).

Also onEndPage is definitely wrong. You need an if statement.

>       public void onEndPage(PdfWriter writer, Document doc) {
>  
>
if (writer.getPageNumber % 2 == 0) {

>          canvas.addTemplate(pageOne, 0, 0);
>  
>
}
else {

>          canvas.addTemplate(pageTwo, 0, 0);
>  
>
}

I have no idea what you intend to do with contentOne and contentTwo:

>                       PdfContentByte contentOne = writer.getDirectContent();
>
>                       PdfContentByte contentTwo = writer.getDirectContent();
>  
>
There is no difference between contentOne and contentTwo.
I don't understand why you do this. It's rather absurd...

>                               contentOne.addImage(img);
>  
>
???
Why are you adding the image here? It's already there isn't it?

>                               document.newPage();
>  
>
What does ct.go() return??? Was anything added to the doc.

>                                       ct.go();
>
>                               }
>
>                               //document.newPage();
>  
>
When you compile a piece of code that has too many errors, the compiler 
says: 'too many errors' and it doesn't show you all the errors.
Well, I know what the compiler feels like. There are too many errors in 
your code to give an answer that makes sense... Please take it step by 
step. Don't write any line of code before you know what it does...
br,
Bruno

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to