[iText-questions] Widths Problems with PdfPTable and Document orizontal size.
Hello iText Developers: First of all, congratulations about your work, you've made a good product. At this momment, I'm programming a web application with PDF report generation functionality. We are showing some reports on html and giving the possibility of "print" them on a PDF file. I have the source data organized into tables. To print these tables to iText, first we are making a table where we organize the data into the correct columns and rows, with their sizes equal to sizes used on the html report (number of pixels, 1024x768 optimized), cell by cell. After that we get the iText representation of this table, getting the widths from the original and assigning them to the PdfPTable. I don't know whats the matter but the result PdfPTable seems to be greater than the original, increasing the size of the table. When we put into the document we use a mark table to align some table or images on the same line. We are sizing this mark table from the original table size, for instance 180 width, document width is about 565 (landscaped), but we can't get the PdfPTable width; the returned absolute width is zero, and percent width is 100 %, and when we open the document the final table appears horizontally compressed. How can I get the real PdfPTale to be able to set the mark table size correctly? Why the PdfPTable has a greater total width? I don't know if this issue could be related with the resolution cofigured for the generated PDF. Best regards and thank you in advance. P.S.: I'm so sorry if I'm not so much clarifier, I need to improve my english. Daniel Belmonte Llarch email: [EMAIL PROTECTED]
[iText-questions] iText performance vs. pdflib
I write this email in sincerity; not to start a flame war of any kind. We are currently using an old version of pdflib and are looking into switching to iText. The iText library looks very capable and easy to use. I genuinely want to use iText so any help in resolving my issue would be appreciated. Performance is an issue for us; we want to switch to iText but not give up the speed to which we're accustomed. I'm pasting a small program I used to measure pdflib 4.0.3 (yes we're on an old version) against iText 1.3. The tests were run on my Windows 200 machine. The program shows iText to be an order of magnitude slower then pdflib. It generates a pdf file with 1000 letter-size pages each having the text "Hello" at coordinate 100, 100. For pdflib we render each page to a memory buffer and write it to disk. For iText I tried writing to a buffered FileWriter AND separately to a ByteArrayOutputStream in memory with the file write occurring at the end of processing. The # of milliseconds each test took is displayed at the end. Generate big PDF with 1000 pagesPdflib took 344iText took 3188iText to Memory took 2781 I'm not an iText guru by any means -- far from it! I cobbled this code together from the examples. I'm hoping you can spot something inefficient that I'm doing or make suggestions as to improvements I can make to this program. Again, I'd love to use iText! Please help me use it effectively. Thanks! package com.system; import com.pdflib.pdflib;import com.lowagie.text.Document;import com.lowagie.text.DocumentException;import com.lowagie.text.Rectangle;import com.lowagie.text.pdf.PdfWriter;import com.lowagie.text.pdf.PdfContentByte;import com.lowagie.text.pdf.BaseFont; import java.io.*; public class PdfPerformance{ private final static float LETTER_WIDTH = 612f; private final static float LETTER_HEIGHT = 792f; private static final int PAGECOUNT = 1000; public static void main(String[] args) throws IOException, DocumentException { PdfPerformance perf = new PdfPerformance(); System.out.println("Generate big PDF with " + PAGECOUNT + " pages"); long pdflibTime = perf.generateBigPdfUsingPdflib(PAGECOUNT); long itextTime = perf.generateBigPdfUsingIText(PAGECOUNT); long itextToMemory = perf.generateBigPdfUsingITextWithBuffer(PAGECOUNT); System.out.println("Pdflib took " + pdflibTime); System.out.println("iText took " + itextTime); System.out.println("iText to Memory took " + itextToMemory); } private long generateBigPdfUsingPdflib(int pagecount) throws IOException { long start = System.currentTimeMillis(); pdflib pdflib = new pdflib(); if (pdflib.open_file("") == -1) throw new IOException("Can't open PDF output buffer"); OutputStream os = new BufferedOutputStream(new FileOutputStream("pdflib.pdf", false)); int helv = pdflib.findfont("Helvetica", "host", 0); for( int i = 0; i < pagecount; i++ ) { pdflib.begin_page(LETTER_WIDTH, LETTER_HEIGHT); pdflib.setfont(helv, 10); pdflib.show_xy("Hello", 100, 100); pdflib.end_page(); os.write(pdflib.get_buffer()); } pdflib.close(); os.write(pdflib.get_buffer()); os.close(); return System.currentTimeMillis() - start; } private long generateBigPdfUsingIText(int pagecount) throws IOException, DocumentException { long start = System.currentTimeMillis(); Document document = new Document(); PdfWriter writer = PdfWriter.getInstance(document, new BufferedOutputStream(new FileOutputStream("itext.pdf"))); document.setPageSize(new Rectangle(LETTER_WIDTH, LETTER_HEIGHT)); document.open(); PdfContentByte cb = writer.getDirectContent(); BaseFont bf = BaseFont.createFont(BaseFont.HELVETICA, BaseFont.CP1252, BaseFont.NOT_EMBEDDED); for( int i = 0; i < pagecount; i++ ) { cb.beginText(); cb.setFontAndSize(bf, 10); cb.showTextAligned(PdfContentByte.ALIGN_LEFT, "Hello", 100, 100, 0); cb.endText(); document.newPage(); } document.close(); return System.currentTimeMillis() - start; } private long generateBigPdfUsingITextWithBuffer(int pagecount) throws IOException, DocumentException { long start = System.currentTimeMillis(); Document document = new Document(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); PdfWriter writer = PdfWriter.getInstance(document, baos); OutputStream os = new BufferedOutputStream(new FileOutputStream("itext2.pdf", false)); document.setPageSize(new Rectangle(LETTER_WIDTH, LETTER_H
[iText-questions] Generate Dynamic table when using XML to PDF
Is there a way generate a table using dynamic data from a database and inserting it into a template XML. I am currently using the XmlPeer to generate custom taglibs which are passed to the parser in a HashMap XmlParser.parse(document, "unauthTx.xml", taglibs); I need to generate a table then insert it into a specific spot in the PDF file. I have been using XmlPeer for all other custom tags, Is there a way to use XmlPeer(ElementTags.TABLE) to generate a table? Thanks, John Yahoo! Photos Showcase holiday pictures in hardcover Photo Books. You design it and well bind it!
[iText-questions] Form with nested tables
Hello, I am trying to generate a pdf using acro - form elements. To position the form elements I am using tables just like the registration form example. However, the problem is that I have two kinds of textfield elements, on with the label on the right side like this: label and one with the label on the bottom: label So I use two kinds of tables, a table with one column (t1) and one table with two columns (t2) to reach this. The problem is that I need to position this two textfield beside each other. So I created another table (t3) where I added theese tables as nested tables. The problem is that table (t2) gets stretched. So the result looks like this: (t1) (t2) label label I hope you know what I mean. As you can see the textfield column of table (t2) gets stretched to fit the row since the text field ist the complete column. (I think the label - row gets stretched too but I am not sure. Since the align of the label is correct, this would be no problem). I tried to setFixedHeigth on both columns of (t2 ) but it has no effect. If I use setFixedHeight on the cell of table (t3) then the size both tables (t1 and t2) is reduced and I loose the label of (t1). I have also made some tries with setNoWrap but I didn't get it working. Can somebody tell me the correct code? Regards Peter --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions
RE: [iText-questions] Image units of measurement
width() and height() are the number of image pixels and can't be changed. All the other dimensions are points and will change if you apply scaling. > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On > Behalf Of David Woosley > Sent: Tuesday, January 17, 2006 3:43 PM > To: iText Questions (E-mail) > Subject: [iText-questions] Image units of measurement > > What are the units of measurement inside the > com.lowagie.text.Image class? > > For example, the scaleToFit(w,h) method accepts two float > arguments. It it expecting pixels, points or what? The > DvdCover example makes me think this method is accepting > points, not pixels. > > The Java docs for the Image class do not specify the units of > measurement. Testing the class has taught me that some > methods -- like width() and height() -- always return pixels. > When the scaleToFit(w,h) method is called, is the image > actually rescaled at that moment? The width() and height() > remain the same after calling scaleToFit(w,h), although > scaledWidth() and scaledHeight() do change to what? > Points, pixels? > > The documentation is not clear on this. Thanks. > > David Woosley > Mobile: 479-252-1200 > > --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642 ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions
Re: [iText-questions] Hyperlink to a different location in the RTF doc
Hi for internal links Word obviously generates a bookmark and then the internal link references the bookmark. In iText links are defined as described in the tutoral http://itextdocs.lowagie.com/tutorial/objects/anchors/index.html Currently from the behaviour specified in the tutorial the RtfWriter2 only implements the external Anchors. You will have to extend the RtfAnchor class to also handle internal links. Greetings, Mark On Tuesday 17 January 2006 20:48, Divya Nagireddy wrote: > Hi Mark, > > This is how I'm creating the RTF document > > Document document = new Document(); > RtfWriter2 writer2 = RtfWriter2.getInstance(document, new > FileOutputStream(rtfFile)); > document.open(); > - > - > //add various Elements to the document > document.add(); > - > - > //create a hyperlink for one of the elements, when you click on this > element it goes to a different element in the same doc. > Anchor anchor = new Anchor("Element2"); > //this works if the below string is replaced with an external URL > anchor.setReference("_Recording_List"); > - > - > document.close(); > > > Rtf format generated by Word: > Hyperlink - > {\field{\*\fldinst HYPERLINK \\l "_Recording_List" }{\fldrslt > \pard\f0\fs20\cf0 Element2}} > > When you click on the Element2 it goes to the destination, for which the > format is as follows - > {\*\bkmkstart _Recording_List}{\*\bkmkend _Recording_List}Element5 > > > I didn't quite understand if RtfAnchor is being used in hyperlink > generation. I also tried RtfWriter which seems to be using Anchor. > > Thanks again for your help > Divya > > >From: Mark Hall <[EMAIL PROTECTED]> > >To: itext-questions@lists.sourceforge.net > >CC: "Divya Nagireddy" <[EMAIL PROTECTED]> > >Subject: Re: [iText-questions] Hyperlink to a different location in the > > RTF doc > >Date: Fri, 6 Jan 2006 15:02:39 +0100 > > > >On Thursday 05 January 2006 22:15, Divya Nagireddy wrote: > > > Any hint on how to implement it? > > > >You need to read the RTF 1.6 specification > >(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnrtfspe > >c/html/rtfspec.asp) and also look at what Word generates when you have a > > document with internal links. This is a bit of a pain since Word doesn't > > always fully follow the specification. > > > >Then you have to modify the code that writes Anchor objects to also handle > >internal links (com.lowagie.text.rtf.field.RtfAnchor). > > > >Depending on how internal anchors are implemented in RTF (I haven't looked > >into it) you might have to parse the generated RTF document a second time > >to > >correct the references. But since I haven't looked into this, I can't say > >whether this is really necessary. > > > >I think these three steps should cover most of the process. If you've got > >further questions on the internal workings of the RTF generation, just > > ask. > > > >Greetings, > >Mark > >-- > >You have the power to influence all with whom you come in contact. > > > >My GPG public key is available at: > >http://www.edu.uni-klu.ac.at/~mhall/data/security/MarkHall.asc > > > > > ><< attach3 >> -- You are fighting for survival in your own sweet and gentle way. My GPG public key is available at: http://www.edu.uni-klu.ac.at/~mhall/data/security/MarkHall.asc pgp4QlIggxh4A.pgp Description: PGP signature
Re: [iText-questions] Hyperlink to a different location in the RTF doc
Hi Mark, This is how I'm creating the RTF document Document document = new Document(); RtfWriter2 writer2 = RtfWriter2.getInstance(document, new FileOutputStream(rtfFile)); document.open(); - - //add various Elements to the document document.add(); - - //create a hyperlink for one of the elements, when you click on this element it goes to a different element in the same doc. Anchor anchor = new Anchor("Element2"); //this works if the below string is replaced with an external URL anchor.setReference("_Recording_List"); - - document.close(); Rtf format generated by Word: Hyperlink - {\field{\*\fldinst HYPERLINK \\l "_Recording_List" }{\fldrslt \pard\f0\fs20\cf0 Element2}} When you click on the Element2 it goes to the destination, for which the format is as follows - {\*\bkmkstart _Recording_List}{\*\bkmkend _Recording_List}Element5 I didn't quite understand if RtfAnchor is being used in hyperlink generation. I also tried RtfWriter which seems to be using Anchor. Thanks again for your help Divya From: Mark Hall <[EMAIL PROTECTED]> To: itext-questions@lists.sourceforge.net CC: "Divya Nagireddy" <[EMAIL PROTECTED]> Subject: Re: [iText-questions] Hyperlink to a different location in the RTF doc Date: Fri, 6 Jan 2006 15:02:39 +0100 On Thursday 05 January 2006 22:15, Divya Nagireddy wrote: > Any hint on how to implement it? You need to read the RTF 1.6 specification (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnrtfspec/html/rtfspec.asp) and also look at what Word generates when you have a document with internal links. This is a bit of a pain since Word doesn't always fully follow the specification. Then you have to modify the code that writes Anchor objects to also handle internal links (com.lowagie.text.rtf.field.RtfAnchor). Depending on how internal anchors are implemented in RTF (I haven't looked into it) you might have to parse the generated RTF document a second time to correct the references. But since I haven't looked into this, I can't say whether this is really necessary. I think these three steps should cover most of the process. If you've got further questions on the internal workings of the RTF generation, just ask. Greetings, Mark -- You have the power to influence all with whom you come in contact. My GPG public key is available at: http://www.edu.uni-klu.ac.at/~mhall/data/security/MarkHall.asc << attach3 >> --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions
[iText-questions] Fw: using PageEvents with PdfCopy class?
Was trying to use PageEvents with PdfCopy instead of PdfWriter. However, the events seem to be fired when reading from the source PDF, and not when writing to the target PDF. Specifically, I see the onStartPage() called on PdfCopy.getImportedPage(), when I'd like it to be called on PdfCopy.addPage(). No output ever appears on the target (output) PDF. Is this a known issue? Is there some way to associate the helper-class with the output document, as it seems to be associated with the document being read. Thanks again! -AJ
[iText-questions] Important Message from the Accredo Health Email Gateway
In order to protect our employees, patients, partners and computer systems, Accredo Health, Inc. places restrictions on email passing between our network and the Internet. In compliance with that policy, a message addressed to you has been automatically blocked by the gateway due to decomposition errors. The message details are as follows: From: "Tirado Olaya Sandro Javier" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]> Subject: [iText-questions] help please Date: 01/17/06, 11:41:13 The message is currently being held in a quarantine area, and may be released for delivery provided there is a legitimate business need. In order to ensure that the message is appropriate for delivery, the Email Gateway admin staff will need to open and manually inspect the message and any associated attachments. To request that the message be released, please reply to this message, include this notice, and explain why you need the email to be released to you. Please send any questions or comments to [EMAIL PROTECTED] --- Message ID: 6FD3F3B92281294351-01 ---
RE: [iText-questions] Changing Submit-Action of a PushButton in a PDF Form
Send me the pdf. > -Original Message- > From: Nitin Tomer [mailto:[EMAIL PROTECTED] > Sent: Tuesday, January 17, 2006 11:45 AM > To: Paulo Soares; iText-questions@lists.sourceforge.net > Subject: Re: [iText-questions] Changing Submit-Action of a > PushButton in a PDF Form > > Hi Paulo, > > Thanx for the help. I tried it but it didn't change > the action-URL. > Please find the code below- > > FDFInput is the form input received when the form was > submitted, strFormName > is an internal variable used to denore the logical name of form, > strTemplatePath is the file path of PDF form template (the > actual form, > which is rendered to users). > > private String processFdfWithoutSignatures(FdfReader FDFInput,String > strFormName,String strTemplatePath, String strWorkingPath) throws > FormServerException > { > strWorkingPath += String.valueOf((int)(Math.random() * 1000)); > String strOutPDF = strWorkingPath + strFormName + ".pdf"; > > try > { > PdfReader reader = new PdfReader(strTemplatePath); > PdfStamper stamp = new PdfStamper(reader, new > FileOutputStream(strOutPDF)); > AcroFields form = stamp.getAcroFields(); > > HashMap hFields = null; > Set setFieldNames = null; > int nfieldCount = 0; > > hFields = FDFInput.getFields(); > > nfieldCount = hFields.size(); > setFieldNames = hFields.keySet(); > > String strFieldValue = null; > String strFieldName = null; > > for(Iterator it = setFieldNames.iterator(); it.hasNext();) > { > strFieldName = (String)it.next(); > > if(form.getFieldType(strFieldName) == > AcroFields.FIELD_TYPE_PUSHBUTTON) > { > AcroFields.Item objItem = > form.getFieldItem(strFieldName); > ArrayList objArrayList = objItem.widgets; > PdfDictionary objPdfDict = > (PdfDictionary)objArrayList.get(0); > PdfDictionary action = > (PdfDictionary)PdfReader.getPdfObject(objPdfDict.get(PdfName.A)); > action.put(PdfName.URI, new > PdfString("http://mysite/go";)); > } > } // End of for >} >stamp.close(); > } > catch(Exception ex) > { >ex.printStackTrace(); > } > return strOutPDF; > } > > Thanx and Regards > > Nitin > - Original Message - > From: "Paulo Soares" <[EMAIL PROTECTED]> > To: "Nitin Tomer" <[EMAIL PROTECTED]>; > > Sent: Tuesday, January 17, 2006 4:01 PM > Subject: RE: [iText-questions] Changing Submit-Action of a > PushButton in a > PDF Form > > > ArrayList objArrayList = objItem.widgets; > PdfDictionary dic = (PdfDictionary)objArrayList.get(0); > PdfDictionary action = > (PdfDictionary)PdfReader.getPdfObject(dic.get(PdfName.A)); > action.put(PdfName.URI, new PdfString("http://mysite/go";)); > > > > Disclaimer :- This e-mail message including any attachment > may contain confidential, proprietary or legally privileged > information. It should not be used by who is not the original > intended recipient. If you have erroneously received this > message, you are notified that you are strictly prohibited > from using, coping, altering or disclosing the content of > this message. Please delete it immediately and notify the > sender. Newgen Software Technologies Ltd and / or its > subsidiary Companies accept no responsibility for loss or > damage arising from the use of the information transmitted by > this email including damage from virus and further > acknowledges that any views expressed in this message are > those of the individual sender and no binding nature of the > message shall be implied or assumed unlessthe sender does so > expressly with due authority of Newgen Software > TechnologiesLtd and / or its subsidiary Companies, as applicable. > > --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642 ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions
[iText-questions] help please
hello a would like to know if there is a way to create a pdf file that reproduces the exact design of a html page (of course using servlets, I work with IBM WebSphere); for example if I have a web page with a formulary I want everybody to be able to press a button that put that formulary in a pdf file so they can save and/or print it. Thank you very much Sandro Tirado Olaya. N�HY隊X���'���u���[��� ަ�k��!���W�~�鮆�zk��C� [EMAIL PROTECTED],a{� ��,�H��4�m�Z��jY�w��ǥrg
RE: [iText-questions] Image units of measurement
That is really, really confusing. To me. d. -Original Message- From: Paulo Soares [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 17, 2006 10:56 AM To: David Woosley; [EMAIL PROTECTED] Cc: itext-questions@lists.sourceforge.net Subject: RE: [iText-questions] Image units of measurement Without scaling pixels==points. > -Original Message- > From: David Woosley [mailto:[EMAIL PROTECTED] > Sent: Tuesday, January 17, 2006 4:52 PM > To: Paulo Soares; [EMAIL PROTECTED] > Subject: RE: [iText-questions] Image units of measurement > > Paulo and Bruno: > > Then why does scaledWidth() and scaledHeight() return the > number of PIXELS before the scaleToFit(w,h) method is called? > > David > > > > -Original Message- > From: Paulo Soares [mailto:[EMAIL PROTECTED] > Sent: Tuesday, January 17, 2006 10:01 AM > To: David Woosley; iText Questions (E-mail) > Subject: RE: [iText-questions] Image units of measurement > > > width() and height() are the number of image pixels and can't be > changed. All the other dimensions are points and will change if you > apply scaling. > > > -Original Message- > > From: [EMAIL PROTECTED] > > [mailto:[EMAIL PROTECTED] On > > Behalf Of David Woosley > > Sent: Tuesday, January 17, 2006 3:43 PM > > To: iText Questions (E-mail) > > Subject: [iText-questions] Image units of measurement > > > > What are the units of measurement inside the > > com.lowagie.text.Image class? > > > > For example, the scaleToFit(w,h) method accepts two float > > arguments. It it expecting pixels, points or what? The > > DvdCover example makes me think this method is accepting > > points, not pixels. > > > > The Java docs for the Image class do not specify the units of > > measurement. Testing the class has taught me that some > > methods -- like width() and height() -- always return pixels. > > When the scaleToFit(w,h) method is called, is the image > > actually rescaled at that moment? The width() and height() > > remain the same after calling scaleToFit(w,h), although > > scaledWidth() and scaledHeight() do change to what? > > Points, pixels? > > > > The documentation is not clear on this. Thanks. > > > > David Woosley > > Mobile: 479-252-1200 > > > > > <>
[iText-questions] Image size in PDF
This is somewhat related to my posting from 30 minutes ago. When an image is scaled to 10% of its original size and then drawn into a PDF, will the space required to store the smaller image in the PDF also be reduced by the mathematically-appropriate amount? For example, assume I start with a 1000x1000 image and each pixel is a different color. The JPG file would be about 1,000,000 bytes on disk or something close. When reduced to 10%, the size is 100x100 (10,000 bytes) which is only about 1% of the original size. I'm not looking for exact precision, but I need to know if the storage size in the PDF will be very large (closer to the original size) or very small (closer to the 10% size). By the way, it seems drawing a large image into a small space and, thus, allowing iText to scale down the image does not reduce the size of the PDF to the expected amount. It seems like the PDF is storing the larger size. Am I correct in this guess? Thanks. David Woosley Mobile: 479-252-1200
RE: [iText-questions] Image units of measurement
Without scaling pixels==points. > -Original Message- > From: David Woosley [mailto:[EMAIL PROTECTED] > Sent: Tuesday, January 17, 2006 4:52 PM > To: Paulo Soares; [EMAIL PROTECTED] > Subject: RE: [iText-questions] Image units of measurement > > Paulo and Bruno: > > Then why does scaledWidth() and scaledHeight() return the > number of PIXELS before the scaleToFit(w,h) method is called? > > David > > > > -Original Message- > From: Paulo Soares [mailto:[EMAIL PROTECTED] > Sent: Tuesday, January 17, 2006 10:01 AM > To: David Woosley; iText Questions (E-mail) > Subject: RE: [iText-questions] Image units of measurement > > > width() and height() are the number of image pixels and can't be > changed. All the other dimensions are points and will change if you > apply scaling. > > > -Original Message- > > From: [EMAIL PROTECTED] > > [mailto:[EMAIL PROTECTED] On > > Behalf Of David Woosley > > Sent: Tuesday, January 17, 2006 3:43 PM > > To: iText Questions (E-mail) > > Subject: [iText-questions] Image units of measurement > > > > What are the units of measurement inside the > > com.lowagie.text.Image class? > > > > For example, the scaleToFit(w,h) method accepts two float > > arguments. It it expecting pixels, points or what? The > > DvdCover example makes me think this method is accepting > > points, not pixels. > > > > The Java docs for the Image class do not specify the units of > > measurement. Testing the class has taught me that some > > methods -- like width() and height() -- always return pixels. > > When the scaleToFit(w,h) method is called, is the image > > actually rescaled at that moment? The width() and height() > > remain the same after calling scaleToFit(w,h), although > > scaledWidth() and scaledHeight() do change to what? > > Points, pixels? > > > > The documentation is not clear on this. Thanks. > > > > David Woosley > > Mobile: 479-252-1200 > > > > > --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642 ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions
[Fwd: Re: [Fwd: Re: [iText-questions] HowTo: send an event on the pdfPage, conditionaly from a text token]]
Thank you Bruno! Yes! "newPage" is an existing text! I am reading now the iText tutorial/"Manipulating existing PDF Docs"/Introduction and I am not sure can the iText help to me.. I will write an (event oriented) parser for splitting from pdf datastream. The keywords are putted into the pages as text (probably also as metadata). I will read/parse the page with an reader and set events to a pdf writer (or only modify the the text an put it into the writer). I am testing now iText & PDFBox.. and try to evaluate what is better for my... Any idea :-) ? rumen --- Begin Message --- Rumen Varbanov wrote: >>What do you mean?.. For example when I read on a pdfPage "newPage" I send an event to the Writer: makeNewPage... Again: what do you mean? Your question doesn't make sense and therefore you won't get an answer that makes sense. Is this word 'newPage' somewhere on an existing PDF file? Then your design is wrong. Are you adding the word 'newPage' to a newly created PDF file? Then you shouldn't add the word, but use method newPage() br, Bruno --- End Message ---
Re: [iText-questions] Tables and new pages
Gavin wrote: Hi all, I need some help sorting out a formatting issue when creating an pdf. Basically i'm creating a table, setting all the settings, then from a database going through each result and creating the cells to display the data. What I am doing is looping through the results, and each time adding 4 new cells to the table, which works perfectly fine, but if the results continue onto a new page, the first 2 rows or sets of cells overlap each other. Are you using iText 1.3.6? If not, please do an upgrade and tell us if the problem persists. If you can't upgrade: please don't use class Table, use PdfPTable instead. br, Bruno --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions
Re: [iText-questions] Image units of measurement
David Woosley wrote: What are the units of measurement inside the com.lowagie.text.Image class? For example, the scaleToFit(w,h) method accepts two float arguments. It it expecting pixels, points or what? The DvdCover example makes me think this method is accepting points, not pixels. The Java docs for the Image class do not specify the units of measurement. Testing the class has taught me that some methods -- like width() and height() -- always return pixels. When the scaleToFit(w,h) method is called, is the image actually rescaled at that moment? The width() and height() remain the same after calling scaleToFit(w,h), although scaledWidth() and scaledHeight() do change to what? Points, pixels? The documentation is not clear on this. Thanks. The width and height are in pixels. The scaledWidth and scaledHeight are in user units (points). iText doesn't take the image resolution into account, nor does iText 'scale' images in the sense that the resolution gets lost. What happens is that iText adds the image AS-IS (with the original number of pixels) into the PDF (technically, into the file). If you look at the PDF document (visually, at a PDF page), you will see the image with the size defined in scaledWidth/Height. Observe that the number of pixels doesn't change when you scale an image; you only change the resolution. I hope this answer helps. I always have difficulties explaining this. br, Bruno --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions
RE: [iText-questions] Tables and new pages
Use a PdfPTable. > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On > Behalf Of Gavin > Sent: Tuesday, January 17, 2006 1:34 PM > To: itext-questions@lists.sourceforge.net > Subject: [iText-questions] Tables and new pages > > Hi all, > > I need some help sorting out a formatting issue when creating an pdf. > > Basically i'm creating a table, setting all the settings, > then from a database > going through each result and creating the cells to display the data. > > What I am doing is looping through the results, and each time > adding 4 new > cells to the table, which works perfectly fine, but if the > results continue > onto a new page, the first 2 rows or sets of cells overlap each other. > > Below is the code that generates the pdf document, the > results are collected > into an Arraylist of file objects. > > [code] > try > { > PdfWriter writer = > PdfWriter.GetInstance > (basedoc, new FileStream(Server.MapPath("") + "/_files/" + > IPAddress.Replace > (".","") + ".pdf", FileMode.Create)); > writer.SetEncryption > (PdfWriter.STRENGTH40BITS, null, null, PdfWriter.AllowPrinting); > > basedoc.Open(); > > Font items_font = new > Font(1, 10f); > basedoc.Header = new > HeaderFooter(new > Phrase("File Review Report - ", items_font), new Phrase( " : " + > DateTime.Now.ToShortDateString(), items_font)); > > Table main = new Table(4, 2); > main.DefaultCellBorder = 0; > main.Border = 0; > main.Cellpadding = 0; > main.Cellspacing = 0; > main.Padding = 0; > > main.SetWidths(new > int[4]{ 50, 300, > 100, 75}); > > Font Header_Font = new > Font(1, 20f); > Font List_Font = new > Font(1, 10f); > > Table Header = new Table(2); > > Header.DefaultCellBorder = 0; > Header.Border = 0; > Header.Cellpadding = 0; > Header.Cellspacing = 0; > Header.Padding = 0; > > Paragraph > Paragraph_HDR_MainText = new > Paragraph("File Review Report - " + AccountName, Header_Font); > Paragraph > Paragraph_HDR_SmallText = new > Paragraph("Created: " + DateTime.Now.ToShortDateString(), List_Font); > Cell Header_MainText = > new Cell(); > Header_MainText.Add > (Paragraph_HDR_MainText); > Header_MainText.Add > (Paragraph_HDR_SmallText); > > iTextSharp.text.Image logo = > iTextSharp.text.Image.GetInstance(Server.MapPath("logo.gif")); > logo.ScaleToFit(45f, 45f); > logo.Alignment = > iTextSharp.text.Image.ALIGN_RIGHT; > Cell Header_Logo = new Cell(); > Header_Logo.Add(logo); > > Header.AddCell(Header_MainText); > Header.AddCell(Header_Logo); > > Paragraph > spacer_content = new Paragraph > ("s ", new Font(1, 20f, 1, iTextSharp.text.Color.WHITE)); > Cell spacer = new > Cell(spacer_content); > spacer.Colspan = 4; > > main.AddCell(spacer); > > basedoc.Add(Header); > > Phrase header_1_phrase > = new Phrase > ("Barcode", List_Font); > Cell header_1 = new Cell > (header_1_phrase); > > Phrase header_2_phrase > = new Phrase > ("Reference", List_Font); > Cell header_2 = new Cell > (header_2_phrase); > > Phrase header_3_phrase > = new Phrase > ("Holder", List_Font); > Cell header_3 = new Cell > (header_3_phrase); > > Phrase header_4_phrase > = new Phrase > ("Review Date", List_Font); >
[iText-questions] Tables and new pages
Hi all, I need some help sorting out a formatting issue when creating an pdf. Basically i'm creating a table, setting all the settings, then from a database going through each result and creating the cells to display the data. What I am doing is looping through the results, and each time adding 4 new cells to the table, which works perfectly fine, but if the results continue onto a new page, the first 2 rows or sets of cells overlap each other. Below is the code that generates the pdf document, the results are collected into an Arraylist of file objects. [code] try { PdfWriter writer = PdfWriter.GetInstance (basedoc, new FileStream(Server.MapPath("") + "/_files/" + IPAddress.Replace (".","") + ".pdf", FileMode.Create)); writer.SetEncryption (PdfWriter.STRENGTH40BITS, null, null, PdfWriter.AllowPrinting); basedoc.Open(); Font items_font = new Font(1, 10f); basedoc.Header = new HeaderFooter(new Phrase("File Review Report - ", items_font), new Phrase( " : " + DateTime.Now.ToShortDateString(), items_font)); Table main = new Table(4, 2); main.DefaultCellBorder = 0; main.Border = 0; main.Cellpadding = 0; main.Cellspacing = 0; main.Padding = 0; main.SetWidths(new int[4]{ 50, 300, 100, 75}); Font Header_Font = new Font(1, 20f); Font List_Font = new Font(1, 10f); Table Header = new Table(2); Header.DefaultCellBorder = 0; Header.Border = 0; Header.Cellpadding = 0; Header.Cellspacing = 0; Header.Padding = 0; Paragraph Paragraph_HDR_MainText = new Paragraph("File Review Report - " + AccountName, Header_Font); Paragraph Paragraph_HDR_SmallText = new Paragraph("Created: " + DateTime.Now.ToShortDateString(), List_Font); Cell Header_MainText = new Cell(); Header_MainText.Add (Paragraph_HDR_MainText); Header_MainText.Add (Paragraph_HDR_SmallText); iTextSharp.text.Image logo = iTextSharp.text.Image.GetInstance(Server.MapPath("logo.gif")); logo.ScaleToFit(45f, 45f); logo.Alignment = iTextSharp.text.Image.ALIGN_RIGHT; Cell Header_Logo = new Cell(); Header_Logo.Add(logo); Header.AddCell(Header_MainText); Header.AddCell(Header_Logo); Paragraph spacer_content = new Paragraph ("s ", new Font(1, 20f, 1, iTextSharp.text.Color.WHITE)); Cell spacer = new Cell(spacer_content); spacer.Colspan = 4; main.AddCell(spacer); basedoc.Add(Header); Phrase header_1_phrase = new Phrase ("Barcode", List_Font); Cell header_1 = new Cell (header_1_phrase); Phrase header_2_phrase = new Phrase ("Reference", List_Font); Cell header_2 = new Cell (header_2_phrase); Phrase header_3_phrase = new Phrase ("Holder", List_Font); Cell header_3 = new Cell (header_3_phrase); Phrase header_4_phrase = new Phrase ("Review Date", List_Font); Cell header_4 = new Cell (header_4_phrase); main.AddCell(header_1); main.AddCell(header_2); main.AddCell(header_3); main.AddCell(header_4); Paragraph spacer_content1 = new Paragraph("s ",
[iText-questions] Image units of measurement
What are the units of measurement inside the com.lowagie.text.Image class? For example, the scaleToFit(w,h) method accepts two float arguments. It it expecting pixels, points or what? The DvdCover example makes me think this method is accepting points, not pixels. The Java docs for the Image class do not specify the units of measurement. Testing the class has taught me that some methods -- like width() and height() -- always return pixels. When the scaleToFit(w,h) method is called, is the image actually rescaled at that moment? The width() and height() remain the same after calling scaleToFit(w,h), although scaledWidth() and scaledHeight() do change to what? Points, pixels? The documentation is not clear on this. Thanks. David Woosley Mobile: 479-252-1200
RE: [iText-questions] simply add a bookmark at the root of new PDF for each concat'ed document?
The SimpleBookmark javadocs explain the structure. > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On > Behalf Of bruno > Sent: Tuesday, January 17, 2006 2:13 PM > To: Aaron J Weber > Cc: itext-questions@lists.sourceforge.net > Subject: Re: [iText-questions] simply add a bookmark at the > root of new PDF for each concat'ed document? > > Aaron J Weber wrote: > > > OK, what's new to me is the part where you are adding a > bookmark using > > a Java HashMap. What I don't understand from that is how > the List of > > bookmarks that I would want to insert my new one into > ("bookmarks" in > > your example) is ordered and how it relates to the Outline. > > Export the list to XML with the appropriate SimpleBookmark > method and you'll understand. (It's a nested structure.) > > > <>So I understand you're creating a new bookmark with > your snippet > > at the bottom. However, if I have a list of 10's or 100's of > > bookmarks already in the List, how can I insert mine in the right > > order/position in the List and still maintain any inherent > numbering > > in the lists returned by the SimpleBookmark call. Plus, how do I > > specify that my bookmark is at the "root" of the bookmark list (and > > has no kids/children)? > > The ArrayList defines the order. > Adding an extra outline as the first element of the list > won't have any effect on the page numbering. > Only on the way bookmarks are organized. > br, > Bruno > > > --- > This SF.net email is sponsored by: Splunk Inc. Do you grep > through log files > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. > DOWNLOAD SPLUNK! > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&; > dat=121642 > ___ > iText-questions mailing list > iText-questions@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/itext-questions > --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642 ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions
Re: [Fwd: Re: [iText-questions] HowTo: send an event on the pdfPage, conditionaly from a text token]
Rumen Varbanov wrote: >>What do you mean?.. For example when I read on a pdfPage "newPage" I send an event to the Writer: makeNewPage... Again: what do you mean? Your question doesn't make sense and therefore you won't get an answer that makes sense. Is this word 'newPage' somewhere on an existing PDF file? Then your design is wrong. Are you adding the word 'newPage' to a newly created PDF file? Then you shouldn't add the word, but use method newPage() br, Bruno --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions
[Fwd: Re: [iText-questions] HowTo: send an event on the pdfPage, conditionaly from a text token]
>>What do you mean?.. For example when I read on a pdfPage "newPage" I send an event to the Writer: makeNewPage... Thank you! rumen --- Begin Message --- Rumen Varbanov wrote: Hi How to send an event on the pdfPage (or to the pdfDocument), conditionaly from a text token? What do you mean? Maybe the genericTag event can help you. br, Bruno --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions --- End Message ---
Re: [iText-questions] Printing PDF's randomly outputs junk characters
Yep, you're right. The printer settings for spooling are not easily manipulated by programs. maybe you should have a support page explaining how to change such settings. Spooling before printing will make the start to printing slow, but the overall printing speed will not matter (unless the document is unusually heavily bloated; in which case it is better to have multple pdf files). On 1/17/06, Steve Vanspall <[EMAIL PROTECTED]> wrote: > Oh right, um I am not that savvy on printer setup and the like, > > so all printers can be set to wait until spooling is complete. I need to > work out a solution that is reasonably wasy to expalin to the end users, > but does not cause majore performance issues for the rest of their > printing. > > I guess I will try that first, although not sure how to make that > setting change, I assume it's different for all printers. > > Steve > > Vineet Reynolds wrote: > > >Maybe you should set the printer to print only after the document is > >completely spooled. Usually, printers start printing when they receive > >th first page of the document, and that could be the real problem. > > > >On 1/17/06, Steve Vanspall <[EMAIL PROTECTED]> wrote: > > > > > >>Thanks for that, > >> > >>having clarified the problem a bit, it only really seems to happen when > >>they are printing a large number of the generated PDF's. They are > >>definately not shutting down the PC before printing finishes. > >> > >>It does seem to suggest that something residual is haging around in the > >>printer buffer or in the info the acrobat is serving to the printer. > >> > >>I guess my main worry, is how can I check to make sure the PDF I am > >>creating is coming out intact, > >> > >>I am 99% sure that the generated PDF's are not the problem, but would > >>like to be 100% sure. > >> > >>Is there a way to check the integrity of a PDF file?? > >> > >>thanks > >> > >>Steve > >> > >>Bruno Lowagie wrote: > >> > >> > >> > >>>Steve Vanspall wrote: > >>> > >>> > >>> > Has anyone else had this problem, anyone found a solution??? > > > >>>I once spent some time on a similar problem at work. > >>>The problem never occured when I was around. > >>>Then I got an idea: I printed a large document > >>>and I shut down the PC of the end user before > >>>the document was completely printed. > >>>Junk characters appeared. Problem solved. > >>>A pity I couldn't charge the end-user for wasting > >>>my time. > >>>br, > >>>Bruno > >>> > >>> > >>>--- > >>>This SF.net email is sponsored by: Splunk Inc. Do you grep through log > >>>files > >>>for problems? Stop! Download the new AJAX search engine that makes > >>>searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > >>>http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click > >>>___ > >>>iText-questions mailing list > >>>iText-questions@lists.sourceforge.net > >>>https://lists.sourceforge.net/lists/listinfo/itext-questions > >>> > >>> > >>> > >>> > >>> > >> > >> > >> > >>--- > >>This SF.net email is sponsored by: Splunk Inc. Do you grep through log files > >>for problems? Stop! Download the new AJAX search engine that makes > >>searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > >>http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click > >>___ > >>iText-questions mailing list > >>iText-questions@lists.sourceforge.net > >>https://lists.sourceforge.net/lists/listinfo/itext-questions > >> > >> > >> > > > > > >--- > >This SF.net email is sponsored by: Splunk Inc. Do you grep through log files > >for problems? Stop! Download the new AJAX search engine that makes > >searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > >http://sel.as-us.falkag.net/sel?cmd=k&kid3432&bid#0486&dat1642 > >___ > >iText-questions mailing list > >iText-questions@lists.sourceforge.net > >https://lists.sourceforge.net/lists/listinfo/itext-questions > > > > > > > > > > > > > > --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642 ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions
Re: [iText-questions] simply add a bookmark at the root of new PDF for each concat'ed document?
Aaron J Weber wrote: OK, what's new to me is the part where you are adding a bookmark using a Java HashMap. What I don't understand from that is how the List of bookmarks that I would want to insert my new one into ("bookmarks" in your example) is ordered and how it relates to the Outline. Export the list to XML with the appropriate SimpleBookmark method and you'll understand. (It's a nested structure.) <>So I understand you're creating a new bookmark with your snippet at the bottom. However, if I have a list of 10's or 100's of bookmarks already in the List, how can I insert mine in the right order/position in the List and still maintain any inherent numbering in the lists returned by the SimpleBookmark call. Plus, how do I specify that my bookmark is at the "root" of the bookmark list (and has no kids/children)? The ArrayList defines the order. Adding an extra outline as the first element of the list won't have any effect on the page numbering. Only on the way bookmarks are organized. br, Bruno --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions
Re: [iText-questions] HowTo: send an event on the pdfPage, conditionaly from a text token
Rumen Varbanov wrote: Hi How to send an event on the pdfPage (or to the pdfDocument), conditionaly from a text token? What do you mean? Maybe the genericTag event can help you. br, Bruno --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions
[iText-questions] HowTo: send an event on the pdfPage, conditionaly from a text token
Hi How to send an event on the pdfPage (or to the pdfDocument), conditionaly from a text token? Thank you rumen --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions
Re: [iText-questions] simply add a bookmark at the root of new PDF for each concat'ed document?
OK, what's new to me is the part where you are adding a bookmark using a Java HashMap. What I don't understand from that is how the List of bookmarks that I would want to insert my new one into ("bookmarks" in your example) is ordered and how it relates to the Outline. So I understand you're creating a new bookmark with your snippet at the bottom. However, if I have a list of 10's or 100's of bookmarks already in the List, how can I insert mine in the right order/position in the List and still maintain any inherent numbering in the lists returned by the SimpleBookmark call. Plus, how do I specify that my bookmark is at the "root" of the bookmark list (and has no kids/children)? To solve one of these problems, can I simply append my new HashMap (bookmark) to the main list as I open each document to be concatenated (and set the page number appropriately in the bookmark)? But the second question still nags: Will this mess-up any inherent numbering in the existing bookmarks? How do I specify that my new bookmark should be at the root of the outline? Thanks again! -AJ - Original Message - From: bruno To: Aaron J Weber Cc: itext-questions@lists.sourceforge.net Sent: Tuesday, January 17, 2006 2:57 AM Subject: Re: [iText-questions] simply add a bookmark at the root of new PDF for each concat'ed document? Aaron J Weber wrote:> This has got to be an easy one for all you iText "Pros" out there!> > I'm looking at the "iText by Example", Concatenate.java file. What I > think would be stellar would be if we could (optionally) add a > bookmark at the root of the outline that has a destination of the > first page of the concatenated document.> > Some of the logic would change a little (i.e. the SimpleBookmark list > may never be null if you're prepending it to that list).> > Anyway, can anyone give me an example of how I could mod that code to > simply insert a bookmark as I concat each file in the array?Read the following example,try to understand what happensand adapt it to your needs:ArrayList bookmarks = new ArrayList();PdfReader reader = new PdfReader("HelloWorld1.pdf");Document document = new Document(reader.getPageSizeWithRotation(1));PdfCopy copy = new PdfCopy(document, new FileOutputStream("HelloWorldCopyBookmarks.pdf"));document.open();copy.addPage(copy.getImportedPage(reader, 1));bookmarks.addAll(SimpleBookmark.getBookmark(reader));reader = new PdfReader("HelloWorld2.pdf");copy.addPage(copy.getImportedPage(reader, 1));List tmp = SimpleBookmark.getBookmark(reader);SimpleBookmark.shiftPageNumbers(tmp, 1, null);bookmarks.addAll(tmp);reader = new PdfReader("HelloWorld3.pdf");copy.addPage(copy.getImportedPage(reader, 1));tmp = SimpleBookmark.getBookmark(reader);SimpleBookmark.shiftPageNumbers(tmp, 2, null);bookmarks.addAll(tmp);copy.setOutlines(bookmarks);document.close();If null is returned (if no bookmarks are present),you can create bookmarks like this:HashMap map = new HashMap();map.put("Title", "Title Page");map.put("Action", "GoTo");map.put("Page", "1 Fit");list.add(0, map);br,Bruno
RE: [iText-questions] Table borders when converting from HTML to RTF
Ah, interesting. The borders aren't visible when I print the document. I hadn't tried that! Thanks for your help Bruno. > -Original Message- > From: bruno [mailto:[EMAIL PROTECTED] > Sent: 17 January 2006 13:01 > To: Barnaby Golden > Cc: itext-questions@lists.sourceforge.net > Subject: Re: [iText-questions] Table borders when converting > from HTML to RTF > > Barnaby Golden wrote: > > >Can anyone think of a way to switch off the border on tables in > >RtfWriter2? > > > Are the borders visible if you print the document? > Because if I remember well, you can always see the borders of > a table in word, even if you don't want them printed on paper. > br, > Bruno > --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642 ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions
Re: [iText-questions] Table borders when converting from HTML to RTF
Barnaby Golden wrote: Can anyone think of a way to switch off the border on tables in RtfWriter2? Are the borders visible if you print the document? Because if I remember well, you can always see the borders of a table in word, even if you don't want them printed on paper. br, Bruno --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions
Re: [iText-questions] HowTo: delete Text from a pdfPage
Rumen Varbanov wrote: Hi, Have you an example how to delete "Hello" from the HelloWorld.pdf? PDF is not meant to be edited. So no, I don't have such an example. (Actually I have one, but you wouldn't be able to use it for more complex text.) br, Bruno --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions
[iText-questions] Table borders when converting from HTML to RTF
I'm using itext to convert from HTML to both PDF and RTF, using HtmlParser and PdfWriter/RtfWriter2. If I take a simple HTML page containing a table and convert it to a PDF using PdfWriter, I get a table with no borders. If I do the same thing with RtfWriter2 I get a table with a border. Setting the border attribute to zero in the HTML table has no effect, I always get the table with a border in the RTF document. For my application borderless tables are essential. Can anyone think of a way to switch off the border on tables in RtfWriter2? Because I am converting directly from HTML to RTF I don't really have access to the itext formatting classes, which really complicates things. Any help would be much appreciated. Barnaby --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642 ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions
[iText-questions] HowTo: delete Text from a pdfPage
Hi, Have you an example how to delete "Hello" from the HelloWorld.pdf? Thank you! rumen --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions
[iText-questions] CFP - INFOCOMP Journal
Dear Colleagues: We would like to invite you to submit a paper for INFOCOMP, ISSN 1807-4545, is a quarterly scientific magazine and continuous flow and it is receiving papers for publication in the VOLUME 5, NUMBER 1. We are indexed in CiteSeer, DEST, DOAJ, EBSCO, INSPEC, IS Journals and IS World and currently, we are in indexation process in DBLP and in SciELO. Authors are invited to submit originals papers, referring to relevant themes to the investigation and application in the Computer Science. The principal areas of interesting are, but are not limited to: - Databases - Software Engineering - Informatics in Education and Distance Learning - Graphic Computation and Virtual Reality - Hypermedia e Multimedia - Information Systems - Optimization and Intelligent Automation - Computation Theory and Applied Mathematics - Bioinformatics - E-Commerce and E-Services - Mobile Ad-hoc and Sensor Networks - Mobile Multimedia Communications - Web Services and XML IMPORTANT DATES Submission Date: January 27, 2006 Acceptance Notification: February 27, 2006 Final Version: February 28, 2005 === SUBMISSION === The subject must have the information: INFOCOMP SUBMISSION - (Paper Title) Submissions should be made electronically, in PDF (preferred) or Postscript format via JEMS (https://submissoes.sbc.org.br/infocomp). The length of paper will be limited to 10 pages. Papers must not have been previously published or currently submitted for publication elsewhere. Papers will be evaluated for originality, significance, clarity, soundness, technical quality, results, presentation, practical application, and learned lesson. Each paper will be refereed by three researchers of the Computer Science area. Instructions to formatting and submitting papers are available in site: http://www.dcc.ufla.br/infocomp = EDITORS = Luiz Henrique Andrade Correia, DCC-UFLA, MG Heitor Augustus Xavier Costa, DCC-UFLA, MG -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.1.375 / Virus Database: 267.14.19/231 - Release Date: 1/16/2006 --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions
Re: [iText-questions] Align paragraph
Carlos Bergueira wrote: So sorry ! I didn't see the last lines in the previous and that's why I didn't see you answer. No problem ;-) Bruno --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions
Re: [iText-questions] Changing Submit-Action of a PushButton in a PDF Form
Hi Paulo, Thanx for the help. I tried it but it didn't change the action-URL. Please find the code below- FDFInput is the form input received when the form was submitted, strFormName is an internal variable used to denore the logical name of form, strTemplatePath is the file path of PDF form template (the actual form, which is rendered to users). private String processFdfWithoutSignatures(FdfReader FDFInput,String strFormName,String strTemplatePath, String strWorkingPath) throws FormServerException { strWorkingPath += String.valueOf((int)(Math.random() * 1000)); String strOutPDF = strWorkingPath + strFormName + ".pdf"; try { PdfReader reader = new PdfReader(strTemplatePath); PdfStamper stamp = new PdfStamper(reader, new FileOutputStream(strOutPDF)); AcroFields form = stamp.getAcroFields(); HashMap hFields = null; Set setFieldNames = null; int nfieldCount = 0; hFields = FDFInput.getFields(); nfieldCount = hFields.size(); setFieldNames = hFields.keySet(); String strFieldValue = null; String strFieldName = null; for(Iterator it = setFieldNames.iterator(); it.hasNext();) { strFieldName = (String)it.next(); if(form.getFieldType(strFieldName) == AcroFields.FIELD_TYPE_PUSHBUTTON) { AcroFields.Item objItem = form.getFieldItem(strFieldName); ArrayList objArrayList = objItem.widgets; PdfDictionary objPdfDict = (PdfDictionary)objArrayList.get(0); PdfDictionary action = (PdfDictionary)PdfReader.getPdfObject(objPdfDict.get(PdfName.A)); action.put(PdfName.URI, new PdfString("http://mysite/go";)); } } // End of for } stamp.close(); } catch(Exception ex) { ex.printStackTrace(); } return strOutPDF; } Thanx and Regards Nitin - Original Message - From: "Paulo Soares" <[EMAIL PROTECTED]> To: "Nitin Tomer" <[EMAIL PROTECTED]>; Sent: Tuesday, January 17, 2006 4:01 PM Subject: RE: [iText-questions] Changing Submit-Action of a PushButton in a PDF Form ArrayList objArrayList = objItem.widgets; PdfDictionary dic = (PdfDictionary)objArrayList.get(0); PdfDictionary action = (PdfDictionary)PdfReader.getPdfObject(dic.get(PdfName.A)); action.put(PdfName.URI, new PdfString("http://mysite/go";)); Disclaimer :- This e-mail message including any attachment may contain confidential, proprietary or legally privileged information. It should not be used by who is not the original intended recipient. If you have erroneously received this message, you are notified that you are strictly prohibited from using, coping, altering or disclosing the content of this message. Please delete it immediately and notify the sender. Newgen Software Technologies Ltd and / or its subsidiary Companies accept no responsibility for loss or damage arising from the use of the information transmitted by this email including damage from virus and further acknowledges that any views expressed in this message are those of the individual sender and no binding nature of the message shall be implied or assumed unlessthe sender does so expressly with due authority of Newgen Software TechnologiesLtd and / or its subsidiary Companies, as applicable. --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions
Re: [iText-questions] cyrillic characters overlapping
[EMAIL PROTECTED] wrote: Ah - thanks for the feedback I'd read the part about the encodings and I read it as saying you just need to tell it to use the right ecoding (which did help - it got me from ???'s to the characters) Yes, on your system, but not necessarily on another machine. All depends on the font that is used to replace the so called built-in font. It might not have the cyrillic characters. Having now gone through the next bit, I changed the font line to Font norm = FontFactory.getFont("C:\\Windows\\Fonts\\Times.ttf","ISO-8859-5", 9, Font.NORMAL); which now works prefectly - or at least seems to - is that the best way to do it? You are using an OpenType font with TrueType outlines that is distributed with Windows. The outlines of the glyphs you need in your text will be embedded in your document. This will have an impact on the file size, but it's the best solution to ensure that every end-user will be able to read the document. best regards, Bruno --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions
Re: [iText-questions] Align paragraph
Bruno,So sorry !I didn't see the last lines in the previous and that's why I didn't see you answer.Thanks,CarlosOn 1/17/06, bruno <[EMAIL PROTECTED]> wrote:Carlos Bergueira wrote: >> Hi All,>> Do am I doing things right ?> Font, color is ok... but align is not working !Are you making fun of me?I predicted AND answered your question.See the archives: http://article.gmane.org/gmane.comp.java.lib.itext.general/20300br,Bruno-- Cumprts, Carlos Bergueira
Re: [iText-questions] Align paragraph
Carlos Bergueira wrote: Hi All, Do am I doing things right ? Font, color is ok... but align is not working ! Are you making fun of me? I predicted AND answered your question. See the archives: http://article.gmane.org/gmane.comp.java.lib.itext.general/20300 br, Bruno --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions
RE: [iText-questions] Align paragraph
Paragraph paragraph3 = new Paragraph(); paragraph3.setAlignment(Element.ALIGN_LEFT); document.add(new Paragraph(new Phrase("Left...", red))); What happened to paragraph3? > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On > Behalf Of Carlos Bergueira > Sent: Tuesday, January 17, 2006 11:24 AM > To: itext-questions@lists.sourceforge.net > Subject: [iText-questions] Align paragraph > > > Hi All, > > Do am I doing things right ? > Font, color is ok... but align is not working ! > > Could onyone tell me if I am doing things like it should be ? > > Thanks. > > Code: > > Font blue = > FontFactory.getFont(FontFactory.HELVETICA, Font.DEFAULTSIZE, > Font.ITALIC, new Color(0x00, 0x00, 0xFF)); > Font red = FontFactory.getFont(FontFactory.HELVETICA, > Font.DEFAULTSIZE, Font.BOLD, new Color(0xFF, 0x00, 0x00)); > Font orange = > FontFactory.getFont(FontFactory.HELVETICA, Font.DEFAULTSIZE, > Font.ITALIC, new Color(0xFF, 0x66, 0x00)); > > Paragraph paragraph1 = new Paragraph(); > paragraph1.setAlignment(Element.ALIGN_CENTER ); > document.add(new Paragraph(new Phrase("* Centered > title *", orange))); > > Paragraph paragraph2 = new Paragraph(); > paragraph2.setAlignment(Element.ALIGN_RIGHT); > document.add (new Paragraph(new Phrase("Right...", blue))); > > Paragraph paragraph3 = new Paragraph(); > paragraph3.setAlignment(Element.ALIGN_LEFT); > document.add(new Paragraph(new Phrase("Left...", red))); > > -- > Cumprts, > Carlos Bergueira > --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642 ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions
RE: [iText-questions] printing with iText
No. Printing requires rasterizing and a lot more work than you think. > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On > Behalf Of Andreas Kreuzer > Sent: Tuesday, January 17, 2006 10:47 AM > To: itext-questions@lists.sourceforge.net > Subject: [iText-questions] printing with iText > > Hello there, > > is it possible to create a simle g2d-print-service from the > pdfreader get-functions by translating the dictionaries ? > > Greetings A. Kreuzer > __ > > Erweitern Sie FreeMail zu einem noch leistungsstärkeren > E-Mail-Postfach! > Mehr Infos unter http://freemail.web.de/home/landingpad/?mc=021131 > > > > --- > This SF.net email is sponsored by: Splunk Inc. Do you grep > through log files > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. > DOWNLOAD SPLUNK! > http://sel.as-us.falkag.net/sel?cmd=k&kid3432&bid#0486&dat1642 > ___ > iText-questions mailing list > iText-questions@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/itext-questions > --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642 ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions
[iText-questions] Align paragraph
Hi All,Do am I doing things right ?Font, color is ok... but align is not working !Could onyone tell me if I am doing things like it should be ?Thanks.Code: Font blue = FontFactory.getFont(FontFactory.HELVETICA, Font.DEFAULTSIZE, Font.ITALIC, new Color(0x00, 0x00, 0xFF)); Font red = FontFactory.getFont(FontFactory.HELVETICA, Font.DEFAULTSIZE, Font.BOLD, new Color(0xFF, 0x00, 0x00)); Font orange = FontFactory.getFont(FontFactory.HELVETICA, Font.DEFAULTSIZE, Font.ITALIC, new Color(0xFF, 0x66, 0x00)); Paragraph paragraph1 = new Paragraph(); paragraph1.setAlignment(Element.ALIGN_CENTER ); document.add(new Paragraph(new Phrase("* Centered title *", orange))); Paragraph paragraph2 = new Paragraph(); paragraph2.setAlignment(Element.ALIGN_RIGHT); document.add (new Paragraph(new Phrase("Right...", blue))); Paragraph paragraph3 = new Paragraph(); paragraph3.setAlignment(Element.ALIGN_LEFT); document.add(new Paragraph(new Phrase("Left...", red))); -- Cumprts,Carlos Bergueira
Re: [iText-questions] printing with iText
Andreas Kreuzer wrote: Hello there, is it possible to create a simle g2d-print-service from the pdfreader get-functions by translating the dictionaries ? Everything is possible, but it's a hell of a job; nobody has implemented this in iText yet. You should have a look at JPedal. I think they have that kind of functionality. br, Bruno --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions
RE: [iText-questions] I need a table cell with an image and a text
You can't have text and image at the same time, not like this. Place your text as you did but place the image with a PdfPCellEvent or a PdfPTableEvent. See the tutorial. From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Rosa LagoSent: Monday, January 16, 2006 7:17 PMTo: itext-questions@lists.sourceforge.netSubject: [iText-questions] I need a table cell with an image and a text I hava a PdfTable whose cells have an image. In some of its cells I want to write a text. The image of the cells is a transparent PNG file, but I can not see the text. Here I send a piece of my code dibu = rutaImagenes+dibu+".png"; String materia = (String) ((ArrayList)franjas.get(h1)).get(1); cell = new PdfPCell(new Paragraph("matematicas", normal)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); Image imagen = Image.getInstance(dibu); cell.setImage(imagen); cell.setBackgroundColor(new Color(0xFF)); tabla.addCell(cell); I can see the table and the cell images, but the text is not shown. How can I do to see the image and the text? Thanks in advance Rosa
RE: [iText-questions] get certificates from pdf
Look at the AcroFields source. > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On > Behalf Of Fabio Mondelli > Sent: Monday, January 16, 2006 12:18 PM > To: itext-questions@lists.sourceforge.net > Subject: [iText-questions] get certificates from pdf > > hello, > > I try to get the certificates out from an signed pdf document. > is there any code sample to see how it is realizable? > > My scope is to read an signed pdf file from filesystem and to extract > the cerfitcates from it to verify them seperately in an other api(not > itext). > > has anyone an idea. > > thanks a lot > > > --- > This SF.net email is sponsored by: Splunk Inc. Do you grep > through log files > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. > DOWNLOAD SPLUNK! > http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click > ___ > iText-questions mailing list > iText-questions@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/itext-questions > --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642 ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions
[iText-questions] printing with iText
Hello there, is it possible to create a simle g2d-print-service from the pdfreader get-functions by translating the dictionaries ? Greetings A. Kreuzer __ Erweitern Sie FreeMail zu einem noch leistungsstärkeren E-Mail-Postfach! Mehr Infos unter http://freemail.web.de/home/landingpad/?mc=021131 --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642 ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions
RE: [iText-questions] Changing Submit-Action of a PushButton in a PDF Form
ArrayList objArrayList = objItem.widgets; PdfDictionary dic = (PdfDictionary)objArrayList.get(0); PdfDictionary action = (PdfDictionary)PdfReader.getPdfObject(dic.get(PdfName.A)); action.put(PdfName.URI, new PdfString("http://mysite/go";)); > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On > Behalf Of Nitin Tomer > Sent: Tuesday, January 17, 2006 6:37 AM > To: iText-questions@lists.sourceforge.net > Subject: [iText-questions] Changing Submit-Action of a > PushButton in a PDF Form > > Hi, > I need to change the Submit-Action (the URL) of a > push-button in an > AcroForm programmatically. I got all the fields of the form > in an AcroField > object; and then traversed the fileds to looks for the > PushButton type > field. Then for the push-button filed I got the ArrayList > widgets from > AcroFields.Item. Following the code I used to traverse thru > this ArrayList- > > ArrayList objArrayList = objItem.widgets; > Iterator iter1 = objArrayList.iterator(),iter2; > String strName; > PdfDictionary objPdfDict = null; > PdfName objName = null; > PdfObject objObject = null; > while(iter1.hasNext()) > { >objPdfDict = (PdfDictionary)iter1.next(); >System.out.println("PdfDictionary Object: " + > objPdfDict.toString()); >Set objSet = objPdfDict.getKeys(); >for(iter2 = objSet.iterator(); iter2.hasNext();) >{ > objName = (PdfName)iter2.next(); > objObject = objPdfDict.get(objName); > System.out.println("objName: " + objName.toString() + > " - objObject: > " + objObject.toString() + " - Type: " + objObject.type()); > if(objObject.isDictionary()) > { > Set objSet2 = ((PdfDictionary)objObject).getKeys(); > PdfObject objObject2; > PdfName objName2; > for(Iterator iter3 = objSet2.iterator(); iter3.hasNext();) > { > objName2 = (PdfName)iter3.next(); > objObject2 = ((PdfDictionary)objObject).get(objName2); > System.out.println("objName2: " + objName2.toString() + " - > objObject2: " + objObject2.toString() + " - Type: " + > objObject2.type()); > } > } >} > } > > The output is - > > PdfDictionary Object: [EMAIL PROTECTED] > objName: /AP - objObject: > [EMAIL PROTECTED] - Type: > 6 > objName2: /D - objObject2: > [EMAIL PROTECTED] - > Type: 10 > objName2: /N - objObject2: > [EMAIL PROTECTED] - > Type: 10 > objName: /MK - objObject: > [EMAIL PROTECTED] - Type: > 6 > objName2: /CA - objObject2: Submit - Type: 3 > objName2: /BG - objObject2: > [EMAIL PROTECTED] - Type: 5 > objName2: /BC - objObject2: > [EMAIL PROTECTED] - Type: 5 > objName: /P - objObject: > [EMAIL PROTECTED] - > Type: 10 > objName: /Parent - objObject: > [EMAIL PROTECTED] - Type: 10 > objName: /H - objObject: /P - Type: 4 > objName: /F - objObject: 4 - Type: 2 > objName: /BS - objObject: > [EMAIL PROTECTED] - Type: 6 > objName2: /W - objObject2: 2 - Type: 2 > objName2: /S - objObject2: /B - Type: 4 > objName: /Subtype - objObject: /Widget - Type: 4 > objName: /A - objObject: > [EMAIL PROTECTED] - > Type: 10 > objName: /Type - objObject: /Annot - Type: 4 > objName: /Rect - objObject: > [EMAIL PROTECTED] - Type: 5 > > Please give some inputs on how to change the submit-action > URL. I am stuck > and not able to move forward. > > Thanx and Regards > > Nitin > > > > Disclaimer :- This e-mail message including any attachment > may contain confidential, proprietary or legally privileged > information. It should not be used by who is not the original > intended recipient. If you have erroneously received this > message, you are notified that you are strictly prohibited > from using, coping, altering or disclosing the content of > this message. Please delete it immediately and notify the > sender. Newgen Software Technologies Ltd and / or its > subsidiary Companies accept no responsibility for loss or > damage arising from the use of the information transmitted by > this email including damage from virus and further > acknowledges that any views expressed in this message are > those of the individual sender and no binding nature of the > message shall be implied or assumed unlessthe sender does so > expressly with due authority of Newgen Software > TechnologiesLtd and / or its subsidiary Companies, as applicable. > > > > --- > This SF.net email is sponsored by: Splunk Inc. Do you grep > through log files > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. > DOWNLOAD SPLUNK! > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&; > dat=121642 > ___ > iText-questions mailing list > iText-questions@lists.sourceforge.net > https://lists.sourceforge.net/lists/list
Re: [iText-questions] iText capabilities
XFA support will be ready in a couple of week's time. It will allow to do 1. For 2 and 3 it's just a matter of xml manipulation as it has no influence in the pdf itself. If you use normal forms iText can already do all that. Best Regards, Paulo Soares - Original Message - From: "bruno" <[EMAIL PROTECTED]> To: "Bob Haxel" <[EMAIL PROTECTED]>; Sent: Tuesday, January 17, 2006 8:28 AM Subject: Re: [iText-questions] iText capabilities Hello, you weren't subscribed to the mailing list, so I had to pass your mail manually. Bob Haxel wrote: Our PDFs will be created in Adobe’s LifeCycle Designer 7. Prior to rendering the form to the user I will need the ability to: For the moment XFA isn't supported yet in iText. Is iText what I’m looking for? Paulo is working on XFA support. Normally he should have some basic XFA stuff ready for the next release, but I don't exactly know what and when. He'll probably give you an answer through the mailing list. In the meanwhile, you'll find some more info here: http://thread.gmane.org/gmane.comp.java.lib.itext.general/19127 http://thread.gmane.org/gmane.comp.java.lib.itext.general/19373 http://thread.gmane.org/gmane.comp.java.lib.itext.general/20033 br, Bruno --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=k&kid3432&bid#0486&dat1642 ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions
Re: [iText-questions] iText capabilities
Hello, you weren't subscribed to the mailing list, so I had to pass your mail manually. Bob Haxel wrote: Our PDFs will be created in Adobe’s LifeCycle Designer 7. Prior to rendering the form to the user I will need the ability to: For the moment XFA isn't supported yet in iText. Is iText what I’m looking for? Paulo is working on XFA support. Normally he should have some basic XFA stuff ready for the next release, but I don't exactly know what and when. He'll probably give you an answer through the mailing list. In the meanwhile, you'll find some more info here: http://thread.gmane.org/gmane.comp.java.lib.itext.general/19127 http://thread.gmane.org/gmane.comp.java.lib.itext.general/19373 http://thread.gmane.org/gmane.comp.java.lib.itext.general/20033 br, Bruno --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642 ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions
[iText-questions] Re: Horizontal Lines After Each Section
[EMAIL PROTECTED] wrote: Hi, I have just started using iText, looks like a great piece of software! Note that you mailed your question to the wrong address (to the admin instead of the list). I want to produce a document where I have say 3 paragraphs of text then I want a horizontal line going across the width of the page and then more paragraphs, ie the horizontal line dividing the document into sections. The problem is I will not know physically where to position the line because I do not know the absolute posion of the last line. Ideally it would be great if I could create say 4 sections with lines between each section and the lines be aligned to the bottom of each section... Maybe something can be done using Chunks There are two easy ways to do it: - use PdfWriter.getVerticalPosition after adding a Paragaph - use page events and implement the onParagraph or onParagraphEnd. I noticed that onParagraphEnd doesn't exactly return the position I expected: you need to subtract the leading from the value that is returned if you want to draw a line under the paragraph. br, Bruno --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions
[iText-questions] iText capabilities
Hi, I’m new to iText and am trying to determine if it can do what I want it to. We have a Forms processing application and we need to be able to get into the form and manipulate it somewhat prior to rendering and after it has been submitted back to us. We have experience with the PDF/FDF offering from Adobe and use that now, but it is limiting. I’ve also been mucking around with PDF/XDP, but am having problems populating the form field data (adobe is looking into that now). With the troubles I have been having with XDP, I began to wonder about an API to just modify the PDF directly which brings me here. Our PDFs will be created in Adobe’s LifeCycle Designer 7. Prior to rendering the form to the user I will need the ability to: 1.) get/set form field values (Text fields, radio buttons, checkboxes, combo boxes, etc.) 2.) get/set the submit target URL for a given button. 3.) Get/set a combo box’s choice list. Once rendered, it’s fine by me if the form returns an XDP file (in fact right now it’s preferable). So I really just need to do the above. Is iText what I’m looking for? Thanks, Bob Bob Haxel, Sr. Software Developer Patron Systems, Inc. (www.patronsystems.com) 5775 Flatiron Parkway, Suite 230 Boulder, CO 80301 - USA Phone: 303.245.7344 Fax: 303.541.1055 [EMAIL PROTECTED]
Re: [iText-questions] iText Installation location?
Chris Gonzalez wrote: Where do i place the iText files? Do they belong on each server or do they need to reside on the developers machine? If the developers write and compile their code on their own machine: Yes Do the Library of files need to be in an IIS folder? If they are writing web applications: Yes Unless they ship the jar in a war file. Then the iText.jar is shipped with every application. Thes may be silly questions, since I am not a developer I am not sure how this product needs to be installed and can not find any README.txt file to explains how it should be installed. It's just putting a jar in a CLASSPATH. This is: if you are using Java. I don't know about .NET. br, Bruno --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions
Re: [iText-questions] simply add a bookmark at the root of new PDF for each concat'ed document?
Aaron J Weber wrote: This has got to be an easy one for all you iText "Pros" out there! I'm looking at the "iText by Example", Concatenate.java file. What I think would be stellar would be if we could (optionally) add a bookmark at the root of the outline that has a destination of the first page of the concatenated document. Some of the logic would change a little (i.e. the SimpleBookmark list may never be null if you're prepending it to that list). Anyway, can anyone give me an example of how I could mod that code to simply insert a bookmark as I concat each file in the array? Read the following example, try to understand what happens and adapt it to your needs: ArrayList bookmarks = new ArrayList(); PdfReader reader = new PdfReader("HelloWorld1.pdf"); Document document = new Document(reader.getPageSizeWithRotation(1)); PdfCopy copy = new PdfCopy(document, new FileOutputStream("HelloWorldCopyBookmarks.pdf")); document.open(); copy.addPage(copy.getImportedPage(reader, 1)); bookmarks.addAll(SimpleBookmark.getBookmark(reader)); reader = new PdfReader("HelloWorld2.pdf"); copy.addPage(copy.getImportedPage(reader, 1)); List tmp = SimpleBookmark.getBookmark(reader); SimpleBookmark.shiftPageNumbers(tmp, 1, null); bookmarks.addAll(tmp); reader = new PdfReader("HelloWorld3.pdf"); copy.addPage(copy.getImportedPage(reader, 1)); tmp = SimpleBookmark.getBookmark(reader); SimpleBookmark.shiftPageNumbers(tmp, 2, null); bookmarks.addAll(tmp); copy.setOutlines(bookmarks); document.close(); If null is returned (if no bookmarks are present), you can create bookmarks like this: HashMap map = new HashMap(); map.put("Title", "Title Page"); map.put("Action", "GoTo"); map.put("Page", "1 Fit"); list.add(0, map); br, Bruno --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions