Bruno / Paulo, Thanks both for your answers, i haven't got to try them yet, but they given me more confidence in thinking i'll be able to do what i need. Much appreciated, esp the quickness of response. Anthony Maguire Oakton ph: (03) 9617 0200 fax: (03) 9621 1951 Mobile: 0416 766 931 www.oakton.com.au <https://melb.oakton.com.au/exchweb/bin/redir.asp?URL=http://www.oakton.com.au>
________________________________ From: [EMAIL PROTECTED] on behalf of Bruno Lowagie (iText) Sent: Mon 25/06/2007 9:09 PM To: Post all your questions about iText here Subject: Re: [iText-questions] Add content to an existing PDF document Anthony Maguire wrote: > As it stands i'm getting a handle on the PDFStamper and the PDFContentByte > object > of the document i want to change. After that i'm basically just writing text to > designated coordinates, and through trial and error finding out the right coordinates. Yes, trial and error is necessary except if you have a PDF with form fields. In that case, you could fill the fields with iText, or ask iText for the coordinates of the fields. > But it there a better way than this, should i be overlaying a table and > writing > to the table and it cells. You can't grab an existing table from a PDF and then change the cells, but you can always create a PdfPTable and write it to the direct content (PdfContentByte) with the method writeSelectedRows (chapter 6). > One of the problems i've noticed is that i need some text to be RIGHT > justified No problem with the method showTextAligned (chapter 11). > Problem is here, if i change fonts, then the alignment is off. > Also i need to write some texts to the document, does wrapping > work automatically or do i need to figure out how long each line > is and only right out the amount less than the width of the document? You definitely need the class ColumnText for this (chapter 7). > Sorry if this email is long-winded, and i can only imagine one > that has been answered many times before, but i can't find the > necessary threads. I have also bought the iText in Action book, > but it doesn't say definitely what can and cannot be done. I've referred to the chapter numbers. > And the document i'm writing to is an AcroForm document. If the original document is an AcroForm document, retrieve the coordinates as explained in chapter 16. If it's not, and you want to make it an AcroForm, use the method addAnnotation. best regards, Bruno ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://itext.ugent.be/itext-in-action/ IMPORTANT 1. This email and any attachments are confidential. Any unauthorised dissemination or other use of these materials is prohibited. If received in error, please contact us and delete all copies. 2. Before opening or using attachments, check them for viruses and defects. Our liability is limited to resupplying any affected attachments. 3. Protecting your privacy is important to us. Our privacy statement and further information is available at www.oakton.com.au.
<<winmail.dat>>
------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/
_______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://itext.ugent.be/itext-in-action/
