Re: [iText-questions] PHP port in the works
I was also wondering the progress of the iText-to-PHP port. Is there a publicly-accessible repository where the current code could be checked out? I'd be willing to help test as I'm the real new maintainer of Fill PDF (Drupal) :) -- View this message in context: http://itext-general.2136553.n4.nabble.com/PHP-port-in-the-works-tp2154422p3173184.html Sent from the iText - General mailing list archive at Nabble.com. -- Learn how Oracle Real Application Clusters (RAC) One Node allows customers to consolidate database storage, standardize their database environment, and, should the need arise, upgrade to a full multi-node Oracle RAC database without downtime or disruption http://p.sf.net/sfu/oracle-sfdevnl ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Many questions posted to this list can (and will) be answered with a reference to the iText book: http://www.itextpdf.com/book/ Please check the keywords list before you ask for examples: http://itextpdf.com/themes/keywords.php
Re: [iText-questions] PHP port in the works
Op 4/01/2011 9:32, wizonesolutions schreef: I was also wondering the progress of the iText-to-PHP port. Is there a publicly-accessible repository where the current code could be checked out? I'd be willing to help test as I'm the real new maintainer of Fill PDF (Drupal) :) The official developers of iText are not working on a PHP port for iText (and never have worked on such a port). Several people have offered to write such a port, but nobody succeeded. If you want to invest in such a port, maybe @dries and @bruno1970 can write an offer and make a quote. -- Learn how Oracle Real Application Clusters (RAC) One Node allows customers to consolidate database storage, standardize their database environment, and, should the need arise, upgrade to a full multi-node Oracle RAC database without downtime or disruption http://p.sf.net/sfu/oracle-sfdevnl ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Many questions posted to this list can (and will) be answered with a reference to the iText book: http://www.itextpdf.com/book/ Please check the keywords list before you ask for examples: http://itextpdf.com/themes/keywords.php
Re: [iText-questions] Problem adding ColumnText onto existing Document
Op 4/01/2011 6:18, Dave Shevett schreef: 1) I create PdfContentByte 'cb' on a Document This is not consistent with the way I interpret your requirement. I assumed that you were talking about an EXISTING FORM. Now I see that you create PdfContentByte on a Document object. This is strange for two reasons: - Document is only used when you create a PDF from scratch; - if you create a PDF from scratch, you get a PdfContentByte from a PdfWriter object, not from a Document object. 2) Using lines like this, I place 'badge rows' (br) where i want them: I don't understand why you are using this approach. Why aren't you using a real interactive form? Why are you using cb.showTextAligned(), it's easier to use ct.showTextAligned(). If this code executes, all OTHER fields on the document disappear, and I end up with just a few characters of the field, with the X through it, and nothing else on the document. What am I doing wrong? Hard to tell: you only provide part of the code, NOT the code that matters. Please write a small example that we can run in standalone mode. Also show us the original PDF: is it a form? You are using PdfStamper, aren't you? If not: please read the documentation. -- Learn how Oracle Real Application Clusters (RAC) One Node allows customers to consolidate database storage, standardize their database environment, and, should the need arise, upgrade to a full multi-node Oracle RAC database without downtime or disruption http://p.sf.net/sfu/oracle-sfdevnl ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Many questions posted to this list can (and will) be answered with a reference to the iText book: http://www.itextpdf.com/book/ Please check the keywords list before you ask for examples: http://itextpdf.com/themes/keywords.php
Re: [iText-questions] printing notes
Op 3/01/2011 23:56, va schreef: thanks in advance, expecially to 1T3XT BVBA that helped me in the first part. you are the welcomed here! I think this isn't something you can solve in an onEndPage method. I think you should go for a solution where you take control over the distribution of the content yourself. I'd create two ColumnText objects: one for the main content, one for the notes. Add content to the first column, and fill the second column accordingly with the notes. Add the columns to a page in SIMULATION MODE on a regular basis. This allows you to get information about the number of lines and the Y positions of each column. Add content as long as both columns fit on one page. As soon as the content doesn't fit, go one step back, fill the page and go to a new page. Plenty of iterations will be necessary. You'll also need to fill the Column anew after every simulation. -- Learn how Oracle Real Application Clusters (RAC) One Node allows customers to consolidate database storage, standardize their database environment, and, should the need arise, upgrade to a full multi-node Oracle RAC database without downtime or disruption http://p.sf.net/sfu/oracle-sfdevnl ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Many questions posted to this list can (and will) be answered with a reference to the iText book: http://www.itextpdf.com/book/ Please check the keywords list before you ask for examples: http://itextpdf.com/themes/keywords.php
[iText-questions] Letter Tag with XML Implementation
I have a webapp which uses a SAXParser to build a PDF document based on an XML file. The entire XML file is enclosed with a lettter and /letter tag. Does the /letter tag close the Document object? What does the /letter tag do? Is it equivalent to ending a Paragraph? I'm also trying to modify this webapp to build multi-page PDF documents by applying multiple XML files (one per page - each page has different content). Is this possible in iText 2? Are there any examples in the iText 2 book? Thanks! -- View this message in context: http://itext-general.2136553.n4.nabble.com/Letter-Tag-with-XML-Implementation-tp3172765p3172765.html Sent from the iText - General mailing list archive at Nabble.com. -- Learn how Oracle Real Application Clusters (RAC) One Node allows customers to consolidate database storage, standardize their database environment, and, should the need arise, upgrade to a full multi-node Oracle RAC database without downtime or disruption http://p.sf.net/sfu/oracle-sfdevnl ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Many questions posted to this list can (and will) be answered with a reference to the iText book: http://www.itextpdf.com/book/ Please check the keywords list before you ask for examples: http://itextpdf.com/themes/keywords.php
Re: [iText-questions] Letter Tag with XML Implementation
Op 3/01/2011 23:37, david100 schreef: I have a webapp which uses a SAXParser to build a PDF document based on an XML file. The entire XML file is enclosed with alettter and/letter tag. Does the/letter tag close the Document object? What does the /letter tag do? Is it equivalent to ending a Paragraph? This is a very strange question. I assume that the letter tag in your XML is the root tag of your document. It was CHOSEN by the person who wrote the DTD or the XSD. The meaning of this tag is defined by that very same person. I assume he thought: the content of this XML document is a letter, so let's call the root tag letter. Now it's up to you to interpret this tag. iText doesn't care what name was given to the tag. You have to deal with it in your DocumentHandler. I'm also trying to modify this webapp to build multi-page PDF documents by applying multiple XML files (one per page - each page has different content). Is this possible in iText 2? This is possible if you make it possible. I don't recall I've ever had to do this, but IMO it's not that difficult to achieve. Just adapt the DocumentHandler you wrote to parse the single XML, and adapt it so that the Document object isn't closed when the closing tag of the root is encountered. Are there any examples in the iText 2 book? Not that I know of. It's not a very common requirement. -- Learn how Oracle Real Application Clusters (RAC) One Node allows customers to consolidate database storage, standardize their database environment, and, should the need arise, upgrade to a full multi-node Oracle RAC database without downtime or disruption http://p.sf.net/sfu/oracle-sfdevnl ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Many questions posted to this list can (and will) be answered with a reference to the iText book: http://www.itextpdf.com/book/ Please check the keywords list before you ask for examples: http://itextpdf.com/themes/keywords.php
Re: [iText-questions] Problem adding ColumnText onto existing Document
On 1/4/11 4:01 AM, 1T3XT BVBA wrote: Op 4/01/2011 6:18, Dave Shevett schreef: 1) I create PdfContentByte 'cb' on a Document This is not consistent with the way I interpret your requirement. I assumed that you were talking about an EXISTING FORM. Now I see that you create PdfContentByte on a Document object. This is strange for two reasons: - Document is only used when you create a PDF from scratch; I am creating a PDF from scratch - the image is the resulting badge, which is sent to the printer. - if you create a PDF from scratch, you get a PdfContentByte from a PdfWriter object, not from a Document object. I do this - the full code of the print routine is now here: http://pastebin.stonekeep.com/11528 2) Using lines like this, I place 'badge rows' (br) where i want them: I don't understand why you are using this approach. Why aren't you using a real interactive form? This is an automated print routine for convention badges. It is being run in the background as a format and print routine coming from database data. Why are you using cb.showTextAligned(), it's easier to use ct.showTextAligned(). Can ct.showTextAligned do absolute positioning? If this code executes, all OTHER fields on the document disappear, and I end up with just a few characters of the field, with the X through it, and nothing else on the document. What am I doing wrong? Hard to tell: you only provide part of the code, NOT the code that matters. Please write a small example that we can run in standalone mode. Also show us the original PDF: is it a form? You are using PdfStamper, aren't you? If not: please read the documentation. I'm not using pdfstamper because I'm creating the entire document programmatically from scratch. Thanks again! -d -- Learn how Oracle Real Application Clusters (RAC) One Node allows customers to consolidate database storage, standardize their database environment, and, should the need arise, upgrade to a full multi-node Oracle RAC database without downtime or disruption http://p.sf.net/sfu/oracle-sfdevnl ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Many questions posted to this list can (and will) be answered with a reference to the iText book: http://www.itextpdf.com/book/ Please check the keywords list before you ask for examples: http://itextpdf.com/themes/keywords.php
[iText-questions] Tables and FormFields: Is this a bug?
Hi all, thanks to help of you (especially 1T3XT BVBA) I'm now able to create tables with PdfFormFields in them. But now I'm having a strange side-effect: The code attached generates the attached pdf. As you can see, the PdfFormFields of the last table are drawn on the second page, not in the table as I would expect. My questions: - Am I doing this the wrong way? If so, what is my problem here? - Is this a bug? If so, is there a workaround? Thanks Jonny /* in_action/chapter15/SenderReceiver.java */ package com.foo; import java.io.FileOutputStream; import java.io.IOException; import java.util.Random; import com.lowagie.text.Document; import com.lowagie.text.DocumentException; import com.lowagie.text.ExceptionConverter; import com.lowagie.text.Paragraph; import com.lowagie.text.Rectangle; import com.lowagie.text.pdf.PdfContentByte; import com.lowagie.text.pdf.PdfFormField; import com.lowagie.text.pdf.PdfPCell; import com.lowagie.text.pdf.PdfPCellEvent; import com.lowagie.text.pdf.PdfPTable; import com.lowagie.text.pdf.PdfWriter; import com.lowagie.text.pdf.TextField; /** * This example was written by Bruno Lowagie. It is part of the book 'iText in * Action' by Manning Publications. * ISBN: 1932394796 * http://www.1t3xt.com/docs/book.php * http://www.manning.com/lowagie/ */ public class SenderReceiver1 implements PdfPCellEvent { protected PdfFormField parent; protected String partialFieldName; protected PdfWriter writer; protected boolean required; public SenderReceiver1(PdfWriter writer, PdfFormField parent, String name, boolean required) { this.writer = writer; this.parent = parent; this.partialFieldName = name; this.required = required; } /** * @see com.lowagie.text.pdf.PdfPCellEvent#cellLayout(com.lowagie.text.pdf.PdfPCell, * com.lowagie.text.Rectangle, com.lowagie.text.pdf.PdfContentByte[]) */ public void cellLayout(PdfPCell cell, Rectangle rect, PdfContentByte[] cb) { TextField tf = new TextField(writer, new Rectangle(rect.getLeft(2), rect .getBottom(2), rect.getRight(2), rect.getTop(2)), partialFieldName); if (required) tf.setOptions(TextField.REQUIRED); tf.setFontSize(12); try { parent.addKid(tf.getTextField()); } catch (Exception e) { throw new ExceptionConverter(e); } } public static void main(String[] args) { System.out.println(Chapter 15: example Sender Receiver); System.out.println(- Creates a PDF file with an AcroForm); System.out.println(- jars needed: iText.jar); System.out.println(- files generated in /results subdirectory:); System.out.println( sender_receiver.pdf); // step 1 Document document = new Document(); try { // step 2 PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(C:/Temp/senderreceiver_ + new Random().nextInt() + .pdf)); // step 3 document.open(); // step 4 document.add(new Paragraph(Sender)); PdfFormField sender = PdfFormField.createEmpty(writer); sender.setFieldName(sender); document.add(createTable(writer, sender)); writer.addAnnotation(sender); document.add(new Paragraph(Sender1)); PdfFormField sender1 = PdfFormField.createEmpty(writer); sender1.setFieldName(sender1); document.add(createTable(writer, sender1)); writer.addAnnotation(sender1); document.add(new Paragraph(Sender2)); PdfFormField sender2 = PdfFormField.createEmpty(writer); sender2.setFieldName(sender2); document.add(createTable(writer, sender2)); writer.addAnnotation(sender2); document.add(new Paragraph(Sender3)); PdfFormField sender3 = PdfFormField.createEmpty(writer); sender3.setFieldName(sender3); document.add(createTable(writer, sender3)); writer.addAnnotation(sender3); document.add(new Paragraph(Sender4)); PdfFormField sender4 =
Re: [iText-questions] printing notes
ok, but the table it's added to the first ColumnText all in one go when it is compleatly loaded (ct.addElement(t)), and then starts the ColumnText loop that tries to flash the entire table, doasn't manage to and split it across n° pages. In this case I would have to say to the ColumnText to try to flash one table row at a time. I saw the example in the book using the simulation mode (status=ct.go(true)) but that example reads lines from a txt flie, one at a time. I need to mantaint a tabular structure. one PdfPTable per row? my good! and after thatis it always valid to detect the note from the table with the generic tag? becouse unless the page hasn' been fleshed on the page with ct.go(), the onGenerTag() method seems to be unable to detect any note. would it works the same in the simulation mode? tanck you again -- View this message in context: http://itext-general.2136553.n4.nabble.com/printing-notes-tp3172791p3173580.html Sent from the iText - General mailing list archive at Nabble.com. -- Learn how Oracle Real Application Clusters (RAC) One Node allows customers to consolidate database storage, standardize their database environment, and, should the need arise, upgrade to a full multi-node Oracle RAC database without downtime or disruption http://p.sf.net/sfu/oracle-sfdevnl ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Many questions posted to this list can (and will) be answered with a reference to the iText book: http://www.itextpdf.com/book/ Please check the keywords list before you ask for examples: http://itextpdf.com/themes/keywords.php
Re: [iText-questions] Letter Tag with XML Implementation
Thanks for the response. I did some more searching in the code and found that the letter tag maps to ElementTags.ITEXT. I looked in the javadoc and it said that ElementTags.ITEXT is the root tag. Would the root tag translate to being a Document or Paragraph object or something else? If I applied two XML files via the SAXParser which both have a letter and /letter tag, would this produce an invalid PDF document? -- View this message in context: http://itext-general.2136553.n4.nabble.com/Letter-Tag-with-XML-Implementation-tp3172765p3173581.html Sent from the iText - General mailing list archive at Nabble.com. -- Learn how Oracle Real Application Clusters (RAC) One Node allows customers to consolidate database storage, standardize their database environment, and, should the need arise, upgrade to a full multi-node Oracle RAC database without downtime or disruption http://p.sf.net/sfu/oracle-sfdevnl ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Many questions posted to this list can (and will) be answered with a reference to the iText book: http://www.itextpdf.com/book/ Please check the keywords list before you ask for examples: http://itextpdf.com/themes/keywords.php
Re: [iText-questions] printing notes
Op 4/01/2011 15:43, va schreef: I need to mantaint a tabular structure. one PdfPTable per row? my good! Not necessarily: I overlooked the fact that you were using a PdfPTable. Why don't you add the table row per row using writeSelectedRows. Use a ColumnText object for the notes (all in simulation mode, just to detect the necessary height). As soon as there's no more room for another row, write the notes for real, then go to the next page for more rows. -- Learn how Oracle Real Application Clusters (RAC) One Node allows customers to consolidate database storage, standardize their database environment, and, should the need arise, upgrade to a full multi-node Oracle RAC database without downtime or disruption http://p.sf.net/sfu/oracle-sfdevnl ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Many questions posted to this list can (and will) be answered with a reference to the iText book: http://www.itextpdf.com/book/ Please check the keywords list before you ask for examples: http://itextpdf.com/themes/keywords.php
Re: [iText-questions] Letter Tag with XML Implementation
Op 4/01/2011 15:44, david100 schreef: Thanks for the response. I did some more searching in the code and found that theletter tag maps to ElementTags.ITEXT. In what code? I assume you're referring to YOUR code. Or are you referring to some existing example? You're not being clear. I know iText, but I'm pretty sure the letter tag is defined somewhere in iText. I looked in the javadoc and it said that ElementTags.ITEXT is the root tag. Would the root tag translate to being a Document or Paragraph object or something else? The root tag is the root tag. You can map it to anything you want. If you want to map it to a Document, fine! If you want to map it to a Paragraph, that's fine by me too! It would help if you told us what your goal is. Now you're only frustrating us. If I applied two XML files via the SAXParser which both have aletter and/letter tag, would this produce an invalid PDF document? How is that relevant? You're the one writing the DocumentHandler, aren't you? I'm sorry, what is your problem? Did you write any code yet? (I haven't seen any.) -- Learn how Oracle Real Application Clusters (RAC) One Node allows customers to consolidate database storage, standardize their database environment, and, should the need arise, upgrade to a full multi-node Oracle RAC database without downtime or disruption http://p.sf.net/sfu/oracle-sfdevnl ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Many questions posted to this list can (and will) be answered with a reference to the iText book: http://www.itextpdf.com/book/ Please check the keywords list before you ask for examples: http://itextpdf.com/themes/keywords.php
Re: [iText-questions] Tables and FormFields: Is this a bug?
Op 4/01/2011 14:45, Johannes Becker schreef: Hi all, thanks to help of you (especially 1T3XT BVBA) I'm now able to create tables with PdfFormFields in them. But now I'm having a strange side-effect: The code attached generates the attached pdf. As you can see, the PdfFormFields of the last table are drawn on the second page, not in the table as I would expect. You're using a mighty old version of iText. I can tell because you're still using com.lowagie classes. Does the problem also exist in the most recent iText version? -- Learn how Oracle Real Application Clusters (RAC) One Node allows customers to consolidate database storage, standardize their database environment, and, should the need arise, upgrade to a full multi-node Oracle RAC database without downtime or disruption http://p.sf.net/sfu/oracle-sfdevnl ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Many questions posted to this list can (and will) be answered with a reference to the iText book: http://www.itextpdf.com/book/ Please check the keywords list before you ask for examples: http://itextpdf.com/themes/keywords.php
Re: [iText-questions] Problem adding ColumnText onto existing Document
Op 4/01/2011 14:23, Dave Shevett schreef: I do this - the full code of the print routine is now here: http://pastebin.stonekeep.com/11528 I'm pretty sure that you're adding all the data, but that you're covering most of the data with an Image. You should realize that parameters such as Image.UNDERLYING don't have any effect if you write to the direct content. -- Learn how Oracle Real Application Clusters (RAC) One Node allows customers to consolidate database storage, standardize their database environment, and, should the need arise, upgrade to a full multi-node Oracle RAC database without downtime or disruption http://p.sf.net/sfu/oracle-sfdevnl ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Many questions posted to this list can (and will) be answered with a reference to the iText book: http://www.itextpdf.com/book/ Please check the keywords list before you ask for examples: http://itextpdf.com/themes/keywords.php
Re: [iText-questions] Tables and FormFields: Is this a bug?
Hi, thanks for the quick reply. Does the problem also exist in the most recent iText version? Yes it does (iText 5.0.5). Thanks Jonny Am 04.01.2011 17:37, schrieb 1T3XT BVBA: Op 4/01/2011 14:45, Johannes Becker schreef: Hi all, thanks to help of you (especially 1T3XT BVBA) I'm now able to create tables with PdfFormFields in them. But now I'm having a strange side-effect: The code attached generates the attached pdf. As you can see, the PdfFormFields of the last table are drawn on the second page, not in the table as I would expect. You're using a mighty old version of iText. I can tell because you're still using com.lowagie classes. Does the problem also exist in the most recent iText version? -- Learn how Oracle Real Application Clusters (RAC) One Node allows customers to consolidate database storage, standardize their database environment, and, should the need arise, upgrade to a full multi-node Oracle RAC database without downtime or disruption http://p.sf.net/sfu/oracle-sfdevnl ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Many questions posted to this list can (and will) be answered with a reference to the iText book: http://www.itextpdf.com/book/ Please check the keywords list before you ask for examples: http://itextpdf.com/themes/keywords.php -- Learn how Oracle Real Application Clusters (RAC) One Node allows customers to consolidate database storage, standardize their database environment, and, should the need arise, upgrade to a full multi-node Oracle RAC database without downtime or disruption http://p.sf.net/sfu/oracle-sfdevnl ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Many questions posted to this list can (and will) be answered with a reference to the iText book: http://www.itextpdf.com/book/ Please check the keywords list before you ask for examples: http://itextpdf.com/themes/keywords.php
Re: [iText-questions] Problem adding ColumnText onto existing Document
Op 4/01/2011 17:52, Dave Shevett schreef: It's weird, this is only happening when the 'block' section is triggered - what Im thinking is that the columnText is pushing all the rest of hte content off the 'page', as opposed to overlaying it? I'm fishing here :( OK, my first guess was wrong, but now I see something else that is fishy: you're nesting text blocks! You have a BT (beginText()) and an ET (endText()). In between, you add another BT and ET by using ColumnText. You shouldn't do that! Replace ALL your beginText(), setFontAndSize(), showTextAligned(), endText() sequences, by one single ColumnText.showTextAligned() and your problem will be solved. -- Learn how Oracle Real Application Clusters (RAC) One Node allows customers to consolidate database storage, standardize their database environment, and, should the need arise, upgrade to a full multi-node Oracle RAC database without downtime or disruption http://p.sf.net/sfu/oracle-sfdevnl ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Many questions posted to this list can (and will) be answered with a reference to the iText book: http://www.itextpdf.com/book/ Please check the keywords list before you ask for examples: http://itextpdf.com/themes/keywords.php
Re: [iText-questions] Tables and FormFields: Is this a bug?
Op 4/01/2011 17:51, Johannes Becker schreef: Hi, thanks for the quick reply. Does the problem also exist in the most recent iText version? Yes it does (iText 5.0.5). OK, I'll test it to see if you've found a bug. (It looks like one, but I need to make sure.) -- Learn how Oracle Real Application Clusters (RAC) One Node allows customers to consolidate database storage, standardize their database environment, and, should the need arise, upgrade to a full multi-node Oracle RAC database without downtime or disruption http://p.sf.net/sfu/oracle-sfdevnl ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Many questions posted to this list can (and will) be answered with a reference to the iText book: http://www.itextpdf.com/book/ Please check the keywords list before you ask for examples: http://itextpdf.com/themes/keywords.php
Re: [iText-questions] Tables and FormFields: Is this a bug?
Op 4/01/2011 17:51, Johannes Becker schreef: Hi, thanks for the quick reply. Does the problem also exist in the most recent iText version? Yes it does (iText 5.0.5). It doesn't in the SNAPSHOT version of iText 5.0.6. See attached code sample as well as the resulting PDF, so whatever problem there was: it's already fixed ;-) senderreceiver_1766675841.pdf Description: Adobe PDF document /* in_action/chapter15/SenderReceiver.java */ import java.io.FileOutputStream; import java.io.IOException; import java.util.Random; import com.itextpdf.text.Document; import com.itextpdf.text.DocumentException; import com.itextpdf.text.ExceptionConverter; import com.itextpdf.text.Paragraph; import com.itextpdf.text.Rectangle; import com.itextpdf.text.pdf.PdfContentByte; import com.itextpdf.text.pdf.PdfFormField; import com.itextpdf.text.pdf.PdfPCell; import com.itextpdf.text.pdf.PdfPCellEvent; import com.itextpdf.text.pdf.PdfPTable; import com.itextpdf.text.pdf.PdfWriter; import com.itextpdf.text.pdf.TextField; /** * This example was written by Bruno Lowagie. It is part of the book 'iText in * Action' by Manning Publications. * ISBN: 1932394796 * http://www.1t3xt.com/docs/book.php * http://www.manning.com/lowagie/ */ public class SenderReceiver implements PdfPCellEvent { protected PdfFormField parent; protected String partialFieldName; protected PdfWriter writer; protected boolean required; public SenderReceiver(PdfWriter writer, PdfFormField parent, String name, boolean required) { this.writer = writer; this.parent = parent; this.partialFieldName = name; this.required = required; } /** * @see com.lowagie.text.pdf.PdfPCellEvent#cellLayout(com.lowagie.text.pdf.PdfPCell, * com.lowagie.text.Rectangle, com.lowagie.text.pdf.PdfContentByte[]) */ public void cellLayout(PdfPCell cell, Rectangle rect, PdfContentByte[] cb) { TextField tf = new TextField(writer, new Rectangle(rect.getLeft(2), rect .getBottom(2), rect.getRight(2), rect.getTop(2)), partialFieldName); if (required) tf.setOptions(TextField.REQUIRED); tf.setFontSize(12); try { parent.addKid(tf.getTextField()); } catch (Exception e) { throw new ExceptionConverter(e); } } public static void main(String[] args) { System.out.println(Chapter 15: example Sender Receiver); System.out.println(- Creates a PDF file with an AcroForm); System.out.println(- jars needed: iText.jar); System.out.println(- files generated in /results subdirectory:); System.out.println( sender_receiver.pdf); // step 1 Document document = new Document(); try { // step 2 PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(senderreceiver_ + new Random().nextInt() + .pdf)); // step 3 document.open(); // step 4 document.add(new Paragraph(Sender)); PdfFormField sender = PdfFormField.createEmpty(writer); sender.setFieldName(sender); document.add(createTable(writer, sender)); writer.addAnnotation(sender); document.add(new Paragraph(Sender1)); PdfFormField sender1 = PdfFormField.createEmpty(writer); sender1.setFieldName(sender1); document.add(createTable(writer, sender1)); writer.addAnnotation(sender1); document.add(new Paragraph(Sender2)); PdfFormField sender2 = PdfFormField.createEmpty(writer); sender2.setFieldName(sender2); document.add(createTable(writer, sender2)); writer.addAnnotation(sender2); document.add(new Paragraph(Sender3)); PdfFormField sender3 = PdfFormField.createEmpty(writer); sender3.setFieldName(sender3); document.add(createTable(writer, sender3)); writer.addAnnotation(sender3); document.add(new Paragraph(Sender4)); PdfFormField sender4 = PdfFormField.createEmpty(writer); sender4.setFieldName(sender4);
Re: [iText-questions] Tables and FormFields: Is this a bug?
Hi, thanks again for the quick reply. so whatever problem there was: it's already fixed ;-) Good job. Since I'm stuck to an old version, might there be a workaround (i.e. wrapping my tables in some other object)? Thanks Jonny Am 04.01.2011 18:10, schrieb 1T3XT BVBA: /* in_action/chapter15/SenderReceiver.java */ import java.io.FileOutputStream; import java.io.IOException; import java.util.Random; import com.itextpdf.text.Document; import com.itextpdf.text.DocumentException; import com.itextpdf.text.ExceptionConverter; import com.itextpdf.text.Paragraph; import com.itextpdf.text.Rectangle; import com.itextpdf.text.pdf.PdfContentByte; import com.itextpdf.text.pdf.PdfFormField; import com.itextpdf.text.pdf.PdfPCell; import com.itextpdf.text.pdf.PdfPCellEvent; import com.itextpdf.text.pdf.PdfPTable; import com.itextpdf.text.pdf.PdfWriter; import com.itextpdf.text.pdf.TextField; /** * This example was written by Bruno Lowagie. It is part of the book 'iText in * Action' by Manning Publications. * ISBN: 1932394796 *http://www.1t3xt.com/docs/book.php *http://www.manning.com/lowagie/ */ public class SenderReceiver implements PdfPCellEvent { -- Learn how Oracle Real Application Clusters (RAC) One Node allows customers to consolidate database storage, standardize their database environment, and, should the need arise, upgrade to a full multi-node Oracle RAC database without downtime or disruption http://p.sf.net/sfu/oracle-sfdevnl ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Many questions posted to this list can (and will) be answered with a reference to the iText book: http://www.itextpdf.com/book/ Please check the keywords list before you ask for examples: http://itextpdf.com/themes/keywords.php
Re: [iText-questions] Tables and FormFields: Is this a bug?
Op 4/01/2011 18:59, Johannes Becker schreef: Hi, thanks again for the quick reply. so whatever problem there was: it's already fixed ;-) Good job. Since I'm stuck to an old version, might there be a workaround (i.e. wrapping my tables in some other object)? Not that I know of. I didn't test with iText 5.0.5, but it would surprise me if the fix was introduced recently. I vaguely remember that this was fixed longer ago, but I don't remember how it was fixed. Why are you stuck with the old version? If it's because you want to avoid paying a license: I'm sorry, then you're out of luck. If it's because you still need to run the application in JDK 1.4, then you could contact consultancy and ask them to make an offer to make a custom fix for you: http://www.itextpdf.com/contact.php#consultancy -- Learn how Oracle Real Application Clusters (RAC) One Node allows customers to consolidate database storage, standardize their database environment, and, should the need arise, upgrade to a full multi-node Oracle RAC database without downtime or disruption http://p.sf.net/sfu/oracle-sfdevnl ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Many questions posted to this list can (and will) be answered with a reference to the iText book: http://www.itextpdf.com/book/ Please check the keywords list before you ask for examples: http://itextpdf.com/themes/keywords.php
Re: [iText-questions] PHP port in the works
Thanks - yes, I know. I was more asking to see if any of the people who tried still frequented the boards and could give an idea as to its pulse, in the off chance I or someone else wanted to try picking up what was done and fleshing it out, or at least to understand the issues that were faced. Maybe it's not feasible? Things like this. On Tue, Jan 4, 2011 at 3:56 AM, 1T3XT BVBA [via iText - General] ml-node+3173206-129202055-207...@n4.nabble.comml-node%2b3173206-129202055-207...@n4.nabble.com wrote: Op 4/01/2011 9:32, wizonesolutions schreef: I was also wondering the progress of the iText-to-PHP port. Is there a publicly-accessible repository where the current code could be checked out? I'd be willing to help test as I'm the real new maintainer of Fill PDF (Drupal) :) The official developers of iText are not working on a PHP port for iText (and never have worked on such a port). Several people have offered to write such a port, but nobody succeeded. If you want to invest in such a port, maybe @dries and @bruno1970 can write an offer and make a quote. -- Learn how Oracle Real Application Clusters (RAC) One Node allows customers to consolidate database storage, standardize their database environment, and, should the need arise, upgrade to a full multi-node Oracle RAC database without downtime or disruption http://p.sf.net/sfu/oracle-sfdevnl ___ iText-questions mailing list [hidden email] http://user/SendEmail.jtp?type=nodenode=3173206i=0 https://lists.sourceforge.net/lists/listinfo/itext-questions Many questions posted to this list can (and will) be answered with a reference to the iText book: http://www.itextpdf.com/book/ Please check the keywords list before you ask for examples: http://itextpdf.com/themes/keywords.php -- View message @ http://itext-general.2136553.n4.nabble.com/PHP-port-in-the-works-tp2154422p3173206.html To unsubscribe from PHP port in the works, click herehttp://itext-general.2136553.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=2154422code=dnJAd2l6b25lc29sdXRpb25zLmNvbXwyMTU0NDIyfDE0NzA5MjUyMzM=. -- View this message in context: http://itext-general.2136553.n4.nabble.com/PHP-port-in-the-works-tp2154422p3174297.html Sent from the iText - General mailing list archive at Nabble.com. -- Learn how Oracle Real Application Clusters (RAC) One Node allows customers to consolidate database storage, standardize their database environment, and, should the need arise, upgrade to a full multi-node Oracle RAC database without downtime or disruption http://p.sf.net/sfu/oracle-sfdevnl___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Many questions posted to this list can (and will) be answered with a reference to the iText book: http://www.itextpdf.com/book/ Please check the keywords list before you ask for examples: http://itextpdf.com/themes/keywords.php
Re: [iText-questions] Problem adding ColumnText onto existing Document
On 1/4/11 11:58 AM, 1T3XT BVBA wrote: I'm fishing here :( OK, my first guess was wrong, but now I see something else that is fishy: you're nesting text blocks! You have a BT (beginText()) and an ET (endText()). In between, you add another BT and ET by using ColumnText. You shouldn't do that! Replace ALL your beginText(), setFontAndSize(), showTextAligned(), endText() sequences, by one single ColumnText.showTextAligned() and your problem will be solved. I just wanted to followup and say yes, this fixed it! What I didn't realize was the ColumnText was implicitely doing a beginText() and endText(). I changed all my showTextAligned with static calls to ColumnText.showTextAligned, and left most of hte 'block' section (because I need wrapped text for long names), and things are working perfectly. Thank you very much for your help! Here is the final / complete method, which still has the 'dotted line' around the block area, but that's just for testing, we'll remove that in the production print routine :) http://pastebin.stonekeep.com/11529 -d -- Learn how Oracle Real Application Clusters (RAC) One Node allows customers to consolidate database storage, standardize their database environment, and, should the need arise, upgrade to a full multi-node Oracle RAC database without downtime or disruption http://p.sf.net/sfu/oracle-sfdevnl ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Many questions posted to this list can (and will) be answered with a reference to the iText book: http://www.itextpdf.com/book/ Please check the keywords list before you ask for examples: http://itextpdf.com/themes/keywords.php
Re: [iText-questions] remove watermark layer
Has this issue ever been resolved? I am trying to access a layer in a PDF created by Acrobat. If I execute the following line, I get a java.lang.ClassCastException: com.itextpdf.text.pdf.PRIndirectReference closing the PdfStamper every time, but with the line omitted everything works as expected. Code: Map layers = stamper.getPdfLayers(); I'm trying to hide layers in a pdf. Seems like this would be simple, and it seems like the following code should work: Map layers = stamper.getPdfLayers(); PdfLayer tempLayer = (PdfLayer)layers.get(templayer); tempLayer.setOn(false); PdfLayer sigLayer = (PdfLayer)layers.get(siglayer); igLayer.setOn(false); But if I execute the above code, and then execute the following line: stamper.close(); I get the ClassCastException. Any suggestions? Thanks. -Original Message- From: Jaakov Jalink [mailto:jaak...@syneron.com] Sent: Wednesday, June 23, 2010 8:34 AM To: Post all your questions about iText here Subject: Re: [iText-questions] remove watermark layer This code works perfectly for an adobe created layer, but always fails on an iText layered file. Attached are one of each. public static final String inFile = d:\\layers.pdf; public static final String outFile = d:\\test No WM.pdf; public static void main(String[] args) throws IOException, DocumentException { PdfReader reader = new PdfReader(inFile); PdfStamper stamper = new PdfStamper(reader, new FileOutputStream(outFile)); MapString, PdfLayer layers = stamper.getPdfLayers(); stamper.close(); } Error log: Exception in thread main java.lang.NullPointerException at com.itextpdf.text.pdf.PdfWriter.fillOCProperties(PdfWriter.java:2567) at com.itextpdf.text.pdf.PdfStamperImp.close(PdfStamperImp.java:189) at com.itextpdf.text.pdf.PdfStamper.close(PdfStamper.java:189) This footnote confirms that this email message has been scanned by PineApp Mail-SeCure for the presence of malicious code, vandals computer viruses. -- Learn how Oracle Real Application Clusters (RAC) One Node allows customers to consolidate database storage, standardize their database environment, and, should the need arise, upgrade to a full multi-node Oracle RAC database without downtime or disruption http://p.sf.net/sfu/oracle-sfdevnl___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Many questions posted to this list can (and will) be answered with a reference to the iText book: http://www.itextpdf.com/book/ Please check the keywords list before you ask for examples: http://itextpdf.com/themes/keywords.php
Re: [iText-questions] printing notes
yes, the writeSelectedRows() method. I didn't remember it. I made some attemps and it seems the way to follow. The think that I do not understand is how to put the PdfPTable written with writeSelectedRows() in the first ColumnText to trigger the simulation mode. as a matter of fact there is only the note ColumnText and a lot of mess in the pages... but I repet that it seems a way to follow. The only one? thank you -- View this message in context: http://itext-general.2136553.n4.nabble.com/printing-notes-tp3172791p3174778.html Sent from the iText - General mailing list archive at Nabble.com. -- Learn how Oracle Real Application Clusters (RAC) One Node allows customers to consolidate database storage, standardize their database environment, and, should the need arise, upgrade to a full multi-node Oracle RAC database without downtime or disruption http://p.sf.net/sfu/oracle-sfdevnl ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Many questions posted to this list can (and will) be answered with a reference to the iText book: http://www.itextpdf.com/book/ Please check the keywords list before you ask for examples: http://itextpdf.com/themes/keywords.php
[iText-questions] Reader enabled pdf
Happy New Year! I am trying to create a pdf with some readonly data and some unsigned signatures for external approval. I have read 8.7.1 in the iText in Action book and I am struggling to get around this Reader Enabled issue. First off, I am using Seam 2.2 with iText 2.1.2 for this effort. I am extending some of the facelet components to provide the addition of an unsigned signature. Here is what I am attempting to do. Take a reader enabled pdf that was created using Acrobat Pro; lets call it what it is: pdf_template.pdf. It is just a blank reader enabled pdf file with an empty page. I want to take a copy of the pdf_template.pdf and use the stamper in append mode to keep the reader enabled sign document/approval features. However, I would still like to add other elements to the document (i.e. paragraphs, etc). It looks like the PdfStamper.getPdfDocument() method is not exposed for me to do this. Any ideas on how I might go about achieving this? Thanks, Keith D. Moore -- Learn how Oracle Real Application Clusters (RAC) One Node allows customers to consolidate database storage, standardize their database environment, and, should the need arise, upgrade to a full multi-node Oracle RAC database without downtime or disruption http://p.sf.net/sfu/oracle-sfdevnl___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Many questions posted to this list can (and will) be answered with a reference to the iText book: http://www.itextpdf.com/book/ Please check the keywords list before you ask for examples: http://itextpdf.com/themes/keywords.php
[iText-questions] Data overlapping with header on new page
Hi, I am using pdfTable of iTextSharp to write the data on PDF but when my pdfTable's size gets increased and it will continue to next page pdfTable contents gets overlapped with the header. Can you please provide any help regarding this issue? Thanks Regards, Gunjan Mishra _ Information contained and transmitted by this e-mail is confidential and proprietary to Patni Computer Systems Ltd and its affiliates (hitherto referred as Patni Computers) and is intended for use only by the recipient. If you are not the intended recipient , you are hereby notified that any dissemination, distribution, copying or use of this e-mail is strictly prohibited and you are requested to delete this e-mail immediately and notify the originator or netad...@patni.com. Patni Computers does not enter into any agreement with any party by e-mail. Any views expressed by an individual do not necessarily reflect the view of Patni Computers. Patni Computers is not responsible for the consequences of any actions taken on the basis of information provided, through this email. The contents of an attachment to this e-mail may contain software viruses, which could damage your own computer system. While Patni Computers has taken every reasonable precaution to minimise this risk, w! e cannot accept liability for any damage which you sustain as a result of software viruses. You should carry out your own virus checks before opening an attachment. To know more about Patni Computers please visit www.patni.com. _ -- Learn how Oracle Real Application Clusters (RAC) One Node allows customers to consolidate database storage, standardize their database environment, and, should the need arise, upgrade to a full multi-node Oracle RAC database without downtime or disruption http://p.sf.net/sfu/oracle-sfdevnl___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Many questions posted to this list can (and will) be answered with a reference to the iText book: http://www.itextpdf.com/book/ Please check the keywords list before you ask for examples: http://itextpdf.com/themes/keywords.php