Re: [iText-questions] Problem with Adding image to document onEndPage

2013-01-10 Thread Harsha Kaundinya
Thank you iText Info. U did a great help to me in providing a quick solution. Thank you, Harsha On Thu, Jan 10, 2013 at 2:15 PM, iText Info wrote: > Op 10/01/2013 4:16, Harsha Kaundinya schreef: > > > > I have one small doubt regarding this issue again. When i used to > > generate this report

Re: [iText-questions] Problem with Adding image to document onEndPage

2013-01-10 Thread iText Info
Op 10/01/2013 4:16, Harsha Kaundinya schreef: > > I have one small doubt regarding this issue again. When i used to > generate this report, few reports used to get generated, but few > failed. Is there any reason why a report with 4 or more pages report > failed while a smaller report generated

Re: [iText-questions] Problem with Adding image to document onEndPage

2013-01-09 Thread Harsha Kaundinya
Hi, I have one small doubt regarding this issue again. When i used to generate this report, few reports used to get generated, but few failed. Is there any reason why a report with 4 or more pages report failed while a smaller report generated? And why doesnt document.add(image) on onEndPage met

Re: [iText-questions] Problem with Adding image to document onEndPage

2013-01-09 Thread Harsha Kaundinya
Thank you so much... The solution is working... Thanks, Harsha On Mon, Jan 7, 2013 at 10:48 PM, 1T3XT BVBA wrote: > On 7/01/2013 17:44, Harsha Kaundinya wrote: > > Thank you... But then, how do we add images to the header each time? > > Create an Image instance OUTSIDE the onEndPage() method.

Re: [iText-questions] Problem with Adding image to document onEndPage

2013-01-07 Thread 1T3XT BVBA
On 7/01/2013 17:44, Harsha Kaundinya wrote: > Thank you... But then, how do we add images to the header each time? Create an Image instance OUTSIDE the onEndPage() method. Define its absolute position. Add it like this: PdfContentByte cb = writer.getDirectContent(); cb.addImage(image); You shoul

Re: [iText-questions] Problem with Adding image to document onEndPage

2013-01-07 Thread Harsha Kaundinya
Thank you... But then, how do we add images to the header each time? Thank you, Harsha On Mon, Jan 7, 2013 at 8:16 PM, iText Info wrote: > Op 7/01/2013 15:21, Harsha Kaundinya schreef: > > What could the actual problem be? > The main problem is you not reading the documentation. > The document

Re: [iText-questions] Problem with Adding image to document onEndPage

2013-01-07 Thread iText Info
Op 7/01/2013 15:21, Harsha Kaundinya schreef: > What could the actual problem be? The main problem is you not reading the documentation. The documentation is very explicit about this: use the Document object for Read-Only purposes only in the page event methods. Do not use document.add() in onEndP

[iText-questions] Problem with Adding image to document onEndPage

2013-01-07 Thread Harsha Kaundinya
Hi All, I am facing a very weird problem. I have code to add image to the header which i write in the method onEndPage by extending PdfPageEventHelper to my class. public void onEndPage(PdfWriter writer, Document document) { try{ document.add(img); }catch(DocumentException de){ de.printStackTrace