[iText-questions] RE: spacing between paragraphs
I've some changes to the Paragraph and PdfDocument code in it seems to work. Is there a set of JUnit tests I can execute to verify everything is still ok? In the meantime, I have created a new RFE and I have uploaded the changed files over there. You can find them at http://sourceforge.net/tracker/index.php?func=detail&aid=913453&group_id=15255&atid=365255 thanks, Maarten Paulo Soares wrote: If only thing were that easy... Currently the paragraph processing is a can of worms, change something here and something else will break. If you do the code changes we'll consider it's inclusion. Best Regards, Paulo Soares -Original Message- From: itext-questions-admin lists.sourceforge.net [mailto:itext-questions-admin lists.sourceforge.net] On Behalf Of Maarten Coene Sent: Tuesday, March 09, 2004 12:53 PM To: itext-questions lists.sourceforge.net Subject: [iText-questions] spacing between paragraphs Hi, Is it possible to extend the Paragraph API to allow users to define some empty spacing before and after a paragraph. I know this can be done by adding an empty paragraph with some leading before and after the normal paragraph, but it's not always that easy. For instance, I have a method addParagraph like this: public void addParagraph(Document doc, String text) { Paragraph p = new Paragraph(text); doc.add(p); } If I now add an empty paragraph everytime I add a normal paragraph, I could by accident let the next page start with an empty line if the empty paragraph doesn't fit on the current page anymore. Or even worse, I could by accident add an empty page to the document if the normal paragraph was the last paragraph of the document and was placed at the bottom of the last page. Also simulating spacing before a paragraph begins by adding empty paragraphs can give similar problems: I don't want a page to start with an empty line, so if the page starts with a paragraph, the 'before spacing' of that paragraph should be ignored. I think I can solve this myself if I could access the currentHeight property of the PdfDocument class and use it to check if adding spacing before/after a paragraph is appropriate. Unfortunately, the currentHeight property is private and there is no way to retrieve it. Are there other alternatives to to solve my problem ? I've seen some similar requests here on the mailinglist, so maybe it would be nice if such methods could be added to the Paragraph API ?? Should I post a feature request at sourceforge, or doesn't it has a chance to get accepted? thanks, Maarten Coene --- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click ___ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions
Re: [iText-questions] PDF documents created by iText 1.02b doesn't look as good as with 1.00
Hi, JFreeChart was indeed adding some opaque lines to the chart. After removing these lines, the PDF documents looked fine. Thanks! Maarten --- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click ___ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions
[iText-questions] spacing between paragraphs
Hi, Is it possible to extend the Paragraph API to allow users to define some empty spacing before and after a paragraph. I know this can be done by adding an empty paragraph with some leading before and after the normal paragraph, but it's not always that easy. For instance, I have a method addParagraph like this: public void addParagraph(Document doc, String text) { Paragraph p = new Paragraph(text); doc.add(p); } If I now add an empty paragraph everytime I add a normal paragraph, I could by accident let the next page start with an empty line if the empty paragraph doesn't fit on the current page anymore. Or even worse, I could by accident add an empty page to the document if the normal paragraph was the last paragraph of the document and was placed at the bottom of the last page. Also simulating spacing before a paragraph begins by adding empty paragraphs can give similar problems: I don't want a page to start with an empty line, so if the page starts with a paragraph, the 'before spacing' of that paragraph should be ignored. I think I can solve this myself if I could access the currentHeight property of the PdfDocument class and use it to check if adding spacing before/after a paragraph is appropriate. Unfortunately, the currentHeight property is private and there is no way to retrieve it. Are there other alternatives to to solve my problem ? I've seen some similar requests here on the mailinglist, so maybe it would be nice if such methods could be added to the Paragraph API ?? Should I post a feature request at sourceforge, or doesn't it has a chance to get accepted? thanks, Maarten Coene --- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click ___ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions
Re: [iText-questions] PDF documents created by iText 1.02b doesn't look as good as with 1.00
Hi, thanks for your help :-) I still have some problems with these generated PDF's: - is this opacity something of iText, or is it the responsability of JFreeChart and can I put it off with the iText API ? - I can't find a way to make these 2 PDF's look the same with Acrobat Reader 6 (however, they look the same with Acrobat Reader 5 !!!) Is it a specific setting within the reader I have to change, or can I change some PDF settings with the iText API to accomplish this? thanks, Maarten Paulo Soares wrote: There's nothing wrong. Only the text "serie 0" is really text, the other is composed of strokes (this is JfreeChart responsibility). The version 1.02b supports alpha blending in strokes. However, when opacity is present the viewer switches off line smoothing, That's why you see the text more blurred but if you magnify it you'll see that it's the same in both cases. Best Regards, Paulo Soares - Original Message - From: "Maarten Coene" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, March 05, 2004 15:54 Subject: [iText-questions] PDF documents created by iText 1.02b doesn't look as good as with 1.00 Hi, I have a PDF document with a chart in it. The chart is generated by JFreeChart and is added to the document with the code below. With iText version 1.00, the resulting PDF looks excelent, but with iText 1.02b, the chart in the generated PDF doesn't look as good as with version 1.00 . More in specific, the displayed font in 1.02b is not as sharp as in version 1.00 . I've put 2 generated PDF documents here: with iText 1.00: http://www.qmedit.com/temp/chart-1.00.pdf with iText 1.02b: http://www.qmedit.com/temp/chart-1.02b.pdf any idea what could be wrong ? thanks, Maarten Here is the piece of code that adds the JFreeChart: Document doc = ...; JFreeChart chart = ...; DefaultFontMapper mapper = new DefaultFontMapper(); PdfContentByte cb = writer.getDirectContent(); PdfTemplate tp = cb.createTemplate(width, height); Graphics2D g2 = tp.createGraphics(width, height, mapper); Rectangle2D r2D = new Rectangle2D.Float(0, 0, width, height); chart.draw(g2, r2D); g2.dispose(); Image img = Image.getInstance(tp); /* * we put the graph in a table so it is automatically placed on * a new page if it doesn't fit on the current one */ PdfPTable graphTable = new PdfPTable(1); graphTable.setWidthPercentage(100); PdfPCell cell = new PdfPCell(img); cell.setBorderWidth(0); graphTable.addCell(cell); graphTable.setHorizontalAlignment(Element.ALIGN_LEFT); doc.add(graphTable); --- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click ___ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions
[iText-questions] PDF documents created by iText 1.02b doesn't look as good as with 1.00
Hi, I have a PDF document with a chart in it. The chart is generated by JFreeChart and is added to the document with the code below. With iText version 1.00, the resulting PDF looks excelent, but with iText 1.02b, the chart in the generated PDF doesn't look as good as with version 1.00 . More in specific, the displayed font in 1.02b is not as sharp as in version 1.00 . I've put 2 generated PDF documents here: with iText 1.00: http://www.qmedit.com/temp/chart-1.00.pdf with iText 1.02b: http://www.qmedit.com/temp/chart-1.02b.pdf any idea what could be wrong ? thanks, Maarten Here is the piece of code that adds the JFreeChart: Document doc = ...; JFreeChart chart = ...; DefaultFontMapper mapper = new DefaultFontMapper(); PdfContentByte cb = writer.getDirectContent(); PdfTemplate tp = cb.createTemplate(width, height); Graphics2D g2 = tp.createGraphics(width, height, mapper); Rectangle2D r2D = new Rectangle2D.Float(0, 0, width, height); chart.draw(g2, r2D); g2.dispose(); Image img = Image.getInstance(tp); /* * we put the graph in a table so it is automatically placed on * a new page if it doesn't fit on the current one */ PdfPTable graphTable = new PdfPTable(1); graphTable.setWidthPercentage(100); PdfPCell cell = new PdfPCell(img); cell.setBorderWidth(0); graphTable.addCell(cell); graphTable.setHorizontalAlignment(Element.ALIGN_LEFT); doc.add(graphTable); --- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click ___ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions