Re: [iText-questions] Where can I get the current horizontal positionwithin ColumnText/PDFWriter?
Hello Paulo, Thanks for the hint! I had a look at that functinality and checked, if ColumnText.go() supports any column-oriented events. In 2.1.7 I did not see anything. I do not see, how tagged chunks would help me, as I do not know beforehand at what word the end of the column will be reached? The required event is not content-related but rendering-related. Or did you mean - tag all chunks - build a handler, that is called whenever a chunk is processed - make that handler remember the latest position - use that position after go() returns to put the image into the right place ? Still, my chunks hold several words and the words will be hyphenated. So that does not sound precise enough. Also, the book states on page 126, Chp4.6.1 ... this event is not triggered immediately after the Chunk object is added to the document... I guess, the sequence of events is not garanteed too. I see two other options to implement the desired functionality: - put code into ColumnText.go() to generate an event whenever the column if full or the text ends. Then pass the current position in that event object - change ColumnText, so the current position can be obtained with getXPos() Any opinion on those? Kind regards, Peter --- Paulo Soares psoa...@glintt.com 22.04.2010 00:57 Please respond to Post all your questions about iText here itext-questions@lists.sourceforge.net To Post all your questions about iText here itext-questions@lists.sourceforge.net cc Subject SPAM Re: [iText-questions] Where can I get the current horizontal positionwithin ColumnText/PDFWriter? Use a generic tag event. Paulo - Original Message - From: peter.henning...@wcenter.de To: itext-questions@lists.sourceforge.net Sent: Wednesday, April 21, 2010 12:33 PM Subject: [iText-questions] Where can I get the current horizontal positionwithin ColumnText/PDFWriter? Hello, I have to position an image-icon precisely at the end of a text-column (when the ColumnText has more text). The text is left-aligned, so the position of the last glyph varies horizontally. I get the vertical position with ct.getYLine(). But I have not found a similar way to find the horizontal position. The writer also seems to have only the vertical position? Kind regards, Peter -- ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/ -- ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
[iText-questions] re solution images indesign-server my implementation
Hi, I have a high resolution image that is 450x450 dpi and 3983x5524 pixels When adding this it a pdf with IText i use scalePercent(); I use 72 / 450 * 100 and it's 16% scale. When indesign does this the same image is 3912x5454 pixels 450x450 dpi. can anyone give me a hint on how to produce the same size? -- View this message in context: http://old.nabble.com/resolution-images-indesign-server-my-implementation-tp28326082p28326082.html Sent from the iText - General mailing list archive at Nabble.com. -- ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
Re: [iText-questions] performance follow up
Thank you. I'll include your changes. Paulo From: Giovanni Azua [brave...@gmail.com] Sent: Thursday, April 22, 2010 1:02 AM To: itext-questions@lists.sourceforge.net Subject: [iText-questions] performance follow up Hello, Good news ... after applying the attached patch to trunk and doing yet another performance experiment using the previously posted workload these are the results: BEFORE (trunk) MeanVariance 15.125 5.514 15.440 3.474 15.258 9.736 15.621 23.869 15.449 4.817 15.500 2.662 15.221 8.431 15.319 3.419 15.142 1.626 15.457 3.972 AFTER (trunk + patch) MeanVariance 14.404 5.928 14.487 16.781 14.132 1.618 14.314 3.174 14.663 7.522 14.542 15.086 14.283 6.924 14.399 2.064 14.205 1.609 14.471 2.761 The mean values look surprisingly much better than in the office. I'm running here Snow Leopard with JVM 1.6.0_19. Is iText with the patch better than before? The paired observation of the means are: {(15.125, 14.404), (15.440, 14.487), (15.258, 14.132), (15.621, 14.314), (15.449, 14.663), (15.500, 14.542), (15.221, 14.283), (15.319, 14.399), (15.142, 14.205), (15.457, 14.471)} The performance differences constitute a sample of 10 observations: {0.721, 0.953, 1.126, 1.307, 0.786, 0.958, 0.938, 0.92, 0.937, 0.986} For this sample: Sample mean = 0.9632 Sample variance = 0.02651 Sample standard Deviation = 0.16282 Confidence interval for the mean = 0.9632 +/- t*sqrt(0.02651/10) = 0.9632 +/- t*0.0514 The 0.95 quantile of a t-variate with df=N-1=10-1=9 is 1.833113 = 95% confidence interval = 0.9632 +/- 1.833113*0.0514 = [0.9632-0.09422,0.9632+0.09422] = [0.86898,1.05742] Since the confidence interval does NOT include zero we can conclude that the performance improvement is significative (patch is better than no patch) and will be approximately of (0.9632/15.3532)*100% = 6.2% I also ran the workload connected to the profiler and the number of StringBuffer instances decreased to 846'988 The Letter PDF looks good i.e. the patch didn't seem to break anything but you will have to run the unit tests on it. Best regards, Giovanni PS: There are still some StringBuffer around to fix ... Aviso Legal: Esta mensagem é destinada exclusivamente ao destinatário. Pode conter informação confidencial ou legalmente protegida. A incorrecta transmissão desta mensagem não significa a perca de confidencialidade. Se esta mensagem for recebida por engano, por favor envie-a de volta para o remetente e apague-a do seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de usar, revelar ou distribuir qualquer parte desta mensagem. Disclaimer: This message is destined exclusively to the intended receiver. It may contain confidential or legally protected information. The incorrect transmission of this message does not mean the loss of its confidentiality. If this message is received by mistake, please send it back to the sender and delete it from your system immediately. It is forbidden to any person who is not the intended receiver to use, distribute or copy any part of this message. -- ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
Re: [iText-questions] performance follow up
Cool, analysis is always a plus and easier to discuss than adjectives. Just a few rather trivial comments. Date: Thu, 22 Apr 2010 02:02:31 +0200 From: To: itext-questions@lists.sourceforge.net Subject: [iText-questions] performance follow up Hello, Good news ... after applying the attached patch to trunk and doing yet another performance experiment using the previously posted workload these are the results: [...] Is iText with the patch better than before? This of course is where you consult Mark Twain. LOL. iText is or isn't better than before ( for some particular use case) irrespective of the data you currently have but the question is does the data allow you to reject the conclusion that they are have the same execution times with some confidence level? Finding ways to explain or attribute the noise into somekind of model of course would be a reasonable thing to consider if you had a few more test cases with some relevant parameters( number of fonts you will need or something). The statistics are just a guide to help you infer something causal- in this case perhaps something like, did the patch cause itext to get better? as you suggested originally. If you can start describing where and how much it got better, response surfaces I guess, then of course you are starting to develop strategy logic, and could take a given task and feed it to the patched or non patched version ( among a new family of altnerative implementations) depending on the parameters you know about it- obviously for the cases you have only one decision makes sense andd off hand based on what you said about nature of patch I don't know of any case where generating gratuitous garbage is a good strategy LOL. The paired observation of the means are: At this stage it is usually helpful to look at the data, not just start dumping it into equations you found in a book. I'm not slamming you at all, just that its helpful to have a check on your analysis even if you are using something canned like Ror a commercial package, more so if you just wrote the analysis stuff today. Don't ignore things like histograms etc, after all my criticisms of PDF for its ability to obscure information with art, sometimes there are pictures worth a thousand words. And of course using the pictures to suggest various sanity checks you can write. The Letter PDF looks good i.e. the patch didn't seem to break anything but you will have to run the unit tests on it. LOL, often people forget this step. Also it sounds like the alt pacakage is still faster by a clinically significant amount- an amount relevant to someone. There may be more coding optimiztions or algorithmic optimizations. for example, converting a string to a byte array could have some benefits, hard to know off hand since that may incur more java code then native code to manipulate but something to consider in a more general case. With a byte array you may be able to avoid creating lots of temp string, just make an int table of the locations of new tokens or pass around indexes instead of temp token strings. etc etc _ The New Busy is not the old busy. Search, chat and e-mail from your inbox. http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_3 -- ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
[iText-questions] Python 2.5 wrapper for iTextSharp
hi, Maybe this has been answered before... Is there a Python wrapper for the iText DLL that allows me to issue iText(Sharp) calls, under Windows? I'm using Python 2.5 Thanks, Ignacio -- ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
Re: [iText-questions] PdfWriter.getPageNumber() is returning next page number when table ends at the end of page
I am using 2.1.3 version. Paulo Soares psoa...@glintt.com 04/21/2010 06:50 PM Please respond to Post all your questions about iText here itext-questions@lists.sourceforge.net To Post all your questions about iText here itext-questions@lists.sourceforge.net cc Subject Re: [iText-questions] PdfWriter.getPageNumber() is returning next page number when table ends at the end of page Are you using the latest release? Paulo - Original Message - From: suresh.chennup...@judiciary.state.nj.us To: itext-questions@lists.sourceforge.net Sent: Wednesday, April 21, 2010 5:49 PM Subject: [iText-questions] PdfWriter.getPageNumber() is returning next page number when table ends at the end of page I am trying to display mutiple tables in a single PDF and display page X of Y at the end of each page. X, Y should reset for every new table(Basically every new table should start with a new page.) Each table can vary and span accross multiple pages. I don't have problem while tables end in the middle of page(1 page of multiple pages). The problem comes when the table size matches page size. If a table size is approximately equal to page size. it displays page 1 of 2, when it has only one page. For tables ending in the middle of page, if it has 3 pages, page numbers are displayed correctly as 1 of 3 , 2 of 3 , 3 of 3. But when table size ends at the end of page, if there is 1 page, still it display 1 of 2. Please note, the number of data tables is dynamic . public class DocumentEventListener implements PdfPageEvent { PdfTemplate m_Template; BaseFont m_BaseFont; PdfContentByte m_Cb; public void onEndPage(PdfWriter writer, Document arg1) { try { final int page = writer.getPageNumber(); String text = Page + page; m_BaseFont = BaseFont.createFont(BaseFont.HELVETICA, BaseFont.CP1252, BaseFont.NOT_EMBEDDED); m_Cb = writer.getDirectContent(); if(m_Cb!=null){ m_Cb.beginText(); m_Cb.setFontAndSize(m_BaseFont, 8); m_Cb.showTextAligned(PdfContentByte.ALIGN_RIGHT,text,410,20,0); m_Cb.endText(); m_Cb.addTemplate(m_Template, 352.3f, 20); } } catch (DocumentException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } public void createNewTemplate(PdfWriter arg0){ m_Cb = arg0.getDirectContent(); m_Template = m_Cb.createTemplate(85,140); } public void fillOutTemplate(PdfWriter arg0) { try { // arg0.reorderPages(null); m_BaseFont = BaseFont.createFont(BaseFont.HELVETICA, BaseFont.CP1252, BaseFont.NOT_EMBEDDED); m_Template.beginText(); m_Template.setFontAndSize(m_BaseFont, 8); String text = of + (arg0.getPageNumber() ); m_Template.showTextAligned(PdfContentByte.ALIGN_LEFT, text, 65, 0, 0); m_Template.endText(); } catch (DocumentException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block++ e.printStackTrace(); } } } //Creating template for printing Page X of Y at the end of page ((DocumentEventListener) writer.getPageEvent()).createNewTemplate(writer); document.add(dataTableX); document.add(dataTableY); //Filling template for printing Page X of Y at the end of page ((DocumentEventListener) writer.getPageEvent()).fillOutTemplate(writer); Please let me know, if any one has faced similar problem before. Thanks Suresh Chennupati -- ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
Re: [iText-questions] re solution images indesign-server my implementation
never mind, the itext approach is correct. It is a 3 party that integrates with indesign-server så it must be some fit-in-block that makes this oddness. -- View this message in context: http://old.nabble.com/resolution-images-indesign-server-my-implementation-tp28326082p28327964.html Sent from the iText - General mailing list archive at Nabble.com. -- ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
Re: [iText-questions] PdfWriter.getPageNumber() is returning next page number when table ends at the end of page
What happens if you use the latest release 5.0.2? Paulo From: suresh.chennup...@judiciary.state.nj.us [suresh.chennup...@judiciary.state.nj.us] Sent: Thursday, April 22, 2010 12:58 PM To: Post all your questions about iText here Subject: Re: [iText-questions] PdfWriter.getPageNumber() is returning next page number when table ends at the end of page I am using 2.1.3 version. Paulo Soares psoa...@glintt.com 04/21/2010 06:50 PM Please respond to Post all your questions about iText here itext-questions@lists.sourceforge.net To Post all your questions about iText here itext-questions@lists.sourceforge.net cc Subject Re: [iText-questions] PdfWriter.getPageNumber() is returning next page number when table ends at the end of page Are you using the latest release? Paulo - Original Message - From: suresh.chennup...@judiciary.state.nj.usmailto:suresh.chennup...@judiciary.state.nj.us To: itext-questions@lists.sourceforge.netmailto:itext-questions@lists.sourceforge.net Sent: Wednesday, April 21, 2010 5:49 PM Subject: [iText-questions] PdfWriter.getPageNumber() is returning next page number when table ends at the end of page I am trying to display mutiple tables in a single PDF and display page X of Y at the end of each page. X, Y should reset for every new table(Basically every new table should start with a new page.) Each table can vary and span accross multiple pages. I don't have problem while tables end in the middle of page(1 page of multiple pages). The problem comes when the table size matches page size. If a table size is approximately equal to page size. it displays page 1 of 2, when it has only one page. For tables ending in the middle of page, if it has 3 pages, page numbers are displayed correctly as 1 of 3 , 2 of 3 , 3 of 3. But when table size ends at the end of page, if there is 1 page, still it display 1 of 2. Please note, the number of data tables is dynamic . public class DocumentEventListener implements PdfPageEvent { PdfTemplate m_Template; BaseFont m_BaseFont; PdfContentByte m_Cb; public void onEndPage(PdfWriter writer, Document arg1) { try { final int page = writer.getPageNumber(); String text = Page + page; m_BaseFont = BaseFont.createFont(BaseFont.HELVETICA, BaseFont.CP1252, BaseFont.NOT_EMBEDDED); m_Cb = writer.getDirectContent(); if(m_Cb!=null){ m_Cb.beginText(); m_Cb.setFontAndSize(m_BaseFont, 8); m_Cb.showTextAligned(PdfContentByte.ALIGN_RIGHT,text,410,20,0); m_Cb.endText(); m_Cb.addTemplate(m_Template, 352.3f, 20); } } catch (DocumentException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } public void createNewTemplate(PdfWriter arg0){ m_Cb = arg0.getDirectContent(); m_Template = m_Cb.createTemplate(85,140); } public void fillOutTemplate(PdfWriter arg0) { try { // arg0.reorderPages(null); m_BaseFont = BaseFont.createFont(BaseFont.HELVETICA, BaseFont.CP1252, BaseFont.NOT_EMBEDDED); m_Template.beginText(); m_Template.setFontAndSize(m_BaseFont, 8); String text = of + (arg0.getPageNumber() ); m_Template.showTextAligned(PdfContentByte.ALIGN_LEFT, text, 65, 0, 0); m_Template.endText(); } catch (DocumentException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block++ e.printStackTrace(); } } } //Creating template for printing Page X of Y at the end of page ((DocumentEventListener) writer.getPageEvent()).createNewTemplate(writer); document.add(dataTableX); document.add(dataTableY); //Filling template for printing Page X of Y at the end of page ((DocumentEventListener) writer.getPageEvent()).fillOutTemplate(writer); Please let me know, if any one has faced similar problem before. Thanks Suresh
[iText-questions] problem with rounded corners
Hi, I have problems with rounded corners. If I use the cb directly here and don't create a Pdftemplate everythings works fine with the rounded corners but if the background I set every block in my page will get them. cell.setCellEvent( new PdfPCellEvent(){ public void cellLayout(PdfPCell cell, Rectangle rect,PdfContentByte[] canvas) { // Here I have tried to just add it to the PdfContentByte but then every block // is the color of the last block. I've tried cb.saveState() and restoreState() but without luck PdfContentByte cb = canvas[PdfPTable.LINECANVAS]; PdfTemplate template = cb.createTemplate( rect.getWidth() , rect.getHeight()); if( getBorder() != null ){ template.setLineWidth( MeasurementUtil.millimetersToPostscriptPoints( getBorder().getThickness()) ); template.setColorStroke( getPage().getPdfDocument().getColors().get( getBorder().getColorReference() )); } if( getBackgroundReference() != null ){ template.setColorFill( getPage().getPdfDocument().getColors().get( getBackgroundReference() )); } template.roundRectangle(0 , 0, rect.getWidth() ,rect.getHeight() , MeasurementUtil.millimetersToPostscriptPoints( getRadius() )); if( getBackgroundReference() != null || getBorder() != null ){ if( getBackgroundReference() != null getBorder() != null ){ template.fillStroke(); }else if( getBackgroundReference() != null ){ template.fill(); }else{ template.stroke(); } } cb.addTemplate( template, rect.getLeft(), rect.getBottom()); }}); -- View this message in context: http://old.nabble.com/problem-with-rounded-corners-tp28328340p28328340.html Sent from the iText - General mailing list archive at Nabble.com. -- ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
Re: [iText-questions] What action is requred in terms of License
On Wed, Apr 21, 2010 at 10:17 AM, Paulo Soares psoa...@glintt.com wrote: If you're using it in an intranet you don't have to do anything. If you're exposing the service to the exterior either you provide the source code of your application or you buy a commercial license. ... What does intranet mean in this context? Is a license required if the Web application is restricted to faculty in a particular department of a particular university [my speculation: that is an intranet, and the license requires nothing further]? What if such a faculty member reaches the departmental application from a Web browser at his home off-campus [my speculation: that is *not* an intranet, and source-code-or-license is required]? What if the departmental application is open to academic collaborators who might potentially be based anywhere in the (IP-connected) world [my speculation: that is even less of an intranet, and source-code-or-license is required--but it's really not very commercial, as the purpose is only to promote academic research]? Thank you, Paulo, for your help in these matters. -- ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
Re: [iText-questions] What action is requred in terms of License
The intranet I was referring to was in a company where it's only accessed by the employees. In an University the same would apply for faculty members but not for students or faculty members from other Universities. Paulo From: Cameron Laird [claird.visipr...@gmail.com] Sent: Thursday, April 22, 2010 1:45 PM To: Post all your questions about iText here Subject: Re: [iText-questions] What action is requred in terms of License On Wed, Apr 21, 2010 at 10:17 AM, Paulo Soares psoa...@glintt.commailto:psoa...@glintt.com wrote: If you're using it in an intranet you don't have to do anything. If you're exposing the service to the exterior either you provide the source code of your application or you buy a commercial license. ... What does intranet mean in this context? Is a license required if the Web application is restricted to faculty in a particular department of a particular university [my speculation: that is an intranet, and the license requires nothing further]? What if such a faculty member reaches the departmental application from a Web browser at his home off-campus [my speculation: that is *not* an intranet, and source-code-or-license is required]? What if the departmental application is open to academic collaborators who might potentially be based anywhere in the (IP-connected) world [my speculation: that is even less of an intranet, and source-code-or-license is required--but it's really not very commercial, as the purpose is only to promote academic research]? Thank you, Paulo, for your help in these matters. Aviso Legal: Esta mensagem é destinada exclusivamente ao destinatário. Pode conter informação confidencial ou legalmente protegida. A incorrecta transmissão desta mensagem não significa a perca de confidencialidade. Se esta mensagem for recebida por engano, por favor envie-a de volta para o remetente e apague-a do seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de usar, revelar ou distribuir qualquer parte desta mensagem. Disclaimer: This message is destined exclusively to the intended receiver. It may contain confidential or legally protected information. The incorrect transmission of this message does not mean the loss of its confidentiality. If this message is received by mistake, please send it back to the sender and delete it from your system immediately. It is forbidden to any person who is not the intended receiver to use, distribute or copy any part of this message. -- ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
Re: [iText-questions] What action is requred in terms of License
In our case, we will have a Websphere running on the server side with iText 5 jar file, our intranet employees will use browsers to view and print the pdf files generated by the iText, then send the printed the document to external users. Do we need a commercial license in this case? Many thanks! Tao From: Paulo Soares [mailto:psoa...@glintt.com] Sent: April 22, 2010 9:08 AM To: Post all your questions about iText here Subject: Re: [iText-questions] What action is requred in terms of License The intranet I was referring to was in a company where it's only accessed by the employees. In an University the same would apply for faculty members but not for students or faculty members from other Universities. Paulo From: Cameron Laird [claird.visipr...@gmail.com] Sent: Thursday, April 22, 2010 1:45 PM To: Post all your questions about iText here Subject: Re: [iText-questions] What action is requred in terms of License On Wed, Apr 21, 2010 at 10:17 AM, Paulo Soares psoa...@glintt.com wrote: If you're using it in an intranet you don't have to do anything. If you're exposing the service to the exterior either you provide the source code of your application or you buy a commercial license. ... What does intranet mean in this context? Is a license required if the Web application is restricted to faculty in a particular department of a particular university [my speculation: that is an intranet, and the license requires nothing further]? What if such a faculty member reaches the departmental application from a Web browser at his home off-campus [my speculation: that is *not* an intranet, and source-code-or-license is required]? What if the departmental application is open to academic collaborators who might potentially be based anywhere in the (IP-connected) world [my speculation: that is even less of an intranet, and source-code-or-license is required--but it's really not very commercial, as the purpose is only to promote academic research]? Thank you, Paulo, for your help in these matters. Aviso Legal: Esta mensagem é destinada exclusivamente ao destinatário. Pode conter informação confidencial ou legalmente protegida. A incorrecta transmissão desta mensagem não significa a perca de confidencialidade. Se esta mensagem for recebida por engano, por favor envie-a de volta para o remetente e apague-a do seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de usar, revelar ou distribuir qualquer parte desta mensagem. Disclaimer: This message is destined exclusively to the intended receiver. It may contain confidential or legally protected information. The incorrect transmission of this message does not mean the loss of its confidentiality. If this message is received by mistake, please send it back to the sender and delete it from your system immediately. It is forbidden to any person who is not the intended receiver to use, distribute or copy any part of this message. -- ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
Re: [iText-questions] What action is requred in terms of License
If it's all done in the intranet by the employees you won't need a license, what you do afterwards with the PDFs is irrelevant. If you expose the service to the internet, even if it has a restricted access only for employees, than you'll need a license as the potential access is universal. By the way, I'm not a lawyer nor an employee of itextsoftware so, this is my, not legal binding, opinion. Doubts with so many questions should be addressed to itextsoftware and your company's lawyer. Paulo From: Lu, Tao (MOH) [tao...@ontario.ca] Sent: Thursday, April 22, 2010 2:43 PM To: Post all your questions about iText here Subject: Re: [iText-questions] What action is requred in terms of License In our case, we will have a Websphere running on the server side with iText 5 jar file, our intranet employees will use browsers to view and print the pdf files generated by the iText, then send the printed the document to external users. Do we need a commercial license in this case? Many thanks! Tao From: Paulo Soares [mailto:psoa...@glintt.com] Sent: April 22, 2010 9:08 AM To: Post all your questions about iText here Subject: Re: [iText-questions] What action is requred in terms of License The intranet I was referring to was in a company where it's only accessed by the employees. In an University the same would apply for faculty members but not for students or faculty members from other Universities. Paulo From: Cameron Laird [claird.visipr...@gmail.com] Sent: Thursday, April 22, 2010 1:45 PM To: Post all your questions about iText here Subject: Re: [iText-questions] What action is requred in terms of License On Wed, Apr 21, 2010 at 10:17 AM, Paulo Soares psoa...@glintt.commailto:psoa...@glintt.com wrote: If you're using it in an intranet you don't have to do anything. If you're exposing the service to the exterior either you provide the source code of your application or you buy a commercial license. ... What does intranet mean in this context? Is a license required if the Web application is restricted to faculty in a particular department of a particular university [my speculation: that is an intranet, and the license requires nothing further]? What if such a faculty member reaches the departmental application from a Web browser at his home off-campus [my speculation: that is *not* an intranet, and source-code-or-license is required]? What if the departmental application is open to academic collaborators who might potentially be based anywhere in the (IP-connected) world [my speculation: that is even less of an intranet, and source-code-or-license is required--but it's really not very commercial, as the purpose is only to promote academic research]? Thank you, Paulo, for your help in these matters. Aviso Legal: Esta mensagem é destinada exclusivamente ao destinatário. Pode conter informação confidencial ou legalmente protegida. A incorrecta transmissão desta mensagem não significa a perca de confidencialidade. Se esta mensagem for recebida por engano, por favor envie-a de volta para o remetente e apague-a do seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de usar, revelar ou distribuir qualquer parte desta mensagem. Disclaimer: This message is destined exclusively to the intended receiver. It may contain confidential or legally protected information. The incorrect transmission of this message does not mean the loss of its confidentiality. If this message is received by mistake, please send it back to the sender and delete it from your system immediately. It is forbidden to any person who is not the intended receiver to use, distribute or copy any part of this message. Aviso Legal: Esta mensagem é destinada exclusivamente ao destinatário. Pode conter informação confidencial ou legalmente protegida. A incorrecta transmissão desta mensagem não significa a perca de confidencialidade. Se esta mensagem for recebida por engano, por favor envie-a de volta para o remetente e apague-a do seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de usar, revelar ou distribuir qualquer parte desta mensagem. Disclaimer: This message is destined exclusively to the intended receiver. It may contain confidential or legally protected information. The incorrect transmission of this message does not mean the loss of its confidentiality. If this message is received by mistake, please send it back to the sender and delete it from your system immediately. It is forbidden to any person who is not the intended receiver to use, distribute or copy any part of this message. -- ___ iText-questions mailing list iText-questions@lists.sourceforge.net
Re: [iText-questions] PdfWriter.getPageNumber() is returning next page number when table ends at the end of page
We have portal environment setup using jdk1.4, so i cannot upgrade to latest release 5.0.2 Please let me know if there is any other alternative... Paulo Soares psoa...@glintt.com 04/22/2010 08:07 AM Please respond to Post all your questions about iText here itext-questions@lists.sourceforge.net To Post all your questions about iText here itext-questions@lists.sourceforge.net cc Subject Re: [iText-questions] PdfWriter.getPageNumber() is returningnext page number when table ends at the end of page What happens if you use the latest release 5.0.2? Paulo From: suresh.chennup...@judiciary.state.nj.us [suresh.chennup...@judiciary.state.nj.us] Sent: Thursday, April 22, 2010 12:58 PM To: Post all your questions about iText here Subject: Re: [iText-questions] PdfWriter.getPageNumber() is returning next page number when table ends at the end of page I am using 2.1.3 version. Paulo Soares psoa...@glintt.com 04/21/2010 06:50 PM Please respond to Post all your questions about iText here itext-questions@lists.sourceforge.net To Post all your questions about iText here itext-questions@lists.sourceforge.net cc Subject Re: [iText-questions] PdfWriter.getPageNumber() is returning next page number when table ends at the end of page Are you using the latest release? Paulo - Original Message - From: suresh.chennup...@judiciary.state.nj.us To: itext-questions@lists.sourceforge.net Sent: Wednesday, April 21, 2010 5:49 PM Subject: [iText-questions] PdfWriter.getPageNumber() is returning next page number when table ends at the end of page I am trying to display mutiple tables in a single PDF and display page X of Y at the end of each page. X, Y should reset for every new table(Basically every new table should start with a new page.) Each table can vary and span accross multiple pages. I don't have problem while tables end in the middle of page(1 page of multiple pages). The problem comes when the table size matches page size. If a table size is approximately equal to page size. it displays page 1 of 2, when it has only one page. For tables ending in the middle of page, if it has 3 pages, page numbers are displayed correctly as 1 of 3 , 2 of 3 , 3 of 3. But when table size ends at the end of page, if there is 1 page, still it display 1 of 2. Please note, the number of data tables is dynamic . public class DocumentEventListener implements PdfPageEvent { PdfTemplate m_Template; BaseFont m_BaseFont; PdfContentByte m_Cb; public void onEndPage(PdfWriter writer, Document arg1) { try { final int page = writer.getPageNumber(); String text = Page + page; m_BaseFont = BaseFont.createFont(BaseFont.HELVETICA, BaseFont.CP1252, BaseFont.NOT_EMBEDDED); m_Cb = writer.getDirectContent(); if(m_Cb!=null){ m_Cb.beginText(); m_Cb.setFontAndSize(m_BaseFont, 8); m_Cb.showTextAligned(PdfContentByte.ALIGN_RIGHT,text,410,20,0); m_Cb.endText(); m_Cb.addTemplate(m_Template, 352.3f, 20); } } catch (DocumentException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } public void createNewTemplate(PdfWriter arg0){ m_Cb = arg0.getDirectContent(); m_Template = m_Cb.createTemplate(85,140); } public void fillOutTemplate(PdfWriter arg0) { try { // arg0.reorderPages(null); m_BaseFont = BaseFont.createFont(BaseFont.HELVETICA, BaseFont.CP1252, BaseFont.NOT_EMBEDDED); m_Template.beginText(); m_Template.setFontAndSize(m_BaseFont, 8); String text = of + (arg0.getPageNumber() ); m_Template.showTextAligned(PdfContentByte.ALIGN_LEFT, text, 65, 0, 0); m_Template.endText(); } catch (DocumentException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block++ e.printStackTrace(); } } } //Creating template for printing Page X of Y at the end of page ((DocumentEventListener) writer.getPageEvent()).createNewTemplate(writer); document.add(dataTableX);
Re: [iText-questions] problem with rounded corners
can anyone give me some pointer on why PdfTemplate.roundRectangle() doesn't make fine edges as PdfContentByte does? -- View this message in context: http://old.nabble.com/problem-with-rounded-corners-tp28328340p28329580.html Sent from the iText - General mailing list archive at Nabble.com. -- ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
Re: [iText-questions] PdfWriter.getPageNumber() is returning next page number when table ends at the end of page
You should at least try 2.1.7. If that doesn't work you are on your own unless you buy a license and support from itextsoftware. The mailing list only gives support to the latest release. Paulo From: suresh.chennup...@judiciary.state.nj.us [suresh.chennup...@judiciary.state.nj.us] Sent: Thursday, April 22, 2010 3:14 PM To: Post all your questions about iText here Subject: Re: [iText-questions] PdfWriter.getPageNumber() is returning next page number when table ends at the end of page We have portal environment setup using jdk1.4, so i cannot upgrade to latest release 5.0.2 Please let me know if there is any other alternative... Paulo Soares psoa...@glintt.com 04/22/2010 08:07 AM Please respond to Post all your questions about iText here itext-questions@lists.sourceforge.net To Post all your questions about iText here itext-questions@lists.sourceforge.net cc Subject Re: [iText-questions] PdfWriter.getPageNumber() is returning nextpage number when table ends at the end of page What happens if you use the latest release 5.0.2? Paulo From: suresh.chennup...@judiciary.state.nj.us [suresh.chennup...@judiciary.state.nj.us] Sent: Thursday, April 22, 2010 12:58 PM To: Post all your questions about iText here Subject: Re: [iText-questions] PdfWriter.getPageNumber() is returning next page number when table ends at the end of page I am using 2.1.3 version. Paulo Soares psoa...@glintt.com 04/21/2010 06:50 PM Please respond to Post all your questions about iText here itext-questions@lists.sourceforge.net To Post all your questions about iText here itext-questions@lists.sourceforge.net cc Subject Re: [iText-questions] PdfWriter.getPageNumber() is returning next page number when table ends at the end of page Are you using the latest release? Paulo - Original Message - From: suresh.chennup...@judiciary.state.nj.usmailto:suresh.chennup...@judiciary.state.nj.us To: itext-questions@lists.sourceforge.netmailto:itext-questions@lists.sourceforge.net Sent: Wednesday, April 21, 2010 5:49 PM Subject: [iText-questions] PdfWriter.getPageNumber() is returning next page number when table ends at the end of page I am trying to display mutiple tables in a single PDF and display page X of Y at the end of each page. X, Y should reset for every new table(Basically every new table should start with a new page.) Each table can vary and span accross multiple pages. I don't have problem while tables end in the middle of page(1 page of multiple pages). The problem comes when the table size matches page size. If a table size is approximately equal to page size. it displays page 1 of 2, when it has only one page. For tables ending in the middle of page, if it has 3 pages, page numbers are displayed correctly as 1 of 3 , 2 of 3 , 3 of 3. But when table size ends at the end of page, if there is 1 page, still it display 1 of 2. Please note, the number of data tables is dynamic . public class DocumentEventListener implements PdfPageEvent { PdfTemplate m_Template; BaseFont m_BaseFont; PdfContentByte m_Cb; public void onEndPage(PdfWriter writer, Document arg1) { try { final int page = writer.getPageNumber(); String text = Page + page; m_BaseFont = BaseFont.createFont(BaseFont.HELVETICA, BaseFont.CP1252, BaseFont.NOT_EMBEDDED); m_Cb = writer.getDirectContent(); if(m_Cb!=null){ m_Cb.beginText(); m_Cb.setFontAndSize(m_BaseFont, 8); m_Cb.showTextAligned(PdfContentByte.ALIGN_RIGHT,text,410,20,0); m_Cb.endText(); m_Cb.addTemplate(m_Template, 352.3f, 20); } } catch (DocumentException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } public void createNewTemplate(PdfWriter arg0){ m_Cb = arg0.getDirectContent(); m_Template = m_Cb.createTemplate(85,140); } public void fillOutTemplate(PdfWriter arg0) { try { // arg0.reorderPages(null); m_BaseFont = BaseFont.createFont(BaseFont.HELVETICA, BaseFont.CP1252, BaseFont.NOT_EMBEDDED); m_Template.beginText(); m_Template.setFontAndSize(m_BaseFont, 8); String text = of + (arg0.getPageNumber() ); m_Template.showTextAligned(PdfContentByte.ALIGN_LEFT, text, 65, 0, 0);
Re: [iText-questions] problem with rounded corners
PdfTemplate extends PdfContentByte, there's no reason why the results shouldn't be the same. It would be helpful to see a pdf with those differences. Paulo From: Mathias Nilsson [wicket.program...@gmail.com] Sent: Thursday, April 22, 2010 3:22 PM To: itext-questions@lists.sourceforge.net Subject: Re: [iText-questions] problem with rounded corners can anyone give me some pointer on why PdfTemplate.roundRectangle() doesn't make fine edges as PdfContentByte does? -- View this message in context: http://old.nabble.com/problem-with-rounded-corners-tp28328340p28329580.html Sent from the iText - General mailing list archive at Nabble.com. -- ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/ Aviso Legal: Esta mensagem é destinada exclusivamente ao destinatário. Pode conter informação confidencial ou legalmente protegida. A incorrecta transmissão desta mensagem não significa a perca de confidencialidade. Se esta mensagem for recebida por engano, por favor envie-a de volta para o remetente e apague-a do seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de usar, revelar ou distribuir qualquer parte desta mensagem. Disclaimer: This message is destined exclusively to the intended receiver. It may contain confidential or legally protected information. The incorrect transmission of this message does not mean the loss of its confidentiality. If this message is received by mistake, please send it back to the sender and delete it from your system immediately. It is forbidden to any person who is not the intended receiver to use, distribute or copy any part of this message. -- ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
Re: [iText-questions] Mergin pdfs
I've modified your code a bit and have a question. I have a single page pdf with a form (attached as rider_release.pdf). In my database, I have 100's of entrants (first name, last name, etc..), each of which, need to be completed on the form in the rider_release file. I am trying to take the original document, open it, and while looping through my entrants, populate the form and concatenate to the previous page. So, in the end, I will end up with a 100+ page pdf, each page containing the same page with the exception of the form data. I've attached the concatenatedPDF file so you can reference my output from the code below. Notice how all pages are empty. The first page still retained the form, while the other two pages did not. Please help when you have time. // begin code public static void main(String[] args) { try { Document document = null; PdfCopy writer = null; // original document (release form for bike riders) PdfReader reader = new PdfReader(c:/temp/rider_release.pdf); reader.consolidateNamedDestinations(); document = new Document(reader.getPageSizeWithRotation(1)); // my result document of all race waivers concatented writer = new PdfCopy(document, new FileOutputStream(c:/temp/concatenatedPDF.pdf)); writer.setViewerPreferences(PdfWriter.PageModeUseOutlines); document.open(); // simulate looping through 3 bike riders int i = 0; while (i++ 3) { reader = new PdfReader(c:/temp/rider_release.pdf); reader.consolidateNamedDestinations(); ByteArrayOutputStream baosPDF = new ByteArrayOutputStream(); // the only way to change the form is with a stamper...? PdfStamper stamper = new PdfStamper(reader, baosPDF); AcroFields form = stamper.getAcroFields(); form.setField(Phone, 402-555-1212); form.setField(EMail, jdhank...@cox.net); form.setField(TODAYS DATE, 4/20/2010); form.setField(Emergency Contact, Stephanie Mattoon); form.setField(RACESACTIVITYIES ENTERED, Men's Open (CAT1)); form.setField(City, Omaha); form.setField(Name, Justin Hankins); form.setField(State, Nebraska); form.setField(ANNUAL LICENSE, 123456789); form.setField(Address, 1620 North 51st); form.setField(Emergency Contact Phone, 402-555-0558); form.setField(EVENT DATES, 5/1/2010); form.setField(RACING AGE as of December 31 2009, 40); form.setField(Age, 40); form.setField(CLUBTEAM NAME, The Wild Hares); form.setField(Zip, 68104); form.setField(ChildName, Justin); form.setField(EVENT NAME, Swanson River City Shootout); PdfImportedPage page = writer.getImportedPage(reader, 1); writer.addPage(page); writer.freeReader(reader); } document.close(); } catch (Exception e) { e.printStackTrace(); } } // end code http://old.nabble.com/file/p28328599/concatenatedPDF.pdf concatenatedPDF.pdf http://old.nabble.com/file/p28328599/rider_release.pdf rider_release.pdf -- View this message in context: http://old.nabble.com/Mergin-pdfs-tp25058642p28328599.html Sent from the iText - General mailing list archive at Nabble.com. -- ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
Re: [iText-questions] problem with rounded corners
Hi, Yes I'm sure that there is something in my code making this but I can't find it. I have now managed to remove the sharp edges to smoth but with very odd settings. I must create a round rectangle twice to make it work. @Override public void onRender( PdfContentByte cb ) throws PdfDocumentException{ float width = MeasurementUtil.millimetersToPostscriptPoints( getWidth()); float height = MeasurementUtil.millimetersToPostscriptPoints( getHeight() ); float left = getLeft(); float top = getTop(); if( getPage().getPdfDocument().getCutMark() != null ){ left += getPage().getPdfDocument().getCutMark().getWidth(); top -= getPage().getPdfDocument().getCutMark().getHeight(); } PdfTemplate tp = cb.createTemplate(width, height); tp.roundRectangle(0, 0, width, height, MeasurementUtil.millimetersToPostscriptPoints( getRadius() )); cb.addTemplate(tp, MeasurementUtil.millimetersToPostscriptPoints( left ), MeasurementUtil.millimetersToPostscriptPoints( getPage().getPdfDocument().getHeight() - ( top + getHeight(; ColumnText ct = new ColumnText( cb ); ct.setSimpleColumn( MeasurementUtil.millimetersToPostscriptPoints( left ), MeasurementUtil.millimetersToPostscriptPoints( getPage().getPdfDocument().getHeight() - ( top + getHeight())), MeasurementUtil.millimetersToPostscriptPoints( left + getWidth() ), MeasurementUtil.millimetersToPostscriptPoints( getPage().getPdfDocument().getHeight() - top ), 0, Element.ALIGN_LEFT ); PdfPTable table = new PdfPTable(1); table.setTotalWidth(MeasurementUtil.millimetersToPostscriptPoints(getWidth())); table.setLockedWidth( true ); table.setSpacingBefore(0); table.setSpacingAfter(0); PdfPCell cell = new PdfPCell(); cell.setBorderWidth( 0 ); cell.setVerticalAlignment( getVerticalAlign().getAlignment() ); cell.setLeft(0); cell.setTop(0); cell.setRight( 0 ); cell.setBottom( 0 ); if( isUseAscender() != null ) cell.setUseAscender( isUseAscender() ); cell.setIndent(0); cell.setPaddingLeft( MeasurementUtil.millimetersToPostscriptPoints(marginLeft) ); cell.setPaddingBottom( MeasurementUtil.millimetersToPostscriptPoints(marginBottom) ); cell.setPaddingRight( MeasurementUtil.millimetersToPostscriptPoints(marginRight) ); cell.setPaddingTop( MeasurementUtil.millimetersToPostscriptPoints(marginTop) ); cell.setFixedHeight(MeasurementUtil.millimetersToPostscriptPoints(getHeight() )); cell.setBorder( 0 ); cell.setCellEvent( new PdfPCellEvent(){ public void cellLayout(PdfPCell cell, Rectangle rect,PdfContentByte[] canvas) { PdfContentByte cb = canvas[PdfPTable.LINECANVAS]; PdfTemplate template = cb.createTemplate( rect.getWidth() , rect.getHeight()); // HERE. If I remove this there will be no color template.roundRectangle(0, 0, rect.getWidth() ,rect.getHeight() , MeasurementUtil.millimetersToPostscriptPoints( getRadius() )); template.clip(); template.newPath(); if( getBackgroundReference() != null ){ template.setColorFill( getPage().getPdfDocument().getColors().get( getBackgroundReference() )); } if( getBorder() != null ){ template.setLineWidth( MeasurementUtil.millimetersToPostscriptPoints( getBorder().getThickness()) ); template.setColorStroke( getPage().getPdfDocument().getColors().get( getBorder().getColorReference() )); } template.roundRectangle(0, 0, rect.getWidth() ,rect.getHeight() , MeasurementUtil.millimetersToPostscriptPoints( getRadius() )); if( getBackgroundReference() != null || getBorder() != null ){ if( getBackgroundReference() != null getBorder() != null ){ template.fillStroke(); }else if( getBackgroundReference() != null ){ template.fill(); }else{ template.stroke(); } } cb.addTemplate( template, rect.getLeft(), rect.getBottom()); } }); if( getRotation() != null ) cell.setRotation( getRotation() ); if( ! paragraphs.isEmpty() ){ for( AbstractParagraph paragraph : paragraphs ){ paragraph.onRender( cell ); } }else{ // Need to make this otherwise the block wont show com.lowagie.text.Paragraph pr = new com.lowagie.text.Paragraph(); Chunk chunk = new Chunk(); pr.add( chunk ); cell.addElement( pr ); } table.addCell(cell); ct.addElement( table ); try { ct.go(); } catch (DocumentException e) { throw new PdfDocumentException( e ); } } -- View this message in context: http://old.nabble.com/problem-with-rounded-corners-tp28328340p28330366.html Sent from the iText - General mailing list archive at Nabble.com. -- ___ iText-questions mailing list
Re: [iText-questions] Mergin pdfs
jdhankins wrote: I've modified your code a bit and have a question. What code? You didn't read the most documentation. I've attached the concatenatedPDF file so you can reference my output from the code below. Notice how all pages are empty. The first page still retained the form, while the other two pages did not. Do you want to keep the form? If not, you should flatten the fields, and then use PdfSmartCopy instead of PdfCopy. Do you want to keep the form? Then you need to rename the fields for every page, and then use PdfCopyFields instead of PdfCopy. Please look at the examples of chapter 6 and chapter 8 of the second edition of iText in Action. -- This answer is provided by 1T3XT BVBA http://www.1t3xt.com/ - http://www.1t3xt.info -- ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
Re: [iText-questions] Python 2.5 wrapper for iTextSharp
Ignacio.ruizdeconejo wrote: hi, Maybe this has been answered before... Is there a Python wrapper for the iText DLL that allows me to issue iText(Sharp) calls, under Windows? I'm using Python 2.5 I don't think there are many Python users on the list. Sorry... -- This answer is provided by 1T3XT BVBA http://www.1t3xt.com/ - http://www.1t3xt.info -- ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
Re: [iText-questions] Layers question
Paulo Soares wrote: That's too much code. If a standalone example is provided, one that I can run without having to change anything, then I want to take a look at it as soon as I have the time, which is: not before next Sunday. -- This answer is provided by 1T3XT BVBA http://www.1t3xt.com/ - http://www.1t3xt.info -- ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
Re: [iText-questions] What action is requred in terms of License
David Hoffer wrote: No, versions prior to 5.x had the more friendly license. Nuance: more friendly for people who want to write even more unfriendly code. The license is still friendly for people who write software as friendly as iText. -- This answer is provided by 1T3XT BVBA http://www.1t3xt.com/ - http://www.1t3xt.info -- ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
Re: [iText-questions] Python 2.5 wrapper for iTextSharp
Use IronPython and iTextSharp. No wrappers needed. -Original Message- From: 1T3XT info [mailto:i...@1t3xt.info] Sent: Thursday, April 22, 2010 12:04 PM To: Post all your questions about iText here Subject: Re: [iText-questions] Python 2.5 wrapper for iTextSharp Ignacio.ruizdeconejo wrote: hi, Maybe this has been answered before... Is there a Python wrapper for the iText DLL that allows me to issue iText(Sharp) calls, under Windows? I'm using Python 2.5 I don't think there are many Python users on the list. Sorry... -- This answer is provided by 1T3XT BVBA http://www.1t3xt.com/ - http://www.1t3xt.info -- ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/ -- ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
Re: [iText-questions] What action is requred in terms of License
If you're making money from iText -- with making money being defined as somebody is paying you -- you should pay for it. There's a lot of hard work that went into the creation and support of this awesome tool. The licensing scheme they have for v. 5.0 is already incredibly generous; too generous IMO. Bruno and the team deserve to be paid for their work. If you're a University or not-for-profit or a start-up tell them: I'm sure they'll work out licensing arrangements that work within reasonable constraints; they don't want to put anybody out of business. Michael. On Thu, Apr 22, 2010 at 12:12 PM, 1T3XT info i...@1t3xt.info wrote: David Hoffer wrote: No, versions prior to 5.x had the more friendly license. Nuance: more friendly for people who want to write even more unfriendly code. The license is still friendly for people who write software as friendly as iText. -- This answer is provided by 1T3XT BVBA http://www.1t3xt.com/ - http://www.1t3xt.info -- ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/ -- ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
Re: [iText-questions] What action is requred in terms of License
Michael Olenick wrote: If you're making money from iText -- with making money being defined as somebody is paying you -- you should pay for it. There's a lot of hard work that went into the creation and support of this awesome tool. Thanks! best regards, Bruno -- ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
Re: [iText-questions] Where can I get the current horizontal positionwithin ColumnText/PDFWriter?
peter.henning...@wcenter.de wrote: I see two other options to implement the desired functionality: - put code into ColumnText.go() to generate an event whenever the column if full or the text ends. Then pass the current position in that event object - change ColumnText, so the current position can be obtained with getXPos() After reading the initial question, I interpreted it the same way as Paulo. Reading your follow-up, I see that generic tags probably won't help: you don't know in advance where the column will split. I've looked at the code very briefly (I'm sorry, I really don't have much time this week), but maybe the method writeLineToContent in PdfDocument should return an X value that can be captured by ColumnText. What you need is PdfLine.getLeft() + PdfLine.GetLineLengthUtf32() of the last line that is added. However, if there is glue in the line, or if the line is justified, the method writeLineToContent will add extra spacing. Post a reply to the list if you don't have the time to look at this before Sunday. Maybe I'll find some time to work something out then, or you can share your experience if this (very premature) suggestion leads nowhere (in which case, I'll have to think of another way to achieve what you need). -- This answer is provided by 1T3XT BVBA http://www.1t3xt.com/ - http://www.1t3xt.info -- ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
Re: [iText-questions] What action is requred in terms of License
Hey, I'm not saying they shouldn't be able to make money from this product. But I take issue with making money being defined as somebody is paying you. I thought making money was defined as what's left over after expenses. The cost is too high for small projects. Only the U.S. Government can make the economics of spending more than your income work out somehow :) -Dave On Thu, Apr 22, 2010 at 10:30 AM, Bruno Lowagie br...@lowagie.com wrote: Michael Olenick wrote: If you're making money from iText -- with making money being defined as somebody is paying you -- you should pay for it. There's a lot of hard work that went into the creation and support of this awesome tool. Thanks! best regards, Bruno -- ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/ -- ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
Re: [iText-questions] performance follow up
Paulo Soares wrote: Thank you. I'll include your changes. Due to the lack of time, I wasn't able to follow the discussion, but I've just read the latest mails, and I also want to thank you for the performance tests and improvements. -- This answer is provided by 1T3XT BVBA http://www.1t3xt.com/ - http://www.1t3xt.info -- ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
Re: [iText-questions] What action is requred in terms of License
Then tell them what the project is and what you can afford. Seriously -- that applies for all software components. If you're working for a Fortune 1000 call the person who licenses software and ask them to work something out. If you're working for a smaller company, or on your own, know that if you talk to virtually any software company they'll work within your budget constraints, as long as those constraints are reasonable. That's not just the itext licensing partner but Oracle, Microsoft, IBM ... as long as you're not BS'ing them they'll all work with you. They want you to do well so that you use their product in bigger projects, or pay them more as you grow. They make nothing if they demand fees you can't pay and don't use their product(s). Since the incremental cost for software is virtually zero there's little to lose and lots to gain once you're locked-in. [Conversely, for the younger engineers here, be careful who you lock-in with ... divorces in software are worse than divorces in real life.] Michael. On Thu, Apr 22, 2010 at 12:48 PM, David Hoffer dhoff...@gmail.com wrote: Hey, I'm not saying they shouldn't be able to make money from this product. But I take issue with making money being defined as somebody is paying you. I thought making money was defined as what's left over after expenses. The cost is too high for small projects. Only the U.S. Government can make the economics of spending more than your income work out somehow :) -Dave On Thu, Apr 22, 2010 at 10:30 AM, Bruno Lowagie br...@lowagie.com wrote: Michael Olenick wrote: If you're making money from iText -- with making money being defined as somebody is paying you -- you should pay for it. There's a lot of hard work that went into the creation and support of this awesome tool. Thanks! best regards, Bruno -- ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/ -- ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/ -- ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
Re: [iText-questions] What action is requred in terms of License
2010/4/22 Bruno Lowagie br...@lowagie.com Michael Olenick wrote: If you're making money from iText -- with making money being defined as somebody is paying you -- you should pay for it. There's a lot of hard work that went into the creation and support of this awesome tool. Thanks! best regards, Bruno That's very interessting: I am working both in research at an university and within a small startup (spin off) from the university. The software projects are closed source freeware and closed source commercial software with a share of about 50% each. I requested information about obtaining a commercial license and I was pretty astonished: The license fees were magnitudes beyond the complete project budgets with very strict obligations. I am really willing to obtain a license and to pay several 100 $ for it and I find it absolutely ok for the developers to earn money with their fantastic library. But: The current license fees are affordable for big industries only. I already thought about stopping to use iText or to stick with 2.1.7. After all,within my programms this is only a small component for generating reports in order to show the results of computation processes. I think, there are a lot of small projects and developers who are in the same situation. If there is another way, I would appreciate this very much, and as I said: I really like your lib and I am really willing to pay for it. But I can't invest 150% of the whole budgets on the reporting component only, and I am not willing to report the number of distribution number several times a year. Have you ever thought about single developer licenses with no fees for redistribution? Bye, Michael -- ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
Re: [iText-questions] performance follow up
Hello, On Apr 22, 2010, at 6:49 PM, 1T3XT info wrote: Paulo Soares wrote: Thank you. I'll include your changes. Due to the lack of time, I wasn't able to follow the discussion, but I've just read the latest mails, and I also want to thank you for the performance tests and improvements. No problem! I am happy to help .. it is a win-win :) The currently established commercial PDF solution I was comparing iText against is fast yes and with a lot of imagination and some compromises somehow you manage to achieve the use-case that you need but the design shortcomings and bugs it has are countless plus the huge risks because of their close code. But this is of course my personal opinion, and not the bank policy :) I might propose some more patches, it would be great to get the performance numbers at least as good as the commercial solution ... 23.8% response time difference still to go. Would this list be the right place for proposing new patches or is there a dedicated list for development? Best regards, Giovanni -- ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
Re: [iText-questions] performance follow up
Post in this list, that way it won't be lost. Paulo - Original Message - From: Giovanni Azua To: Post all your questions about iText here Sent: Thursday, April 22, 2010 8:38 PM Subject: Re: [iText-questions] performance follow up Hello, On Apr 22, 2010, at 6:49 PM, 1T3XT info wrote: Paulo Soares wrote: Thank you. I'll include your changes. Due to the lack of time, I wasn't able to follow the discussion, but I've just read the latest mails, and I also want to thank you for the performance tests and improvements. No problem! I am happy to help .. it is a win-win :) The currently established commercial PDF solution I was comparing iText against is fast yes and with a lot of imagination and some compromises somehow you manage to achieve the use-case that you need but the design shortcomings and bugs it has are countless plus the huge risks because of their close code. But this is of course my personal opinion, and not the bank policy :) I might propose some more patches, it would be great to get the performance numbers at least as good as the commercial solution ... 23.8% response time difference still to go. Would this list be the right place for proposing new patches or is there a dedicated list for development? Best regards, Giovanni -- ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/-- ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
Re: [iText-questions] What action is requred in terms of License
Hi, The license fees were magnitudes beyond the complete project budgets with very strict obligations. I am really willing to obtain a license and to pay several 100 $ for it and I find it absolutely ok for the developers to earn money with their fantastic library. But: The current license fees are affordable for big industries only. I already thought about stopping to use iText or to stick with 2.1.7. After all,within my programms this is only a small component for generating reports in order to show the results of computation processes. I think, there are a lot of small projects and developers who are in the same situation. If there is another way, I would appreciate this very much, and as I said: I really like your lib and I am really willing to pay for it. But I can't invest 150% of the whole budgets on the reporting component only, and I am not willing to report the number of distribution number several times a year. Have you ever thought about single developer licenses with no fees for redistribution? That's an interesting topic. Just being curious: What's the amount to pay for a commercial iText license? We had the same problem and decided to fork iText 2.1.7. We are also heavily working on that base trying to refactor all these bad little things out of the code and applying additional fixes. I would happily pay some money to get a lib and support but with the currently non-existent professional support for iText asking for money does not represent the state of the project at least to me. Just my 2c, Campus -- ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
Re: [iText-questions] What action is requred in terms of License
Hi Michael, I feel your pain, I am in similar situation. The commercial side of the licensing is geared for very big projects only, nothing small. I had no choice but to use 2.x and FOP will be next if I need more. Again I don't need free but I need something manageable. -Dave On Thu, Apr 22, 2010 at 12:58 PM, Michael Schmodt michael.schm...@googlemail.com wrote: 2010/4/22 Bruno Lowagie br...@lowagie.com Michael Olenick wrote: If you're making money from iText -- with making money being defined as somebody is paying you -- you should pay for it. There's a lot of hard work that went into the creation and support of this awesome tool. Thanks! best regards, Bruno That's very interessting: I am working both in research at an university and within a small startup (spin off) from the university. The software projects are closed source freeware and closed source commercial software with a share of about 50% each. I requested information about obtaining a commercial license and I was pretty astonished: The license fees were magnitudes beyond the complete project budgets with very strict obligations. I am really willing to obtain a license and to pay several 100 $ for it and I find it absolutely ok for the developers to earn money with their fantastic library. But: The current license fees are affordable for big industries only. I already thought about stopping to use iText or to stick with 2.1.7. After all,within my programms this is only a small component for generating reports in order to show the results of computation processes. I think, there are a lot of small projects and developers who are in the same situation. If there is another way, I would appreciate this very much, and as I said: I really like your lib and I am really willing to pay for it. But I can't invest 150% of the whole budgets on the reporting component only, and I am not willing to report the number of distribution number several times a year. Have you ever thought about single developer licenses with no fees for redistribution? Bye, Michael -- ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/ -- ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
Re: [iText-questions] performance follow up
Hello Mike, On Apr 22, 2010, at 12:22 PM, Mike Marchywka wrote: This of course is where you consult Mark Twain. LOL. iText is or isn't better than before ( for some particular use case) irrespective of the data you currently have but the question is does the data allow you to reject the conclusion that they are have the same execution times with some confidence level? Good, this is exactly what I meant :) Finding ways to explain or attribute the noise into some kind of model of course would be a reasonable thing to consider if you had a few more test cases with some relevant parameters( number of fonts you will need or something). The performance comparison is based on the representative test case exactly as business wants it. As far as I know we need only two fonts: light and bold. So the number of fonts is not a parameter. the parameters you know about it- obviously for the cases you have only one decision makes sense andd off hand based on what you said about nature of patch I don't know of any case where generating gratuitous garbage is a good strategy LOL. I know ... but hypothetically my patch could have well fixed the generating gratuitous garbage while the use-case still be slow i.e. my point being to make sure and prove that the patch delivers the promised performance gain. The paired observation of the means are: At this stage it is usually helpful to look at the data, not just start dumping it into equations you found in a book. This book is the official reference for the course in Advance System Performance Analysis I am taking for my graduate CS Master program in the top-10 Technology University of the world ... so no, it is not just equations I found in a book :) If you need to compare the performance of two systems and you have paired observations, this is the recipe you want to use. I'm not slamming you at all, just that its helpful to have a check on your analysis even if you No worries, I am actually very happy with your feedback. I would actually like to thank you for your insights. Also it sounds like the alt pacakage is still faster by a clinically significant amount- an amount relevant to someone. Now only 23.8% to go. We only need to make 4 more fixes like the last one and the gap will be gone :) The Profiler shows there are still several bottlenecks topping which could also be easy fixes e.g. PRTokeniser.isWhitespace is a simple boolean condition that just happen to be called gazillion times e.g. 35'622'000 times for my test workload ... if instead of doing it like: public static final boolean isWhitespace(int ch) { return (ch == 0 || ch == 9 || ch == 10 || ch == 12 || ch == 13 || ch == 32); } we used a bitwise binary operator with the appropriate mask(s), there could be some good performance gain ... Best regards, Giovanni-- ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
Re: [iText-questions] performance follow up
I like your approach! A simple if (ch 32) return false; at the very top would give the most bang for the least effort (if you do go the bitmask route, be sure to include unit tests!). I know there were a lot of calls to this method, but I'm curious: in your pofiling, how much of the total processing _time_ was spent in that routine? The if() would make this 6 times faster, but it's hard to believe that this call has any appreciable contribution to runtime. Keep it up! - K Giovanni Azua-2 wrote: Now only 23.8% to go. We only need to make 4 more fixes like the last one and the gap will be gone :) The Profiler shows there are still several bottlenecks topping which could also be easy fixes e.g. PRTokeniser.isWhitespace is a simple boolean condition that just happen to be called gazillion times e.g. 35'622'000 times for my test workload ... if instead of doing it like: public static final boolean isWhitespace(int ch) { return (ch == 0 || ch == 9 || ch == 10 || ch == 12 || ch == 13 || ch == 32); } we used a bitwise binary operator with the appropriate mask(s), there could be some good performance gain ... Best regards, Giovanni -- ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/ -- View this message in context: http://old.nabble.com/performance-follow-up-tp28322800p28334733.html Sent from the iText - General mailing list archive at Nabble.com. -- ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
Re: [iText-questions] performance follow up
Hello, On Apr 22, 2010, at 10:59 PM, Giovanni Azua wrote: PRTokeniser.isWhitespace is a simple boolean condition that just happen to be called gazillion times e.g. 35'622'000 times for my test workload ... if instead of doing it like: public static final boolean isWhitespace(int ch) { return (ch == 0 || ch == 9 || ch == 10 || ch == 12 || ch == 13 || ch == 32); } we used a bitwise binary operator with the appropriate mask(s), there could be some good performance gain ... The function already exists in http://java.sun.com/javase/6/docs/api/java/lang/Character.html#isWhitespace%28char%29 I checked and it already uses bitwise binary operators with the right masks ... we would only need to inline it to avoid the function call costs. Best regards, Giovanni-- ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
Re: [iText-questions] performance follow up
The semantics are different (the JSE call includes more characters in it's definition of whitespace than the PDF spec). Not saying that it can't be easily done, but throwing an if statement at it and seeing what impact it has on performance is pretty easy also. What was the overall time %age spent in this call in your tests? Giovanni Azua-2 wrote: Hello, On Apr 22, 2010, at 10:59 PM, Giovanni Azua wrote: PRTokeniser.isWhitespace is a simple boolean condition that just happen to be called gazillion times e.g. 35'622'000 times for my test workload ... if instead of doing it like: public static final boolean isWhitespace(int ch) { return (ch == 0 || ch == 9 || ch == 10 || ch == 12 || ch == 13 || ch == 32); } we used a bitwise binary operator with the appropriate mask(s), there could be some good performance gain ... The function already exists in http://java.sun.com/javase/6/docs/api/java/lang/Character.html#isWhitespace%28char%29 I checked and it already uses bitwise binary operators with the right masks ... we would only need to inline it to avoid the function call costs. Best regards, Giovanni -- ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/ -- View this message in context: http://old.nabble.com/performance-follow-up-tp28322800p28334828.html Sent from the iText - General mailing list archive at Nabble.com. -- ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
Re: [iText-questions] performance follow up
From: brave...@gmail.com Date: Thu, 22 Apr 2010 23:22:36 +0200 To: brave...@gmail.com CC: itext-questions@lists.sourceforge.net Subject: Re: [iText-questions] performance follow up Hello, On Apr 22, 2010, at 10:59 PM, Giovanni Azua wrote: PRTokeniser.isWhitespace is a simple boolean condition that just happen to be called gazillion times e.g. 35'622'000 times for my test workload ... if instead of doing it like: public static final boolean isWhitespace(int ch) { return (ch == 0 || ch == 9 || ch == 10 || ch == 12 || ch == 13 || ch == 32); } does this have to be int vs char or byte? I think earlier I suggested operating on byte[] instead of making a bunch of temp strings but I don't know the context well enough to know if this makes sense. Certainly demorgan can help but casts and calls are not free either. Also, maybe hotspot runtime has gotten better but I have found in the past that look up tables can quickly become competititve with bit operators ( if your param is byte instead of int, a 256 entry table can tell you if the byte is a member of which classes). we used a bitwise binary operator with the appropriate mask(s), there could be some good performance gain ... The function already exists in http://java.sun.com/javase/6/docs/api/java/lang/Character.html#isWhitespace%28char%29 I checked and it already uses bitwise binary operators with the right masks ... we would only need to inline it to avoid the function call costs. Best regards, Giovanni _ Hotmail is redefining busy with tools for the New Busy. Get more from your inbox. http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_2 -- ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
Re: [iText-questions] performance follow up
FYI I already use a table to map the char to the result for the delimiter testing and the speed improvement was zero in relation to plain comparisons. Paulo - Original Message - From: trumpetinc To: itext-questions@lists.sourceforge.net Sent: Thursday, April 22, 2010 10:30 PM Subject: Re: [iText-questions] performance follow up The semantics are different (the JSE call includes more characters in it's definition of whitespace than the PDF spec). Not saying that it can't be easily done, but throwing an if statement at it and seeing what impact it has on performance is pretty easy also. What was the overall time %age spent in this call in your tests? Giovanni Azua-2 wrote: Hello, On Apr 22, 2010, at 10:59 PM, Giovanni Azua wrote: PRTokeniser.isWhitespace is a simple boolean condition that just happen to be called gazillion times e.g. 35'622'000 times for my test workload ... if instead of doing it like: public static final boolean isWhitespace(int ch) { return (ch == 0 || ch == 9 || ch == 10 || ch == 12 || ch == 13 || ch == 32); } we used a bitwise binary operator with the appropriate mask(s), there could be some good performance gain ... The function already exists in http://java.sun.com/javase/6/docs/api/java/lang/Character.html#isWhitespace%28char%29 I checked and it already uses bitwise binary operators with the right masks ... we would only need to inline it to avoid the function call costs. Best regards, Giovanni -- ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/ -- View this message in context: http://old.nabble.com/performance-follow-up-tp28322800p28334828.html Sent from the iText - General mailing list archive at Nabble.com. -- ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/-- ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
Re: [iText-questions] performance follow up
Hello, On Apr 22, 2010, at 11:30 PM, trumpetinc wrote: The semantics are different (the JSE call includes more characters in it's definition of whitespace than the PDF spec). Not saying that it can't be easily done, but throwing an if statement at it and seeing what impact it has on performance is pretty easy also. I will try your suggestion too ... What was the overall time %age spent in this call in your tests? Total 10 seconds that accounts for 1% ... 1% is not much but how the Swiss people use to say who does not care about the cents, do not deserve the francs or something like that :) Best regards, Giovanni -- ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
Re: [iText-questions] performance follow up
From: Date: Thu, 22 Apr 2010 22:59:43 +0200 To: itext-questions@lists.sourceforge.net Subject: Re: [iText-questions] performance follow up Hello Mike, On Apr 22, 2010, at 12:22 PM, Mike Marchywka wrote: This of course is where you consult Mark Twain. LOL. iText is or isn't better than before ( for some particular use case) irrespective of the data you currently have but the question is does the data allow you to reject the conclusion that they are have the same execution times with some confidence level? Good, this is exactly what I meant :) Finding ways to explain or attribute the noise into some kind of model of course would be a reasonable thing to consider if you had a few more test cases with some relevant parameters( number of fonts you will need or something). The performance comparison is based on the representative test case exactly as business wants it. Yes, I know, I'm simply pointing out this is part of a bigger issue that may or may not be relevant to itext but in general is something to consider for long tasks. For example, maybe see FFTW. As far as I know we need only two fonts: light and bold. So the number of fonts is not a parameter. I made that up as a simple strawman. If you make a model for execution time given some parameters that are important, you can pick a specific implementation that you expect to be faster. Again a bit of an extrapolation to make your stats analysis more worthwhile. This book is the official reference for the course in Advance System Performance Analysis I am taking for my graduate CS Master program in the top-10 Technology University of the world ... so no, it is not just equations I found in a book :) LOL, you need to see Allen Greedspan interview, may have been on CNBC or 60 minutes talking about financial models essentially saying he didn't understand them but bright PhD's were doing it so it must be right. The punchline is appeal to authority or credentials when a factual argument is more ala point. This in fact is how Mark Twain gets to the front so quickly. Again, I'm not suggesting you did anything wrong or bad, I haven't actually checked numbers or given the specific test a lot of thought- 9 data points is usually not all that conclusive in any case and I guess that's my point. Presumably you could keep measuring each case with and without patch and slowly ( sqrt N) get better estimate of average execution times. Then, end up with 9 data points that are difference in execution time for each case with/without patch and asymptoticallty measure arbitrarily small differences. However, it may be more helpful to look at pictures like histograms or at least run various assumption checks. You may have non-normal distros and those shapes can tell you something about causes, not always but it helps to look before taking one result and running with it. Now only 23.8% to go. We only need to make 4 more fixes like the last one and the gap will be gone :) The Profiler shows there are still I wouldn't count on the other one being the final solution to pdf creation. Do you have symbols info or can you profile it at all? _ The New Busy is not the old busy. Search, chat and e-mail from your inbox. http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_3 -- ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/