Re: FOP Font Configuration in Linux
The fonts on a linux box are usually found at /usr/share/fonts. Most distros have a package for the MS fonts (ttf-mscorefonts or somesuch) though I don't see it on my SUSE default supplier :( You might get away with copying the files named in your config directly into /usr/share/fonts/truetype directory. On 10/11/2010 04:30 AM, pathum wrote: Hello, I am using Apache FOP for rendering PDF in a Java environment. Currently I am running my Enterprise Archive in a windows pc and its working fine. What I am having as the error is, the unicode.ttf file and the unicode.xml file are being hard-coded in windows. an extraction of my FO-config file is as follows. base./base strict-configurationtrue/strict-configuration strict-validationtrue/strict-validation font-base.//font-base source-resolution72/source-resolution target-resolution72/target-resolution default-page-settings height=11in width=8.26in/ renderers renderer mime=application/pdf filterList valueflate/value /filterList fonts font-triplet name=arialunicode style=normal weight=normal / /fonts What my concern is that, I need to migrate this to linux environment and in that how could i set up the base, metrics path and the embed url? Any help will be really appreciated! - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: FOP Font Configuration in Linux
I can't speak to the use of auto-detect, but you either need to generalize the font choise (sanserif?) or ensure arial is available where ever you run your app. On 10/11/2010 08:44 PM, pathum wrote: Then do you want me to activate auto-detect/ feature to load the fonts? So no need of embedding the font afterwords or do I still need to put the xml file and the ttf file paths to the fo config file? If so, what will be the correct path format in linux? Really appreciate your help! Rob Sargent-4 wrote: The fonts on a linux box are usually found at /usr/share/fonts. Most distros have a package for the MS fonts (ttf-mscorefonts or somesuch) though I don't see it on my SUSE default supplier :( You might get away with copying the files named in your config directly into /usr/share/fonts/truetype directory. On 10/11/2010 04:30 AM, pathum wrote: Hello, I am using Apache FOP for rendering PDF in a Java environment. Currently I am running my Enterprise Archive in a windows pc and its working fine. What I am having as the error is, the unicode.ttf file and the unicode.xml file are being hard-coded in windows. an extraction of my FO-config file is as follows. base./base strict-configurationtrue/strict-configuration strict-validationtrue/strict-validation font-base.//font-base source-resolution72/source-resolution target-resolution72/target-resolution default-page-settings height=11in width=8.26in/ renderers renderer mime=application/pdf filterList valueflate/value /filterList fonts font-triplet name=arialunicode style=normal weight=normal / /fonts What my concern is that, I need to migrate this to linux environment and in that how could i set up the base, metrics path and the embed url? Any help will be really appreciated! - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: overflow of fixed block-container
Haven't cracked rev 1.0 yet but maybe it the top container was the entirety of the region body and the same page-master is in effect the text would show in a similarly place box on the next page. (Nothing will ever get to the other boxes tho.) On 10/20/2010 05:30 PM, Russell Levy wrote: Hi, I have a simple document with three block-containers, each with a fixed position on the page, aligned horizontally (page split into three parts). When the top block-container overflows, I want the overflow to go to a new page (with the other two areas of the page blank). Is that possible? I could post code if that's helpful. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
switching column-count
Is it possible to change the column count within a single flow with each new simple-page master? fo:page-sequence-master master-name=document-sequence !-- one column region-body -- fo:single-page-master-reference master-reference=chapter-open / !-- two column region-body -- fo:single-page-master-reference master-reference=all-text-page-2 / !-- one column region-body -- fo:single-page-master-reference master-reference=three-side-page-3 / !-- two column region-body -- fo:single-page-master-reference master-reference=table-page-4 / !-- two column region-body -- fo:single-page-master-reference master-reference=table-page-5 / !-- one column region-body -- fo:single-page-master-reference master-reference=three-side-page-6 / /fo:page-sequence-master master-name=document-sequence - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: switching column-count
Using fop-0.95. Can move forward if needed. On 11/14/2010 12:31 PM, Rob Sargent wrote: Is it possible to change the column count within a single flow with each new simple-page master? fo:page-sequence-master master-name=document-sequence !-- one column region-body -- fo:single-page-master-reference master-reference=chapter-open / !-- two column region-body -- fo:single-page-master-reference master-reference=all-text-page-2 / !-- one column region-body -- fo:single-page-master-reference master-reference=three-side-page-3 / !-- two column region-body -- fo:single-page-master-reference master-reference=table-page-4 / !-- two column region-body -- fo:single-page-master-reference master-reference=table-page-5 / !-- one column region-body -- fo:single-page-master-reference master-reference=three-side-page-6 / /fo:page-sequence-master master-name=document-sequence - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: switching column-count
Yes, thanks for the confirmation Vincent. How much interest do you feel there would be for such support? Level of difficulty? Pointers? Interestingly, it is almost implemented. One does see two columns on the second page in my example, it's just that they're the width as defined in the opening one-column layout. Btw, I've mananged to get a mix by having the opening 1-column in a 'block span=all' trick posted elsewhere, then a one column of width = width of one-of-two-columns. Seems to be working... On 11/18/2010 05:04 AM, Vincent Hennebert wrote: Hi Rob, While in theory it’s possible to use page masters with different column counts, in practice it’s not supported by FOP yet. Sorry, Vincent On 14/11/10 19:32, Rob Sargent wrote: Using fop-0.95. Can move forward if needed. On 11/14/2010 12:31 PM, Rob Sargent wrote: Is it possible to change the column count within a single flow with each new simple-page master? fo:page-sequence-master master-name=document-sequence !-- one column region-body -- fo:single-page-master-reference master-reference=chapter-open / !-- two column region-body -- fo:single-page-master-reference master-reference=all-text-page-2 / !-- one column region-body -- fo:single-page-master-reference master-reference=three-side-page-3 / !-- two column region-body -- fo:single-page-master-reference master-reference=table-page-4 / !-- two column region-body -- fo:single-page-master-reference master-reference=table-page-5 / !-- one column region-body -- fo:single-page-master-reference master-reference=three-side-page-6 / /fo:page-sequence-master master-name=document-sequence - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
static content ignored
Using fop-0.95, I appear to lose a region-before for a particular page layout. The headers appear on other pages. Here are snippets from the fop.xml file generated on the way to pdf. fo:layout-master-set ... other masters ... fo:simple-page-master page-width=8.5in page-height=11in master-name=three-side-page-3 margin=0.0in 0.75in 0.375in 0.833in fo:region-body margin-right=3.6585in margin-top=0.6in column-count=1 / fo:region-before extent=0.50in name=default-left-header / fo:region-end overflow=hidden extent=3.2585in region-name=three-side-images-3 / /fo:simple-page-master ... /fo:simple-page-master fo:page-sequence-master initial-page-number=1 master-name=document-sequence fo:single-page-master-reference master-reference=chapter-open / fo:single-page-master-reference master-reference=two-up-page-2 / fo:single-page-master-reference master-reference=three-side-page-3 / fo:single-page-master-reference master-reference=all-text-page-4 / ... /fo:page-sequence-master ... begin filling statics ... fo:static-content flow-name=default-left-header fo:block background-color=silver height=0.50in line-height=0.50in text-indent=18ptrjs--/fo:block /fo:static-content But only this style of particular page master (three-side) refuses to render the content of the region before. Happens if I place an instance of this style on the right also. The headers (left and right) appear fine on other page layouts. If anyone can spot the flaw, please shout. rjs - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: static content ignored
Undoubtedly. Thanks a ton. Even though I tried to track down the waring attribute name ignored, there are just too many valid name= places. A forest and tree problem. On 11/19/2010 03:21 AM, Peter Hancock wrote: Hi Rob, fo:region-body margin-right=3.6585in margin-top=0.6in column-count=1 / fo:region-before extent=0.50in name=default-left-header / This should be region-name I believe? fo:region-end overflow=hidden extent=3.2585in Pete - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: switching column-count
Vincent, hello. Naturally disappointed but not at all surprised this would fall in the hard category or it certainly would have been taken care of by now I'm sure. I would like to report that I'm having good luck with inter-mixing one- and two-column layouts, again under the provisio that the single column with matches the two column. For local reasons, I'm not using the span = 'all' trick but it did work well even if the text required more space than was available on the first page. I'm sorry to report that the combination of useful progress being made here and the suggested level of difficulty precludes me getting a green light to tackle the problem right now. Cheers, rjs On 11/22/2010 12:40 PM, Vincent Hennebert wrote: Hi Rob, On 18/11/10 15:22, Rob Sargent wrote: Yes, thanks for the confirmation Vincent. How much interest do you feel there would be for such support? Level of difficulty? Pointers? You’re hitting the infamous “changing IPD problem”: FOP is not able to handle pages of different widths. And changing the column count implies a change of the width according to which text must be broken into lines. FOP 1.0 contains a hack that provides limited support for different page widths, but this doesn’t include the change of column counts. There is an interest in fully supporting this. The level of difficult is hard. Search for “Changing IPD” in archives of the fop-dev mailing list for some pointers. This also involves understanding Dr Donald E. Knuth’ approach to typography based on dynamic programming. Mainly, his article “Breaking Paragraphs Into Lines”. There is some information about the Knuth algorithm on the FOP wiki: http://wiki.apache.org/xmlgraphics-fop/DeveloperPages Interestingly, it is almost implemented. One does see two columns on the second page in my example, it's just that they're the width as defined in the opening one-column layout. Btw, I've mananged to get a mix by having the opening 1-column in a 'block span=all' trick posted elsewhere, then a one column of width = width of one-of-two-columns. Seems to be working... If you are able to determine, prior to rendering, the amount of content that will fit on the first page, then this is a good workaround. On 11/18/2010 05:04 AM, Vincent Hennebert wrote: Hi Rob, While in theory it’s possible to use page masters with different column counts, in practice it’s not supported by FOP yet. Sorry, Vincent On 14/11/10 19:32, Rob Sargent wrote: Using fop-0.95. Can move forward if needed. On 11/14/2010 12:31 PM, Rob Sargent wrote: Is it possible to change the column count within a single flow with each new simple-page master? fo:page-sequence-master master-name=document-sequence !-- one column region-body -- fo:single-page-master-reference master-reference=chapter-open / !-- two column region-body -- fo:single-page-master-reference master-reference=all-text-page-2 / !-- one column region-body -- fo:single-page-master-reference master-reference=three-side-page-3 / !-- two column region-body -- fo:single-page-master-reference master-reference=table-page-4 / !-- two column region-body -- fo:single-page-master-reference master-reference=table-page-5 / !-- one column region-body -- fo:single-page-master-reference master-reference=three-side-page-6 / /fo:page-sequence-master master-name=document-sequence Vincent - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: FOP embedded in Java app not rendering graphics
Your java app can find the files in either a supplied jar (if they're that static) as a resource or in some relative dir from current working directory or in some named dir defined on the command-line or in the environment On 12/21/2010 10:49 AM, Furst, Tom wrote: No, did not look for WARNING. Believe I looked for graphic. I have somewhat resolved this, but not what I would call the ideal solution. It appears to me that I have some sort of URI resolver issue. In the stylesheet I changed all the relative uri's to absolute URI's, and I now have all of my graphics. Problem being, the absolute address I have here will more than likely not be the same at my end users desk. I'm kinda lost as to how or what I need to modify. -Original Message- From: John Brown [mailto:johnbrown...@hotmail.com] Sent: Tuesday, December 21, 2010 12:31 PM To: fop-users@xmlgraphics.apache.org Subject: Re: FOP embedded in Java app not rendering graphics Furst, Tom tom.furst at rcmt.com writes: Forgot the attachment. Here it is. Chris, There a number of warnings, but none that relate missing images. There are *36* occurrences of Image not found in your log file, such as: SEVERE: Image not found. URI: illustrations/KH-Logo-large1.jpg. (No context info available) How could you say that none of the warnings relate to missing images? Let me guess: you grepped WARNING and you did not find these because they are SEVERE. Now that you have reported your problem accurately, I am sure that an expert will be able to help you in short order. Until then, I believe that the problem is that your fo:external-graphic tag should look like this: fo:external-graphic src=url(path/to/image/jpg) blah-blah-blah / Is that what you have? This brings me to my second point. What you should really submit is a minimal XSL-FO file that causes the problem. Regards, Alias John Brown. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Rendering differences: fop-0.95 vs fop.-1.0
My apologies for the size of the fo file. If I knew where the problem was in particular I certain would have trimmed it. I'll follow-up on your suggestions, for which I am most thankful. I sent the whole thing since there are pdf differences on most of the right hand pages, all of which printed nicely under 0.95. If I have to adjust the calculation of the table size (vertically) in fop-1.0 so be it. Thanks again, rjs On 01/11/2011 11:09 AM, Andreas Delmelle wrote: On 11 Jan 2011, at 14:20, Rob Sargent wrote: Hi Rob I've proven to myself that I'm generating identical xml, but getting malformed pdf in version 1.0 where 0.95 was perfectly happy. I'm getting some clipping along the inner (left) side of right-hand pages in static region-before but only on some pages. Not all pages, however. It looks as if I've over-lain a high-precedence region-start but it's not in my code :) Has anyone seen anything like this? Attaching the fo.xml for anyone that's curious. In the future, please pay us curious folk the courtesy of either: a) providing the *smallest possible* sample reproducing the issue, or b) describing your issue in more detail Just mentioning, since, IIC, you sent us about 23 pages of content too many... Thanks in advance! With that many pages and such a vague description, it is hard to see exactly what 'malformed pdf' you are referring to. Do I get it correct that you mean the effect that is visible on page 2? In that case, do mind that the region-before cannot grow beyond the specified extent of 1.5in. If it does, it will overlap the region-body, whether you intended it or not. I am unsure what exactly 0.95 did differently, but I am quite sure that that combination of block and nested tables will be too big to fit in the space of 1.5in. You can see that if you remove the second row of the innermost table (containing the block with text 'asdf'). After doing that, the page seems to look as it should. Regards Andreas - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Rendering differences: fop-0.95 vs fop.-1.0
On 01/11/2011 11:46 AM, Andreas Delmelle wrote: On 11 Jan 2011, at 19:31, Rob Sargent wrote: My apologies for the size of the fo file. If I knew where the problem was in particular I certain would have trimmed it. OK, no harm done. I'll follow-up on your suggestions, for which I am most thankful. I sent the whole thing since there are pdf differences on most of the right hand pages, all of which printed nicely under 0.95. If you can be more specific, don't hold back. Quite some time and commits passed between 0.95 and 1.0, so I cannot exclude the possibility that there are regressions among those differences. The more accurate you can tell what appears wrong, the better we will be able to judge whether they are genuine bugs or just 'natural' (and in XSL-FO, the latter is at times counter-intuitive...). Regards, Andreas --- Once I nail the culprit (table size calculation or what ever) I'll try to report back the difference. Stay tuned (patiently :) ) - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Rendering differences: fop-0.95 vs fop.-1.0
On 01/12/2011 05:43 AM, Vincent Hennebert wrote: Hi Rob, On 11/01/11 13:20, Rob Sargent wrote: I've proven to myself that I'm generating identical xml, but getting malformed pdf in version 1.0 where 0.95 was perfectly happy. I'm getting some clipping along the inner (left) side of right-hand pages in static region-before but only on some pages. Not all pages, however. It looks as if I've over-lain a high-precedence region-start but it's not in my code :) Like on page 3? This is a known bug: https://issues.apache.org/bugzilla/show_bug.cgi?id=49910 The workaround is to set the overflow property, on the corresponding fo:region-before element, to visible. Or unset it completely (that is, leave it to its default value). Has anyone seen anything like this? Attaching the fo.xml for anyone that's curious. Thanks, rjs HTH, Vincent - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org Thank you very much. In truth so many other things are in flames here at the moment I haven't had time to apply any of the advice recieved thus far. But that particular bush has to be extinguished by Monday. Please stay tuned. Appreciatively, rjs - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Rendering differences: fop-0.95 vs fop.-1.0
On 01/12/2011 05:43 AM, Vincent Hennebert wrote: Hi Rob, On 11/01/11 13:20, Rob Sargent wrote: I've proven to myself that I'm generating identical xml, but getting malformed pdf in version 1.0 where 0.95 was perfectly happy. I'm getting some clipping along the inner (left) side of right-hand pages in static region-before but only on some pages. Not all pages, however. It looks as if I've over-lain a high-precedence region-start but it's not in my code :) Like on page 3? This is a known bug: https://issues.apache.org/bugzilla/show_bug.cgi?id=49910 The workaround is to set the overflow property, on the corresponding fo:region-before element, to visible. Or unset it completely (that is, leave it to its default value). Has anyone seen anything like this? Attaching the fo.xml for anyone that's curious. Thanks, rjs By removing the overflow=hidden directive in the region-before both revs are producing beautiful (imho) output. I can live with the smashed text blocks when there is too much in the region-before. It's all manually reviewed rather frequently. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Rendering differences: fop-0.95 vs fop.-1.0
On 01/13/2011 11:42 AM, Rob Sargent wrote: On 01/12/2011 05:43 AM, Vincent Hennebert wrote: Hi Rob, On 11/01/11 13:20, Rob Sargent wrote: I've proven to myself that I'm generating identical xml, but getting malformed pdf in version 1.0 where 0.95 was perfectly happy. I'm getting some clipping along the inner (left) side of right-hand pages in static region-before but only on some pages. Not all pages, however. It looks as if I've over-lain a high-precedence region-start but it's not in my code :) Like on page 3? This is a known bug: https://issues.apache.org/bugzilla/show_bug.cgi?id=49910 The workaround is to set the overflow property, on the corresponding fo:region-before element, to visible. Or unset it completely (that is, leave it to its default value). Has anyone seen anything like this? Attaching the fo.xml for anyone that's curious. Thanks, rjs By removing the overflow=hidden directive in the region-before both revs are producing beautiful (imho) output. I can live with the smashed text blocks when there is too much in the region-before. It's all manually reviewed rather frequently. Oops. spoke to soon. Have more work to do. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Rendering differences: fop-0.95 vs fop.-1.0
On 01/13/2011 11:44 AM, Rob Sargent wrote: On 01/13/2011 11:42 AM, Rob Sargent wrote: On 01/12/2011 05:43 AM, Vincent Hennebert wrote: Hi Rob, On 11/01/11 13:20, Rob Sargent wrote: I've proven to myself that I'm generating identical xml, but getting malformed pdf in version 1.0 where 0.95 was perfectly happy. I'm getting some clipping along the inner (left) side of right-hand pages in static region-before but only on some pages. Not all pages, however. It looks as if I've over-lain a high-precedence region-start but it's not in my code :) Like on page 3? This is a known bug: https://issues.apache.org/bugzilla/show_bug.cgi?id=49910 The workaround is to set the overflow property, on the corresponding fo:region-before element, to visible. Or unset it completely (that is, leave it to its default value). Has anyone seen anything like this? Attaching the fo.xml for anyone that's curious. Thanks, rjs By removing the overflow=hidden directive in the region-before both revs are producing beautiful (imho) output. I can live with the smashed text blocks when there is too much in the region-before. It's all manually reviewed rather frequently. Oops. spoke to soon. Have more work to do. Once I removed /all/ the overflows, things appear fine.
align columns last line
Using fop-1.0, is it possible to define the columns such that the last line of text is always at the same position relative to the bottom of the page/the region-body? Or to much with the text to affect the same? rjs - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: align columns last line
YES! Thank you so much. I guess I didn't know how to ask google for it... rjs ps. Can't type for that matter: to much should have been to muck. On 01/20/2011 12:56 PM, Jeremias Maerki wrote: Have you tried display-align=after on region-body? Not sure if that's what you're after. On 18.01.2011 21:33:37 Rob Sargent wrote: Using fop-1.0, is it possible to define the columns such that the last line of text is always at the same position relative to the bottom of the page/the region-body? Or to much with the text to affect the same? rjs Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Can''t get rid of line between rows
Using fop-1.0. I have a two column table. The first column spans the table. There are five rows in the table. The cells are colored. Between each row there is a thin (1pt at most, perhaps a single pixel) line. I've tried forcing colored borders over the middle ground with border-collapse=collapse (which, if I read the compliance list correctly, is now supported). How many other ways can I a) be generating this line and b) how to get rid of them. Looking like I'll miss sending to the printers Monday :( ?xml version=1.0 encoding=UTF-8? fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format; xmlns:xalan=http://xml.apache.org/xslt; xmlns:ec=xalan://com.amirsys.utilities.ElementConversion fo:layout-master-set fo:page-sequence-master master-name=sidebars fo:repeatable-page-master-alternatives fo:conditional-page-master-reference page-position=any odd-or-even=odd master-reference=sidebar-odd blank-or-not-blank=any / fo:conditional-page-master-reference page-position=any odd-or-even=even master-reference=sidebar-even blank-or-not-blank=any / /fo:repeatable-page-master-alternatives /fo:page-sequence-master fo:simple-page-master page-width=8.5in page-height=11in master-name=sidebar-even fo:region-body margin-left=0.75in / fo:region-start region-name=side-bar-left extent=0.75in / /fo:simple-page-master fo:simple-page-master page-width=8.5in page-height=11in master-name=sidebar-odd fo:region-body margin-right=0.75in / fo:region-end region-name=side-bar-right extent=0.75in / /fo:simple-page-master /fo:layout-master-set fo:page-sequence master-reference=sidebars initial-page-number=30 fo:static-content flow-name=side-bar-left fo:table width=0.75in table-layout=fixed border-collapse=collapse fo:table-column column-width=0.5625in / fo:table-column column-width=0.1875in / fo:table-body fo:table-row height=9.6875in fo:table-cell border-top-width=1pt border-top-color=red border-bottom-width=1pt border-bottom-color=green background-color=#142850 border-right=0.5pt solid black fo:block fo:external-graphic width=0.5in src=left.svg height=9in / /fo:block /fo:table-cell fo:table-cell number-rows-spanned=5 border-bottom-width=1pt border-bottom-color=green fo:block / /fo:table-cell /fo:table-row fo:table-row fo:table-cell border-top-width=1pt border-top-color=red border-bottom-width=1pt border-bottom-color=green background-color=#142850 border-right=0.5pt solid black fo:block text-align=center font-size=5pt font-family=Optima /fo:block /fo:table-cell /fo:table-row fo:table-row fo:table-cell border-top-width=1pt border-top-color=red border-bottom-width=1pt border-bottom-color=green background-color=#142850 border-right=0.5pt solid black fo:block text-align=center font-size=22pt font-family=Optima /fo:block /fo:table-cell /fo:table-row fo:table-row fo:table-cell border-top-width=1pt border-top-color=red border-bottom-width=1pt border-bottom-color=green background-color=#142850 border-right=0.5pt solid black fo:block text-align=center font-size=22pt font-family=Optima /fo:block /fo:table-cell /fo:table-row fo:table-row height=0.50in display-align=before fo:table-cell border-top-width=1pt border-top-color=#142850 background-color=#142850 border-right=0.5pt solid black fo:block text-align=center font-size=10pt font-family=Optima fo:page-number / /fo:block /fo:table-cell /fo:table-row /fo:table-body /fo:table /fo:static-content fo:static-content flow-name=side-bar-right fo:table width=0.75in table-layout=fixed border-collapse=collapse fo:table-column column-width=0.1875in / fo:table-column column-width=0.5625in / fo:table-body fo:table-row height=9.6875in fo:table-cell number-rows-spanned=5 border-bottom-width=1pt border-bottom-color=green fo:block / /fo:table-cell fo:table-cell border-top-width=1pt border-top-color=red border-bottom-width=1pt border-bottom-color=green background-color=#142850 border-left=0.5pt solid black fo:block fo:external-graphic width=0.5in src=right.svg height=9in / /fo:block /fo:table-cell /fo:table-row fo:table-row fo:table-cell border-top-width=1pt border-top-color=red border-bottom-width=1pt border-bottom-color=green background-color=#142850 border-left=0.5pt solid black fo:block text-align=center font-size=5pt font-family=Optima /fo:block /fo:table-cell /fo:table-row
Re: Can''t get rid of line between rows
Spot on! Thanks. (One wasted weekend...) On 01/24/2011 12:53 AM, Jeremias Maerki wrote: Not sure if I fully understand your problem, but I suspect it's once more Adobe's anti-aliasing to be blamed. And this won't show up in print, BTW. To get rid of this on display, go to Acrobat's Preferences Dialog, select Page Display and enable Enhance Thin Lines (AR X) or disable Smooth line Art. You may have to disable Use 2D graphics acceleration, too. Nothing FOP can do at the moment. I've recently explained on this list what would need to be done to work around Adobe's problem. On 23.01.2011 22:34:43 Rob Sargent wrote: Using fop-1.0. I have a two column table. The first column spans the table. There are five rows in the table. The cells are colored. Between each row there is a thin (1pt at most, perhaps a single pixel) line. I've tried forcing colored borders over the middle ground with border-collapse=collapse (which, if I read the compliance list correctly, is now supported). How many other ways can I a) be generating this line and b) how to get rid of them. Looking like I'll miss sending to the printers Monday :( Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: align columns last line
Well not quite. display-align=top-and-bottom is what I'm really looking for. Crack open the iText manual I guess? rjs On 01/20/2011 03:45 PM, Rob Sargent wrote: YES! Thank you so much. I guess I didn't know how to ask google for it... rjs ps. Can't type for that matter: to much should have been to muck. On 01/20/2011 12:56 PM, Jeremias Maerki wrote: Have you tried display-align=after on region-body? Not sure if that's what you're after. On 18.01.2011 21:33:37 Rob Sargent wrote: Using fop-1.0, is it possible to define the columns such that the last line of text is always at the same position relative to the bottom of the page/the region-body? Or to much with the text to affect the same? rjs Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Can''t get rid of line between rows
Actually, the Adobe users were fine. It was just me using Evince (on Suse-11.2) who saw the problem and Evince doesn't have any controls in that regard. On 01/24/2011 09:24 AM, Rob Sargent wrote: Spot on! Thanks. (One wasted weekend...) On 01/24/2011 12:53 AM, Jeremias Maerki wrote: Not sure if I fully understand your problem, but I suspect it's once more Adobe's anti-aliasing to be blamed. And this won't show up in print, BTW. To get rid of this on display, go to Acrobat's Preferences Dialog, select Page Display and enable Enhance Thin Lines (AR X) or disable Smooth line Art. You may have to disable Use 2D graphics acceleration, too. Nothing FOP can do at the moment. I've recently explained on this list what would need to be done to work around Adobe's problem. On 23.01.2011 22:34:43 Rob Sargent wrote: Using fop-1.0. I have a two column table. The first column spans the table. There are five rows in the table. The cells are colored. Between each row there is a thin (1pt at most, perhaps a single pixel) line. I've tried forcing colored borders over the middle ground with border-collapse=collapse (which, if I read the compliance list correctly, is now supported). How many other ways can I a) be generating this line and b) how to get rid of them. Looking like I'll miss sending to the printers Monday :( Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: align columns last line
Is there really no fop way to get consistently placed top and bottom lines, such as one expects in a multi-column page of a magazine? I can see that this would mean reverse-leading(?) after the contents of the page had been established, but it seems a fundamental formatting requirement. Ever hopeful, rjs On 01/25/2011 10:30 AM, Rob Sargent wrote: Well not quite. display-align=top-and-bottom is what I'm really looking for. Crack open the iText manual I guess? rjs On 01/20/2011 03:45 PM, Rob Sargent wrote: YES! Thank you so much. I guess I didn't know how to ask google for it... rjs ps. Can't type for that matter: to much should have been to muck. On 01/20/2011 12:56 PM, Jeremias Maerki wrote: Have you tried display-align=after on region-body? Not sure if that's what you're after. On 18.01.2011 21:33:37 Rob Sargent wrote: Using fop-1.0, is it possible to define the columns such that the last line of text is always at the same position relative to the bottom of the page/the region-body? Or to much with the text to affect the same? rjs Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: align columns last line
Hello Andreas, Thanks for your comments On 01/26/2011 12:02 PM, Andreas Delmelle wrote: On 26 Jan 2011, at 19:42, Rob Sargent wrote: Hi Rob, Is there really no fop way to get consistently placed top and bottom lines, such as one expects in a multi-column page of a magazine? No mechanism defined for this in standard XSL-FO 1.1, unfortunately... Wow I can see that this would mean reverse-leading(?) after the contents of the page had been established, but it seems a fundamental formatting requirement. IIRC, FOP does take care of column-balancing, but only does so for all but the last page. More or less similar to a line-layout, where you generally apply alignment justification on all lines but the last. Hoping that the notion of balancing isn't just to approximate equalize the vertical length of the columns... I see several references to tests of region-body_column-count which are disabled because Column balancing doesn't work as expected, but I'm don't see how to turn the balancing on? I see in ExtensionElementMapping.java that disable-column-balancing is the default in the fox name-space. And I apparently one turns balancing on by setting that attribute to false, is that correct? To that end, I added the namespace to my xsl file (xmlns:fox=http://xmlgraphics.apache.org/fop/extensions;) and added the attribute to my region-body elements but the parser as 'fo:region-body disable-column-balancing=false column-count=2' but my Transformer chokes complaining that 'Invalid property encountered on fo:region-body: disable-column-balancing' One possible way out could be to put in a trailing, empty fo:block with span=all set. That should trigger column-balancing, even if the content takes up less than one page. In combination with display-align=center, that might come very close to what you're looking for. If I understand the requirement correctly, that is... We're working on chapters of a text book, so I don't think this is a practicable option here. Thanks again, rjs Hope this helps. Regards, Andreas --- - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: align columns last line
I do have a hard time with English, and it's the only language I speak. If the default behaviour is to balance the columns, what defines balanced? We see much variability in the y-coordinate of the last lines both with-in and across (facing) pages. There are cases where keep-with-next causes obvious shortages in one column. To be fair some of these gaps would be too large to rectify by simple adding space between the lines and we will deal with these at the authoring level. But we see many cases of routine paragraphs split at varying distances from the bottom. Others see perfectly matched bottom lines? Are there other factors which might be getting in the way? Cheeris, rjs On 01/26/2011 04:01 PM, Andreas Delmelle wrote: On 26 Jan 2011, at 23:44, Rob Sargent wrote: On 01/26/2011 12:02 PM, Andreas Delmelle wrote: IIRC, FOP does take care of column-balancing, but only does so for all but the last page. More or less similar to a line-layout, where you generally apply alignment justification on all lines but the last. Hoping that the notion of balancing isn't just to approximate equalize the vertical length of the columns... Hmm, that is precisely it, I'm afraid, and it is enabled by default. The extension property is prefixed 'disable-' precisely because it alters FOP's standard behavior. Column-balancing doesn't work as expected in some scenarios, mainly in combination with footnotes, but for not-too-complex use cases, it should suffice. I thought you were referring to unbalanced columns within the same page, which can happen on the last page. The other pages should already be balanced. I must have misunderstood the issue...? Regards, Andreas --- - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Can''t get rid of line between rows
If the color is set at the table level, one does not see the lines. I was going to put my second column inside a cell in a containing table to get rid of the lines, until I heard about this viewer problem. Thanks for saving me from that pain. rjs On 01/27/2011 01:36 AM, Jeremias Maerki wrote: Good to know that it also happens in other PDF viewers. Thanks for letting us know. On 26.01.2011 01:21:46 Rob Sargent wrote: Actually, the Adobe users were fine. It was just me using Evince (on Suse-11.2) who saw the problem and Evince doesn't have any controls in that regard. On 01/24/2011 09:24 AM, Rob Sargent wrote: Spot on! Thanks. (One wasted weekend...) On 01/24/2011 12:53 AM, Jeremias Maerki wrote: Not sure if I fully understand your problem, but I suspect it's once more Adobe's anti-aliasing to be blamed. And this won't show up in print, BTW. To get rid of this on display, go to Acrobat's Preferences Dialog, select Page Display and enable Enhance Thin Lines (AR X) or disable Smooth line Art. You may have to disable Use 2D graphics acceleration, too. Nothing FOP can do at the moment. I've recently explained on this list what would need to be done to work around Adobe's problem. On 23.01.2011 22:34:43 Rob Sargent wrote: Using fop-1.0. I have a two column table. The first column spans the table. There are five rows in the table. The cells are colored. Between each row there is a thin (1pt at most, perhaps a single pixel) line. I've tried forcing colored borders over the middle ground with border-collapse=collapse (which, if I read the compliance list correctly, is now supported). How many other ways can I a) be generating this line and b) how to get rid of them. Looking like I'll miss sending to the printers Monday :( Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: align columns last line
I will most certainly give that a try, even if http://www.w3.org/TR/xsl/#display-align does not suggest that is a valid doesn't suggest that as an option. I guess I need a better reference for the current state of fop. Thank you and Jeremias for your assistance in this matter. I will share my resutls when available. On 01/27/2011 12:09 PM, Andreas Delmelle wrote: On 27 Jan 2011, at 16:35, Rob Sargent wrote: Here is the fo. (But the last time I did this it was not well recieved.) I'm not confident I could crop it significantly and still have a useful fo. OK, I see what you mean now. Did you try out Jeremias' last suggestion? If I just put display-align=distribute on every region-body, the result has top/bottom edges far better aligned, although you then do get pages where there's slightly more space between the lines in one column compared to the other. Regards, Andreas --- - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: align columns last line
Beautiful. Thanks ever so much. rjs On 01/27/2011 12:25 PM, Rob Sargent wrote: I will most certainly give that a try, even if http://www.w3.org/TR/xsl/#display-align does not suggest that is a valid doesn't suggest that as an option. I guess I need a better reference for the current state of fop. Thank you and Jeremias for your assistance in this matter. I will share my resutls when available. On 01/27/2011 12:09 PM, Andreas Delmelle wrote: On 27 Jan 2011, at 16:35, Rob Sargent wrote: Here is the fo. (But the last time I did this it was not well recieved.) I'm not confident I could crop it significantly and still have a useful fo. OK, I see what you mean now. Did you try out Jeremias' last suggestion? If I just put display-align=distribute on every region-body, the result has top/bottom edges far better aligned, although you then do get pages where there's slightly more space between the lines in one column compared to the other. Regards, Andreas --- - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: FreeSerif Font not working
On 02/27/2011 08:49 PM, Graeme Kidd wrote: Hi, I am having some troubles getting a Type 1 version of the FreeSerif[1] font configured for FOP. I am needing a Unicode font that is in Type 1 so that I can set the output to Postscript. I have attached the PFB, PFM and Metric XML file as well as the following FO and Config file: Do characters from the basic alphabet show up? There's no guarantee that a given font has all the gliffs you desire. rjs - FreeSerifTest.fo - ?xml version=1.0 encoding=UTF-8? fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format; font-family=FreeSerif font-weight=normal font-style=normal fo:layout-master-set fo:simple-page-master master-name=my-page fo:region-body margin=1in/ /fo:simple-page-master /fo:layout-master-set fo:page-sequence master-reference=my-page fo:flow flow-name=xsl-region-body fo:block font-family=FreeSerif font-weight=normal font-style=normal Lj ljNJNjnjǍǎǏǐǑ ǒǓǔǕǖǗǘǙǚǛǜǝǞ ǟǠǡǢǣǤǥǦǧǨ /fo:block /fo:flow /fo:page-sequence /fo:root -- -- FreeSerifTest.config -- fop version=1.0 !-- Base URL for resolving relative URLs -- base.//base renderers renderer mime=application/postscript fonts !-- register a particular font -- font metrics-url=fonts/FreeSerif.xml kerning=yes embed-url=fonts/FreeSerif.pfb encoding-mode=single-byte font-triplet name=FreeSerif style=normal weight=normal/ /font !-- register all the fonts found in a directory directoryC:\FOP_Fonts/directory -- !-- automatically detect operating system installed fonts auto-detect/ -- /fonts /renderer /render -- FreeSerifTest.log --- [WARN ] Glyph Lj (0x1c8, Lj) not available in font FreeSerif. [WARN ] Glyph lj (0x1c9, lj) not available in font FreeSerif. [WARN ] Glyph NJ (0x1ca, NJ) not available in font FreeSerif. [WARN ] Glyph Nj (0x1cb, Nj) not available in font FreeSerif. [WARN ] Glyph nj (0x1cc, nj) not available in font FreeSerif. [WARN ] Glyph Ǎ (0x1cd, Acaron) not available in font FreeSerif. [WARN ] Glyph ǎ (0x1ce, acaron) not available in font FreeSerif. [WARN ] Glyph Ǐ (0x1cf, Icaron) not available in font FreeSerif. -- FreeSerifTest.pdf --- # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # -- Does anyone have any idea why the FreeSerif font is not working? Thanks [1] http://www.gnu.org/software/freefont/ - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: what might be forcing an early page/column break
I neglected to lay out the working envirionment. FOP=1.0 (from source.) PDF generation on Windows and Linux shows identical result. rjs Rob Sargent wrote: Two lines of text are unnecessarily being delayed to the following page/column, presumably being dragged along with the following heading which does not fit at the bottom of the preceding column? The heading itself does have keep-with-next, but not the fractured paragraph. In the attached fo, the example can be found across the boundaries of pages 14, 15 (on 8.5 X 11 paper). The following chunk gets split leaving the text from 'ings are nonspecific' onward on the following page. fo:block text-align=justify space-before=6ptIntracranial MEs are extremely rare but have been reported in the ventricles and brain parenchyma. Imaging findings are nonspecific but are generally those of a cyst with enhancing nodule./fo:block - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: can fop do outline style font? how?
I suspect you either need to acquire a outline font or if you system has one then you may need to set the option to look locally fonts using auto-detect/ in your fop_config.xml file. Either way you have to name the font with 'font-family=your-outline-font' in your fo. It is not a font-style far as I know. On 03/22/2011 12:30 PM, Zac Nichol wrote: can fop do outline style font? how? if not is there some kind of workaround? - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: what might be forcing an early page/column break
Hello again Vincent, Thanks for looking into this. Presumptuous of me to think the fo would be sufficient. I'll try some colouring experiments to verify but I'm nearly certain there is plenty of room for the two lines. It's a two column layout and there is several lines of text in the left column at the same position we expect these to errant lines will go in the right column. I'm not sure how best to get my environment to you: Just to view the problem, the pdf (2.5Mb) might be best? I am indeed using a couple of non-standard fonts. I could tar up the source xml, stylesheet, fonts and images (5Mb) if your game for that. Probably use yousendit. Pick your poison. :) It would also be possible for me to run inside an ide, if there are any specific spots you can identify for me to stop and look around. rjs On 03/23/2011 05:11 AM, Vincent Hennebert wrote: Hi Rob, I can’t reproduce your problem. In my version the mentioned paragraph ends up in the middle of the 2nd column of page 14. That’s probably because I don’t have the fonts you are using in your documents, and maybe neither the images. I’d say that this is due to the widows property whose value is 2 by default. Maybe in your version there is space for only one line, which would result in a widow line on the 2nd column (the last line of the paragraph ending up alone at the top of column 2). To avoid that FOP pushes the last two lines to the next column. Try setting a background colour on the region-body to better see its boundaries, and confirm that there is space only for one line. Otherwise, maybe you can send me your fonts offline and I’ll try to reproduce your version. HTH, Vincent On 18/03/11 23:34, Rob Sargent wrote: Two lines of text are unnecessarily being delayed to the following page/column, presumably being dragged along with the following heading which does not fit at the bottom of the preceding column? The heading itself does have keep-with-next, but not the fractured paragraph. In the attached fo, the example can be found across the boundaries of pages 14, 15 (on 8.5 X 11 paper). The following chunk gets split leaving the text from 'ings are nonspecific' onward on the following page. fo:block text-align=justify space-before=6ptIntracranial MEs are extremely rare but have been reported in the ventricles and brain parenchyma. Imaging findings are nonspecific but are generally those of a cyst with enhancing nodule./fo:block - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: can fop do outline style font? how?
I think you need to add a font definition to you fop.xconf. Here's one I have in my config. renderers renderer mime=application/pdf fonts font metrics-url=GillSansMTPro-Medium.xml kerning=yes embed-url=GillSansMTPro-Medium.ttf font-triplet name=GillSansMTPro style=normal weight=normal/ /font ... On 03/23/2011 09:24 AM, Zac Nichol wrote: OK so since FOP cannot do style attribute of outline, I instead found a font whose normal appearance looks like what you would call an outline style. The font's name is Swis721 BdOul BT (I know this because i open the file in Font Viewer on Ubuntu and that's waht it says is the Name) and it's in a file called swissbo.ttf and it's saved at location /usr/share/fonts/swissbo.ttf. BUT now I just can't seem to make it work. Here's what I'm doing in detail... I've got my configuration file which contains the code like this: ... fonts directory/usr/share/fonts/directory /fonts ... and i'm calling FOP like this: fop -c fop.xconf template.fo output.pdf inside template.fo I refer to the font like this: ... fo:block font-size=14pt font=Swis721 BdOul BT text-align=centersome text/fo:block ... is this wrong? i've also tried doing font-family= instead of just font= and it also doesn't work. It just prints it in Times New Roman i think. Any help is appreciated. THank you. -Zac On Tue, Mar 22, 2011 at 4:22 PM, Rob Sargentrsarg...@xmission.com wrote: I suspect you either need to acquire a outline font or if you system has one then you may need to set the option to look locally fonts using auto-detect/ in your fop_config.xml file. Either way you have to name the font with 'font-family=your-outline-font' in your fo. It is not a font-style far as I know. On 03/22/2011 12:30 PM, Zac Nichol wrote: can fop do outline style font? how? if not is there some kind of workaround? - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: AW: AW: AW: OutOfMemoryException while transforming large XML to PDF
I don't see a mention of java version in play, but if it's java1.6 I would urge the op to try his hand at using jconsole to examine exactly what is holding the lion's share of the memory or too see if too many of something are hanging around unnecessarily. rjs On 03/25/2011 02:54 PM, Luis Ferro wrote: The major problem i've see in java is the heap memory... It gets exausted on very big jobs. The only alternatives are: 1. cut the job in smaller chunks... 2. move all the environment to 64bits... The 64bit platform will allow you to allocate more ram to the process and surpass the 1.2gb (or something nearby) of the 32 bit platform per process. Cheers, LF On 25/03/2011 16:13, Eric Douglas wrote: How to feed the FO file? Using the command line transform you just pass it to the -fo parameter. Using embedded code I feed it as a SAXSource. Reading in from file you have: java.io.File java.io.FileInputStream org.xml.sax.InputSource javax.xml.transform.sax.SAXSource Creates the input. Pass that in to: javax.xml.transform.TransformerFactory javax.xml.transform.Transformer I'm not sure it's required but I copied this code from the FOP website: Transformer.setParameter(versionParam, 2.0) Then your transform, with the FOP output generated with these classes. org.apache.fop.apps.FopFactory org.apache.fop.apps.Fop javax.xml.transform.sax.SAXResult The SAXResult is created from the Fop.getDefaultHandler. The Transformer can be created with an XSL file parameter to pass XML into the transform, or with no XSL to pass the FO in. -Original Message- From: Dennis van Zoerlandt [mailto:dvzoerla...@vanboxtel.nl] Sent: Friday, March 25, 2011 10:30 AM To: fop-users@xmlgraphics.apache.org Subject: Re: AW: AW: AW: OutOfMemoryException while transforming large XML to PDF Hi Georg, I'm currently running the XML and XSLT through XMLspy with FOP 0.95 (it seems Altova doesn't support FOP 1.0). I'm not really sure how to feed the FO file to FOP? Can I just put the FO file as source file for the transformer.transform()? I'll get back to you when I have a FO file. My pc's currently performing very badly, so it seems it's a heavy job. Best regards, Dennis van Zoerlandt - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: FOP does not create PDF file
Your classpath is missing fop.jar? On 04/26/2011 10:43 AM, code_expert wrote: Hi Guys, I have installed fop 0.95 (on ubuntu) and I am trying to use it within an application to create pdf files. I get the following error message though. I appreciate any help or idea, as I am not sure what causes this and how to fix it. Exception in thread main java.lang.NoClassDefFoundError: org/apache/fop/cli/Main Caused by: java.lang.ClassNotFoundException: org.apache.fop.cli.Main at java.net.URLClassLoader$1.run(URLClassLoader.java: 217) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.j ava:205) at java.lang.ClassLoader.loadClass(ClassLoader.java:3 21) at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:294) at java.lang.ClassLoader.loadClass(ClassLoader.java:2 66) Could not find the main class: org.apache.fop.cli.Main. Program will exit. Thanks, - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: FOP does not create PDF file
A little more info on your process and environment might be useful. I'm not sure what you mean by use export: maybe export CLASSPATH=full-path-to-fop.jar? Something later on in your process could be making a different classpath? Which application are within? And if within an app, why are you calling the cli code? Perhaps you app execs fop? On 04/26/2011 11:42 AM, code_expert wrote: Hi, Thanks for your reply. I checked the classpath, and it was empty. Then I added the fop.jar to it, using export and also /etc/environment, but it didn't make any changes. Any other idea? Rob Sargent-4 wrote: Your classpath is missing fop.jar? On 04/26/2011 10:43 AM, code_expert wrote: Hi Guys, I have installed fop 0.95 (on ubuntu) and I am trying to use it within an application to create pdf files. I get the following error message though. I appreciate any help or idea, as I am not sure what causes this and how to fix it. Exception in thread main java.lang.NoClassDefFoundError: org/apache/fop/cli/Main Caused by: java.lang.ClassNotFoundException: org.apache.fop.cli.Main at java.net.URLClassLoader$1.run(URLClassLoader.java: 217) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.j ava:205) at java.lang.ClassLoader.loadClass(ClassLoader.java:3 21) at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:294) at java.lang.ClassLoader.loadClass(ClassLoader.java:2 66) Could not find the main class: org.apache.fop.cli.Main. Program will exit. Thanks, - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: FOP does not create PDF file
is empty, then it will return the input string # this is stupid, so case for it if [ $i != ${DIRLIBS} ] ; then if [ -z $LOCALCLASSPATH ] ; then LOCALCLASSPATH=$i else LOCALCLASSPATH=$i${pathSepChar}$LOCALCLASSPATH fi fi done IFS=$OLD_IFS # add in user-defined hyphenation JARs if [ -n $FOP_HYPHENATION_PATH ] ; then LOCALCLASSPATH=$LOCALCLASSPATH${pathSepChar}$FOP_HYPHENATION_PATH fi # For Cygwin, switch paths to appropriate format before running java # For PATHs convert to unix format first, then to windows format to ensure # both formats are supported. Probably this will fail on directories with ; # in the name in the path. Let's assume that paths containing ; are more # rare than windows style paths on cygwin. if $cygwin; then if [ $OS = Windows_NT ] cygpath -m ./dev/null 2/dev/null ; then format=mixed else format=windows fi FOP_HOME=`cygpath --$format $FOP_HOME` LCP_TEMP=`cygpath --path --unix $LOCALCLASSPATH` LOCALCLASSPATH=`cygpath --path --$format $LCP_TEMP` if [ -n $CLASSPATH ] ; then CP_TEMP=`cygpath --path --unix $CLASSPATH` CLASSPATH=`cygpath --path --$format $CP_TEMP` fi CYGHOME=`cygpath --$format $HOME` fi # Show script help if requested if $show_help ; then fop_exec_args= echo $0 '[script options] [FOP options]' echo 'Script Options:' echo ' --help, -h print this message and FOP help' echo ' --noconfig suppress sourcing of /etc/fop.conf,' echo ' $HOME/.fop/fop.conf, and $HOME/.foprc' echo ' configuration files' echo ' --execdebugprint FOP exec line generated by this' echo ' launch script' fi # add a second backslash to variables terminated by a backslash under cygwin if $cygwin; then case $FOP_HOME in *\\ ) FOP_HOME=$FOP_HOME\\ ;; esac case $CYGHOME in *\\ ) CYGHOME=$CYGHOME\\ ;; esac case $LOCALCLASSPATH in *\\ ) LOCALCLASSPATH=$LOCALCLASSPATH\\ ;; esac case $CLASSPATH in *\\ ) CLASSPATH=$CLASSPATH\\ ;; esac fi # The default commons logger for JDK1.4 is JDK1.4Logger. # To use a different logger, uncomment the one desired below # LOGCHOICE=-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.NoOpLog # LOGCHOICE=-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog # LOGCHOICE=-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger # Logging levels # Below option is only if you are using SimpleLog instead of the default JDK1.4 Logger. # To set logging levels for JDK 1.4 Logger, edit the %JAVA_HOME%/JRE/LIB/logging.properties # file instead. # Possible SimpleLog values: trace, debug, info (default), warn, error, or fatal. # LOGLEVEL=-Dorg.apache.commons.logging.simplelog.defaultlog=INFO # Execute FOP using eval/exec to preserve spaces in paths, # java options, and FOP args fop_exec_command=exec \$JAVACMD\ $LOGCHOICE $LOGLEVEL -classpath \$LOCALCLASSPATH\ $FOP_OPTS org.apache.fop.cli.Main $fop_exec_args if $fop_exec_debug ; then echo $fop_exec_command fi eval $fop_exec_command Rob Sargent-4 wrote: I suspect /usr/local/bin/fop is a script. If so, see what path it is using internally. On 04/26/2011 02:53 PM, code_expert wrote: I checked the application, it seems to use this command to run the fop, which is quite similar to what I did in the command line: command_status = os.system('/usr/local/bin/fop -xml '+ xml_path +' -xsl '+ xsl_path + ' -pdf '+ pdf_path + ' 2 ' + error_path) So, it's trying to run a system command like a command line inside the application. I tried running my previous command line with the /usr/local/bin/fop and got the same error as I got previously. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: How do I set page margins?
On 05/13/2011 12:20 PM, Eric Douglas wrote: The basic page margin is in the page setup. fo:simple-page-master xsl:attribute name=margin-topxsl:value-of select=MT//xsl:attribute This works at the top level but sets the same margin for all pages. What if I want each page to be different? I can assign this attribute from an xsl:variable if I create that variable above the fo:layout-master-set section. If I assign a value for it down below within the fo:page-sequence it doesn't seem to have an effect. I generate the XML myself to calculate what goes on each page, so the page processing looks like this. fo:page-sequence fo:flow xsl:for-each select=PD fo:block xsl:attribute name=break-beforepage/xsl:attribute I tried moving that margin-top attribute to that fo:block and it doesn't look like it's having any effect, though it does indent my text blocks if I add a margin-left to that block. I suspect you have to define your simple-page-masters, filling in the margin values, then lay out their order of appearance(s) in a page-sequence-master.
breakpoint suggestions please
I'm in fop-1.0 source (thank you all very much) trying to find the last element written to the pdf. Situation: I need to dynamically size static regions such that I can accurately apportion the page. We generate a separate pdf for table(s) then calculate depth of that and use that value to size a region-before. (The two pdfs are then overlayed to generate a single pdf.) History: We have code which works in for fop-0.94 and works to a certain extent in fop-0.95 but I would rather converge our shop on fop-1.0. The 095 implementation does not find stuff below about half the page. Confession: Both implementations are, by the admission of the author, wild-ass guesses of what the content of the pdf-as-byte-array means. Aspirations: Find a definitive answer to the age-old question Where is the text in a pdf? Hoping against hope that I can detect something useful during the fo-pdf transformation that I can look for later in our application. Any suggestions welcome. Thanks. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: breakpoint suggestions please
Jeremias, Thanks a ton for the pointer. Off I go... rjs On 05/16/2011 12:18 AM, Jeremias Maerki wrote: Rob, I guess it's easiest if you produce the area tree XML (-at, application/X-fop-areatree) and then retrieve the span elements' bpda values (block-progression-dimension allocated). XPath: /areaTree/pageSequence/pageViewport/page/regionViewport/regionBody/mainReference/span/flow The values returned are in millipoints (1000ths of a point), FOP's internal measurement unit. See also: http://xmlgraphics.apache.org/fop/1.0/intermediate.html#usage On 14.05.2011 00:26:29 Rob Sargent wrote: I'm in fop-1.0 source (thank you all very much) trying to find the last element written to the pdf. Situation: I need to dynamically size static regions such that I can accurately apportion the page. We generate a separate pdf for table(s) then calculate depth of that and use that value to size a region-before. (The two pdfs are then overlayed to generate a single pdf.) History: We have code which works in for fop-0.94 and works to a certain extent in fop-0.95 but I would rather converge our shop on fop-1.0. The 095 implementation does not find stuff below about half the page. Confession: Both implementations are, by the admission of the author, wild-ass guesses of what the content of the pdf-as-byte-array means. Aspirations: Find a definitive answer to the age-old question Where is the text in a pdf? Hoping against hope that I can detect something useful during the fo-pdf transformation that I can look for later in our application. Any suggestions welcome. Thanks. Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Changebar Status
There is interest here, but it will be a while until I can try it. Cheers, rjs On 05/23/2011 02:49 PM, Stephan Thesing wrote: Dear all, has anybody tried out my patch for production of change bars in FOP yet? The patch against a rather recent /trunk is attached at PR 48548 ... I would welcome any feedback. Best regards Stephan - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
flow sideways
I have a table of data which is designed to span across two facing pages. Thanks to the tip from Jeremias Maerki I can size the tables perfectly and allot the correct space in the region-before or each page. But how do I get the table to break across the two pages nicely? Since the definition of each line's depth my be determined by any column I cannot lay the two halves out separately. It would be cool if it would just flow nicely all by itself but that's not quite how flow works far as I know. Perhaps I could lay the entire table in both region and have it truncate the left/right overflow? Seems possible for the left page, but would it work for the right hand page. i.e. Can one force the region to in essence fill from the right. Or is there a correct way to accomplish this? All pointer welcome, rjs - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
fop called in xslt extension is not finding fonts
Again with thanks to Jeremias, I'm successfully sizing the region-before for dynamically generated tables. I'm doing this via and xslt extension function (Xalan style). The xslt extension calls my sizing function which employs fop-1.0 to generate an IF from the given dom.Node. I notice that during the function's invocation of fop-1.0 that the named fonts are not found and are substituted with any in the resultant intermediate format output, with font-size=1000 (), with log messages like 'Font Optima-Oblique,normal,700 not found. Substituting with any,normal,700'. I'm doubly confused because the fo is ultimately processed to pdf by the same fop-1.0. I have to confess that I'm invoking fop reflectively since we have many versions in play and I need each to have their own classpath. That said the same invocation happens for both the extension and the final processing. Here's part of the where the font path is set: final Method setFontBaseURLMethod = fopFactoryClass.getMethod(setFontBaseURL, new Class[]{String.class}); String fontsURL = file:// + bundlePath + fopHome + /fonts; setFontBaseURLMethod.invoke(fopFactory, new Object[]{fontsURL}); I suspect there is some subtle distinction between generating IF and PDF output? I get good results with this if the caller of my function is processed with fop-1.0. If the caller is processed by fop-0.95 the estimated size is much too large and I mis-size the region. In both cases the IF has 'font-name=any' so I'm a little surprised it work at all?! Any pointers on where I've messed up would be greatly appreciated. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: fop called in xslt extension is not finding fonts
Hello Mehdi, Thanks for your work on this. I think you're on the right track but not sure how to proceed. I may be misunderstanding things but in my use of the API the choice of mime type defines IF vs PDF. I accomplish this in the constructor with this (reflective) code. fopFactoryMethod = fopFactoryClass.getMethod(newFop, String.class, userAgent.getClass(), OutputStream.class); Object fop = fopFactoryMethod.invoke(fopFactory, getMimeType(), userAgent, out); The getMimeType() call returns application/pdf or application/X-fop-areatree. That's the only difference in my two invocations of fop. In particular, the fonts are handled identically. So I'm still a brick shy of a load here. On 06/02/2011 01:47 AM, mehdi houshmand wrote: Hi Rob, I just tested this on my system and I was finding the same results as you... When I set the output format to IF, FOP wasn't working. So anyway, I fixed it by setting the output MIME type, which is done via the command line as such: ./fop -c fop.xconf test.fo -ifinsert mime-type output.if so in my case it was: ./fop -c fop.xconf test.fo -if application/pdf output.if When you think about it, it does make sense. You refer to fonts in the fop.xconf as a child of their rendering output, which allows you to distinguish different font files according to the document output format. There wouldn't be any way of FOP knowing your desired FINAL output format if you were processing to IF. How you do that using FOPs API, I don't know, but I can't imagine that would be hard to find out. Mehdi On 1 June 2011 19:18, Rob Sargentrsarg...@xmission.com wrote: Again with thanks to Jeremias, I'm successfully sizing the region-before for dynamically generated tables. I'm doing this via and xslt extension function (Xalan style). The xslt extension calls my sizing function which employs fop-1.0 to generate an IF from the given dom.Node. I notice that during the function's invocation of fop-1.0 that the named fonts are not found and are substituted with any in the resultant intermediate format output, with font-size=1000 (), with log messages like 'Font Optima-Oblique,normal,700 not found. Substituting with any,normal,700'. I'm doubly confused because the fo is ultimately processed to pdf by the same fop-1.0. I have to confess that I'm invoking fop reflectively since we have many versions in play and I need each to have their own classpath. That said the same invocation happens for both the extension and the final processing. Here's part of the where the font path is set: final Method setFontBaseURLMethod = fopFactoryClass.getMethod(setFontBaseURL, new Class[]{String.class}); String fontsURL = file:// + bundlePath + fopHome + /fonts; setFontBaseURLMethod.invoke(fopFactory, new Object[]{fontsURL}); I suspect there is some subtle distinction between generating IF and PDF output? I get good results with this if the caller of my function is processed with fop-1.0. If the caller is processed by fop-0.95 the estimated size is much too large and I mis-size the region. In both cases the IF has 'font-name=any' so I'm a little surprised it work at all?! Any pointers on where I've messed up would be greatly appreciated. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: fop called in xslt extension is not finding fonts
Chris, Thanks. This looks like what I need. Now I have to work it into my switch-hitting fop runner! Cheers, rjs On 06/02/2011 09:35 AM, Chris Bowditch wrote: On 02/06/2011 08:47, mehdi houshmand wrote: Hi Rob, Hi Rob, Mehdi is right that the problem when generating IF is down to the way the fop.xconf is organized by Renderer. The command line option he mentions is the way to resolve this from the command line. The API code we use to set the Mimic Renderer (the renderer from which to lookup configuration for the IF Renderer in the fop.xconf) is shown below: IFDocumentHandler targetHandler = m_factory.getRendererFactory().createDocumentHandler(m_foUserAgent, mimeType); IFSerializer ifSerializer = new IFSerializer(); ifSerializer.setContext(new IFContext(m_foUserAgent)); ifSerializer.mimicDocumentHandler(targetHandler); HTH, Chris I just tested this on my system and I was finding the same results as you... When I set the output format to IF, FOP wasn't working. So anyway, I fixed it by setting the output MIME type, which is done via the command line as such: ./fop -c fop.xconf test.fo -ifinsert mime-type output.if so in my case it was: ./fop -c fop.xconf test.fo -if application/pdf output.if When you think about it, it does make sense. You refer to fonts in the fop.xconf as a child of their rendering output, which allows you to distinguish different font files according to the document output format. There wouldn't be any way of FOP knowing your desired FINAL output format if you were processing to IF. How you do that using FOPs API, I don't know, but I can't imagine that would be hard to find out. Mehdi On 1 June 2011 19:18, Rob Sargentrsarg...@xmission.com wrote: Again with thanks to Jeremias, I'm successfully sizing the region-before for dynamically generated tables. I'm doing this via and xslt extension function (Xalan style). The xslt extension calls my sizing function which employs fop-1.0 to generate an IF from the given dom.Node. I notice that during the function's invocation of fop-1.0 that the named fonts are not found and are substituted with any in the resultant intermediate format output, with font-size=1000 (), with log messages like 'Font Optima-Oblique,normal,700 not found. Substituting with any,normal,700'. I'm doubly confused because the fo is ultimately processed to pdf by the same fop-1.0. I have to confess that I'm invoking fop reflectively since we have many versions in play and I need each to have their own classpath. That said the same invocation happens for both the extension and the final processing. Here's part of the where the font path is set: final Method setFontBaseURLMethod = fopFactoryClass.getMethod(setFontBaseURL, new Class[]{String.class}); String fontsURL = file:// + bundlePath + fopHome + /fonts; setFontBaseURLMethod.invoke(fopFactory, new Object[]{fontsURL}); I suspect there is some subtle distinction between generating IF and PDF output? I get good results with this if the caller of my function is processed with fop-1.0. If the caller is processed by fop-0.95 the estimated size is much too large and I mis-size the region. In both cases the IF has 'font-name=any' so I'm a little surprised it work at all?! Any pointers on where I've messed up would be greatly appreciated. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: FOP EMPTY PDF
Oscar, I think it might be more useful to post the fo file generated by the xslt transformation of you source xml file, often called the fo file. Given that you do get a pdf file with _some_ content, I suspect your stylesheet isn't doing what you want it to do. This should be evident in the fo file. On 06/02/2011 03:14 PM, Oscar.Flores wrote: Hi there i am working in a proyect with Fop and Java to tranform xml to pdf this with a .xls file, when i make the pdf it seems that everything is fine except that is empty well only makes a table and some letters but the information its gone, the version of Fop is 1.0, xml graphics 1.5svn, i hope you can help me, i attach the xml and the xsl Thanks!! http://old.nabble.com/file/p31761083/F_0008556FA.xml F_0008556FA.xml http://old.nabble.com/file/p31761083/FacturasOMF.xsl FacturasOMF.xsl - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: fop called in xslt extension is not finding fonts
Naturally I should have been more clear in my original posting: I'm using the AreaTree (application/X-fop-areatree) intermediate format not the IF form (application/X-fop-intermediate-format). the AT form gives me an easy answer to content length. I've also re-read the doc on AT and have some hope of resolving the problem. We'll see. On 06/02/2011 09:57 AM, Rob Sargent wrote: Chris, Thanks. This looks like what I need. Now I have to work it into my switch-hitting fop runner! Cheers, rjs On 06/02/2011 09:35 AM, Chris Bowditch wrote: On 02/06/2011 08:47, mehdi houshmand wrote: Hi Rob, Hi Rob, Mehdi is right that the problem when generating IF is down to the way the fop.xconf is organized by Renderer. The command line option he mentions is the way to resolve this from the command line. The API code we use to set the Mimic Renderer (the renderer from which to lookup configuration for the IF Renderer in the fop.xconf) is shown below: IFDocumentHandler targetHandler = m_factory.getRendererFactory().createDocumentHandler(m_foUserAgent, mimeType); IFSerializer ifSerializer = new IFSerializer(); ifSerializer.setContext(new IFContext(m_foUserAgent)); ifSerializer.mimicDocumentHandler(targetHandler); HTH, Chris I just tested this on my system and I was finding the same results as you... When I set the output format to IF, FOP wasn't working. So anyway, I fixed it by setting the output MIME type, which is done via the command line as such: ./fop -c fop.xconf test.fo -ifinsert mime-type output.if so in my case it was: ./fop -c fop.xconf test.fo -if application/pdf output.if When you think about it, it does make sense. You refer to fonts in the fop.xconf as a child of their rendering output, which allows you to distinguish different font files according to the document output format. There wouldn't be any way of FOP knowing your desired FINAL output format if you were processing to IF. How you do that using FOPs API, I don't know, but I can't imagine that would be hard to find out. Mehdi On 1 June 2011 19:18, Rob Sargentrsarg...@xmission.com wrote: Again with thanks to Jeremias, I'm successfully sizing the region-before for dynamically generated tables. I'm doing this via and xslt extension function (Xalan style). The xslt extension calls my sizing function which employs fop-1.0 to generate an IF from the given dom.Node. I notice that during the function's invocation of fop-1.0 that the named fonts are not found and are substituted with any in the resultant intermediate format output, with font-size=1000 (), with log messages like 'Font Optima-Oblique,normal,700 not found. Substituting with any,normal,700'. I'm doubly confused because the fo is ultimately processed to pdf by the same fop-1.0. I have to confess that I'm invoking fop reflectively since we have many versions in play and I need each to have their own classpath. That said the same invocation happens for both the extension and the final processing. Here's part of the where the font path is set: final Method setFontBaseURLMethod = fopFactoryClass.getMethod(setFontBaseURL, new Class[]{String.class}); String fontsURL = file:// + bundlePath + fopHome + /fonts; setFontBaseURLMethod.invoke(fopFactory, new Object[]{fontsURL}); I suspect there is some subtle distinction between generating IF and PDF output? I get good results with this if the caller of my function is processed with fop-1.0. If the caller is processed by fop-0.95 the estimated size is much too large and I mis-size the region. In both cases the IF has 'font-name=any' so I'm a little surprised it work at all?! Any pointers on where I've messed up would be greatly appreciated. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: FOP EMPTY PDF
Not at all certain if this is your problem, but what about changing Source src = new StreamSource(args[4]); //I think you have opened two streams on args[4] to Source src = new JDOMSource(jdomDocument); //Are you making multiple files in that for loop? On 06/02/2011 04:43 PM, Oscar.Flores wrote: Hi thanks for the quick answer Rob i do some testing with the program EditiX to see if the stylesheet transform the xml to the pdf that i want and it does so i dont now if it is my code that is bad or something i post the code can you see it please later i will put the fo file public final class Main { public static void main(String[] args) throws Exception { try { File file = new File(args[0]); Comprobante comp = CFDv2.newComprobante(new FileInputStream(file)); CFDv2 cfd = new CFDv2(comp); PrivateKey key = KeyLoader.loadPKCS8PrivateKey(new FileInputStream(args[1]),(args[2])); X509Certificate cert = KeyLoader.loadX509Certificate(new FileInputStream(args[3])); Comprobante sellado = cfd.sellarComprobante(key, cert); String cadena = cfd.getCadenaOriginal(); String sello = sellado.getSello(); //System.out.println(sello); //System.out.println(cadena); //OutputStream archivo = new FileOutputStream(C:/F0008556FA.xml); //cfd.validar(); //cfd.verificar(); //cfd.guardar(); // Creamos el builder basado en SAX SAXBuilder builder = new SAXBuilder(); // Construimos el arbol DOM a partir del fichero xml Document documentJDOM = builder.build(new FileInputStream(args[0])); Element raiz = documentJDOM.getRootElement();//toma el nodo raiz del documento. raiz.setAttribute(sello, sello); raiz.setAttribute(certificado, sellado.getCertificado()); //System.out.println(raiz.getAttributeValue(sello)); //System.out.println(raiz.getAttributeValue(certificado)); // Recorremos los hijos de la etiqueta raíz ListElement hijosRaiz = raiz.getChildren(); boolean Bandera=false; for(Element hijo: hijosRaiz) { // Obtenemos el nombre y su contenido de tipo texto String nombre = hijo.getName(); if (nombre.equals(Addenda)) { ListElement subHijo = hijo.getChildren(); for(Element hij: subHijo) { hij.setAttribute(CadenaOriginal, cadena); //System.out.println(CadenaOriginal: +hij.getAttributeValue(CadenaOriginal)); Bandera=true; break; } } if (Bandera) { XMLOutputter out = new XMLOutputter(Format.getPrettyFormat()); File nuevoXML = new File(args[0]); try{ FileOutputStream archivoXML= new FileOutputStream (nuevoXML); out.output(documentJDOM, archivoXML); } catch (Exception ex){System.out.println(ex.getMessage());} // Para generar el pdf a partir de un archivo.xsl y un // archivo.xml } } FopFactory fopFactory = FopFactory.newInstance(); FOUserAgent foUserAgent = fopFactory.newFOUserAgent(); File pdffile = new File(args[5]); OutputStream out = new java.io.FileOutputStream(pdffile); out = new java.io.BufferedOutputStream(out); try { Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, out); TransformerFactory factory = TransformerFactory.newInstance(); Transformer transformer = factory.newTransformer(new StreamSource(args[4])); transformer.setParameter(versionParam, 2.0); Source src = new StreamSource(args[4]); Result res = new SAXResult(fop.getDefaultHandler()); System.setProperty(java.awt.headless, true); transformer.transform(src, res); } finally { out.close(); } System.out.println(Success!); } catch (Exception e) { e.printStackTrace(System.err); System.exit(-1); } } } Rob Sargent-4 wrote: Oscar, I think it might be more useful to post the fo file generated by the xslt transformation of you source xml file, often called the fo file. Given that you do get a pdf file with _some_ content, I suspect your stylesheet isn't doing what you want it to do. This should be evident in the fo file. On 06/02/2011 03:14 PM, Oscar.Flores wrote
Re: FOP EMPTY PDF
Looking at your external-graphics calls, some of the sizes seem strange to me. 20pt is a rather small space for a logo? But if all the files names are correct, you might try using content-width=scale-to-fit. On 06/03/2011 07:53 AM, Oscar.Flores wrote: Hi there Rob yeah it actually work Thanks the only thing that left its the images that has the have the pdf but it great jejeje, do you know what can i do about that?? Rob Sargent-4 wrote: Not at all certain if this is your problem, but what about changing Source src = new StreamSource(args[4]); //I think you have opened two streams on args[4] to Source src = new JDOMSource(jdomDocument); //Are you making multiple files in that for loop? On 06/02/2011 04:43 PM, Oscar.Flores wrote: Hi thanks for the quick answer Rob i do some testing with the program EditiX to see if the stylesheet transform the xml to the pdf that i want and it does so i dont now if it is my code that is bad or something i post the code can you see it please later i will put the fo file public final class Main { public static void main(String[] args) throws Exception { try { File file = new File(args[0]); Comprobante comp = CFDv2.newComprobante(new FileInputStream(file)); CFDv2 cfd = new CFDv2(comp); PrivateKey key = KeyLoader.loadPKCS8PrivateKey(new FileInputStream(args[1]),(args[2])); X509Certificate cert = KeyLoader.loadX509Certificate(new FileInputStream(args[3])); Comprobante sellado = cfd.sellarComprobante(key, cert); String cadena = cfd.getCadenaOriginal(); String sello = sellado.getSello(); //System.out.println(sello); //System.out.println(cadena); //OutputStream archivo = new FileOutputStream(C:/F0008556FA.xml); //cfd.validar(); //cfd.verificar(); //cfd.guardar(); // Creamos el builder basado en SAX SAXBuilder builder = new SAXBuilder(); // Construimos el arbol DOM a partir del fichero xml Document documentJDOM = builder.build(new FileInputStream(args[0])); Element raiz = documentJDOM.getRootElement();//toma el nodo raiz del documento. raiz.setAttribute(sello, sello); raiz.setAttribute(certificado, sellado.getCertificado()); //System.out.println(raiz.getAttributeValue(sello)); //System.out.println(raiz.getAttributeValue(certificado)); // Recorremos los hijos de la etiqueta raíz ListElement hijosRaiz = raiz.getChildren(); boolean Bandera=false; for(Element hijo: hijosRaiz) { // Obtenemos el nombre y su contenido de tipo texto String nombre = hijo.getName(); if (nombre.equals(Addenda)) { ListElement subHijo = hijo.getChildren(); for(Element hij: subHijo) { hij.setAttribute(CadenaOriginal, cadena); //System.out.println(CadenaOriginal: +hij.getAttributeValue(CadenaOriginal)); Bandera=true; break; } } if (Bandera) { XMLOutputter out = new XMLOutputter(Format.getPrettyFormat()); File nuevoXML = new File(args[0]); try{ FileOutputStream archivoXML= new FileOutputStream (nuevoXML); out.output(documentJDOM, archivoXML); } catch (Exception ex){System.out.println(ex.getMessage());} // Para generar el pdf a partir de un archivo.xsl y un // archivo.xml } } FopFactory fopFactory = FopFactory.newInstance(); FOUserAgent foUserAgent = fopFactory.newFOUserAgent(); File pdffile = new File(args[5]); OutputStream out = new java.io.FileOutputStream(pdffile); out = new java.io.BufferedOutputStream(out); try { Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, out); TransformerFactory factory = TransformerFactory.newInstance(); Transformer transformer = factory.newTransformer(new StreamSource(args[4])); transformer.setParameter(versionParam, 2.0); Source src = new StreamSource(args[4]); Result res = new SAXResult(fop.getDefaultHandler()); System.setProperty(java.awt.headless, true); transformer.transform(src, res); } finally { out.close
Re: Hair ripping time
That print statement will always be called since it's in the finally block. On 06/03/2011 09:27 AM, Theresa Jayne Forster wrote: This makes no sense its crashing out with no error on this line Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF,useragent,out); And it jumps straight to System.out.print(*); The code I am using is as follows public File generatePDFFromXml(File xslFile,File xmlFile) { FopFactory fopFactory = FopFactory.newInstance(); BufferedOutputStream out = null; File tempFile = null; try { fopFactory.setStrictValidation(false); DefaultConfigurationBuilder cfgBuilder = new DefaultConfigurationBuilder(); Configuration cfg = cfgBuilder.buildFromFile(new File(fopconfig.xml)); fopFactory.setUserConfig(cfg); tempFile = File.createTempFile(W2P, .pdf); out = new BufferedOutputStream(new FileOutputStream(tempFile)); FOUserAgent useragent= fopFactory.newFOUserAgent(); useragent.setOutputFile(tempFile); useragent.setTargetResolution(300); Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF,useragent,out); TransformerFactory factory = TransformerFactory.newInstance(); Source xslt = new StreamSource(xslFile); Transformer transformer = factory.newTransformer(xslt); Source src = new StreamSource(xmlFile); Result res = new SAXResult(fop.getDefaultHandler()); transformer.transform(src, res); out.flush(); out.close(); System.out.println(Output File = +tempFile.getAbsolutePath()); } catch (TransformerConfigurationException ex) { ex.printStackTrace(); } catch (TransformerException ex) { ex.printStackTrace(); } catch (FOPException ex) { ex.printStackTrace(); } catch (FileNotFoundException ex) { ex.printStackTrace(); } catch (IOException ex) { ex.printStackTrace(); } catch (Exception ex) { ex.printStackTrace(); } finally { try { System.out.print(*); out.close(); } catch (IOException ex) { } } return tempFile; } Kindest regards Theresa Forster Senior Software Developer ther...@inbrand.co.uk www.inbrand.co.uk Tel: 01483 266500 IMPORTANT NOTE: This transmission has been sent by or on behalf of In Brand Software Ltd. The information in this transmission is for the intended addressee only and is confidential to that intended addressee. If either you know or you ought reasonably to conclude that you are not, or may not be, the intended addressee, you are hereby given notice that any unauthorised dissemination or copying of this transmission and any disclosure or use of the information transmitted is strictly prohibited and may be illegal. In such circumstances we ask for your assistance in notifying us immediately by e-mail, telephone or letter. InBrand Software Ltd Registered in England No. 5131004 Registered Office: The Old Barn, Ewhurst Road, Cranleigh GU6 7EF -Original Message- From: Theresa Jayne Forster [mailto:ther...@inbrand.co.uk] Sent: 03 June 2011 15:42 To: fop-users@xmlgraphics.apache.org Subject: RE: Hair ripping time Tried that same result, it jumps immediately out of the try catch into the finally Kindest regards Theresa Forster Senior Software Developer Seems like you need: Transformer transformer = factory.newTransformer(); transformer.transform(new StreamSource(inputFO)); HTH! Regards Andreas --- - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1375 / Virus Database: 1509/3662 - Release Date: 05/26/11 Internal Virus Database is out of date. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1375 / Virus Database: 1509/3662 - Release Date: 05/26/11 Internal Virus Database is out of date. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: fop called in xslt extension is not finding fonts
Never mind. My first cut at putting the interface into the getMethod call was broken. Obviously reflection requires the interface explicitly, not the implementation. On 06/03/2011 11:17 AM, Rob Sargent wrote: I'm having trouble with XMLRender.mimicRenderer(Render) using fop-1.0 Unfortunately I have to do this all via reflection: Here's the broken part: Method getRendererFactory = userAgent.getClass().getMethod(getRendererFactory, null); Object rendererFactory = getRendererFactory.invoke(userAgent, null); Method createRenderer = rendererFactory.getClass().getMethod(createRenderer, userAgent.getClass(), String.class); Object targetRenderer = createRenderer.invoke(rendererFactory, userAgent, AbstractFop9xStage.FOP_MIMETYPE_DEFAULT); //Now the special renderer for the intermediate file (AreaText style) Class xmlRendererClass = getFopClassLoader().loadClass(org.apache.fop.render.xml.XMLRenderer); Constructor xmlRendererConstructor = xmlRendererClass.getConstructor(null); Object xmlRenderer = xmlRendererConstructor.newInstance(null); Method mimicMethod = xmlRendererClass.getMethod(mimicRenderer, targetRenderer.getClass()); mimicMethod.invoke(xmlRenderer, targetRenderer); //Make sure special renderer is used Method setRendererMethod = userAgent.getClass().getMethod(setRendererOverride, xmlRenderer.getClass()); setRendererMethod.invoke(userAgent, xmlRenderer); The error is: java.lang.NoSuchMethodException: org.apache.fop.render.xml.XMLRenderer.mimicRenderer(org.apache.fop.render.intermediate.IFRenderer) I'm not sure why I'm getting the IFRenderer, but I've checked that that class is an implementation of Renderer so I don't understand the error. If I don't enter the broken block the pdf is generated correctly. (I only want to enter the broken block when I'm trying to use the same fop to spit out a portion of the document: a table of which I need to find the on-page size.) On 06/02/2011 03:46 PM, Rob Sargent wrote: Naturally I should have been more clear in my original posting: I'm using the AreaTree (application/X-fop-areatree) intermediate format not the IF form (application/X-fop-intermediate-format). the AT form gives me an easy answer to content length. I've also re-read the doc on AT and have some hope of resolving the problem. We'll see. On 06/02/2011 09:57 AM, Rob Sargent wrote: Chris, Thanks. This looks like what I need. Now I have to work it into my switch-hitting fop runner! Cheers, rjs On 06/02/2011 09:35 AM, Chris Bowditch wrote: On 02/06/2011 08:47, mehdi houshmand wrote: Hi Rob, Hi Rob, Mehdi is right that the problem when generating IF is down to the way the fop.xconf is organized by Renderer. The command line option he mentions is the way to resolve this from the command line. The API code we use to set the Mimic Renderer (the renderer from which to lookup configuration for the IF Renderer in the fop.xconf) is shown below: IFDocumentHandler targetHandler = m_factory.getRendererFactory().createDocumentHandler(m_foUserAgent, mimeType); IFSerializer ifSerializer = new IFSerializer(); ifSerializer.setContext(new IFContext(m_foUserAgent)); ifSerializer.mimicDocumentHandler(targetHandler); HTH, Chris I just tested this on my system and I was finding the same results as you... When I set the output format to IF, FOP wasn't working. So anyway, I fixed it by setting the output MIME type, which is done via the command line as such: ./fop -c fop.xconf test.fo -ifinsert mime-type output.if so in my case it was: ./fop -c fop.xconf test.fo -if application/pdf output.if When you think about it, it does make sense. You refer to fonts in the fop.xconf as a child of their rendering output, which allows you to distinguish different font files according to the document output format. There wouldn't be any way of FOP knowing your desired FINAL output format if you were processing to IF. How you do that using FOPs API, I don't know, but I can't imagine that would be hard to find out. Mehdi On 1 June 2011 19:18, Rob Sargentrsarg...@xmission.com wrote: Again with thanks to Jeremias, I'm successfully sizing the region-before for dynamically generated tables. I'm doing this via and xslt extension function (Xalan style). The xslt extension calls my sizing function which employs fop-1.0 to generate an IF from the given dom.Node. I notice that during the function's invocation of fop-1.0 that the named fonts are not found and are substituted with any in the resultant intermediate format output, with font-size=1000 (), with log messages like 'Font Optima-Oblique,normal,700 not found. Substituting with any,normal,700'. I'm doubly confused because
Re: Problems with FOP and image
See the javadoc on IIORegistry. With ImageIO you may have to register your handler(s). What does ImageIO.getImageReadersBySuffix() give you. For certain jpegs we don't use ImageIO, rather the classes in com.sun.image.codec.jpeg: try { FileOutputStream fos = new FileOutputStream(file); JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(fos); JPEGEncodeParam param = encoder.getDefaultJPEGEncodeParam(image.getRaster(), JPEGDecodeParam.COLOR_ID_CMYK); param.setQuality(1, false); encoder.encode(image.getRaster(), param); fos.close(); } catch (Throwable t) { logger.debug(t.getMessage()); } But generally we use ImageIO On 06/06/2011 08:29 AM, Oscar.Flores wrote: Yeah i think i need your help again i tried tu run the .jar file in the console it work but without images this it what appears GRAVE: Error while processing image: I:\cfd\rfc.jpg (image/jpeg) org.apache.xmlgraphics.image.loader.ImageException: Cannot load image (no suitable loader/converter combination available) for I:\cfd\rfc.jpg (image/jpeg) i tried download the jai-imagio add to the class path but it dont work Rob Sargent-4 wrote: Very odd. I'm having no problems getting images into pdfs using fop-1.0. On 06/03/2011 11:04 AM, Oscar.Flores wrote: aaa hey thanks for the help the other day, i resolve the problem changing the version of FOP for the 0.95beta instead of the 1.0, it works now it prints the image and its good, thanks and we are in touch if anything else fails jejeje Rob Sargent-4 wrote: Nothing in the log from the transformer? On 06/03/2011 09:47 AM, Oscar.Flores wrote: hi there i have another problem i hope you can help me the pdf that i create with foe has no image, it dont show any of them, the xsl seems to be rigth i tested with EditX and the pdf show me the image, what can it be, i have xmlgraphics-commons-1.5svn, fop 1.0, fop-pdf-images 2.0.1 Snapshot for the render of the image but it don work please help!!! :,( - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Problems with FOP and image
On 06/06/2011 02:29 PM, Oscar.Flores wrote: Hi what can be the difference between execute the program in netbeans (where it works and print the images and the jar in the console) Different classes being loaded by Netbeans than the console app. Get Netbeans to show you the full classpath it's using in it's %classpath variable also i tried the imageIO.getImageReadersBySuffix but i cant interpretate the data y.y, its that or always its true in the boolean variable, and how can i register the handler?? Talk to IIORegistry, some thing like IIORegistry.getDefaultInstance().registerServiceProvider(new CLibJPEGImageReaderSpi()); IIORegistry.getDefaultInstance().registerServiceProvider(new CLibJPEGImageWriterSpi()); Note: those are not necessarily the services you have in your setup. Thanks Rob Sargent-4 wrote: See the javadoc on IIORegistry. With ImageIO you may have to register your handler(s). What does ImageIO.getImageReadersBySuffix() give you. For certain jpegs we don't use ImageIO, rather the classes in com.sun.image.codec.jpeg: try { FileOutputStream fos = new FileOutputStream(file); JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(fos); JPEGEncodeParam param = encoder.getDefaultJPEGEncodeParam(image.getRaster(), JPEGDecodeParam.COLOR_ID_CMYK); param.setQuality(1, false); encoder.encode(image.getRaster(), param); fos.close(); } catch (Throwable t) { logger.debug(t.getMessage()); } But generally we use ImageIO On 06/06/2011 08:29 AM, Oscar.Flores wrote: Yeah i think i need your help again i tried tu run the .jar file in the console it work but without images this it what appears GRAVE: Error while processing image: I:\cfd\rfc.jpg (image/jpeg) org.apache.xmlgraphics.image.loader.ImageException: Cannot load image (no suitable loader/converter combination available) for I:\cfd\rfc.jpg (image/jpeg) i tried download the jai-imagio add to the class path but it dont work Rob Sargent-4 wrote: Very odd. I'm having no problems getting images into pdfs using fop-1.0. On 06/03/2011 11:04 AM, Oscar.Flores wrote: aaa hey thanks for the help the other day, i resolve the problem changing the version of FOP for the 0.95beta instead of the 1.0, it works now it prints the image and its good, thanks and we are in touch if anything else fails jejeje Rob Sargent-4 wrote: Nothing in the log from the transformer? On 06/03/2011 09:47 AM, Oscar.Flores wrote: hi there i have another problem i hope you can help me the pdf that i create with foe has no image, it dont show any of them, the xsl seems to be rigth i tested with EditX and the pdf show me the image, what can it be, i have xmlgraphics-commons-1.5svn, fop 1.0, fop-pdf-images 2.0.1 Snapshot for the render of the image but it don work please help!!! :,( - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: NoSuchMethodError: org.apache.fop.fonts.FontInfo.setEventListener
Since you are using 1.0 you better find a newer take on embedding fonts. Maybe here http://xmlgraphics.apache.org/fop/trunk/fonts.html#embedding On 06/06/2011 03:28 PM, honyk wrote: Hello Everyone, I am trying to embed FOP into my app according to this article: http://xmlgraphics.apache.org/fop/0.95/embedding.html Actually, my code is here: public void createPDF(ArrayListFile inputFileList, File output) throws Exception { File foFile = createFO(inputFileList); FopFactory fopFactory = FopFactory.newInstance(); //fopFactory.getFontManager().setFontBaseURL(file:///D:); OutputStream out = new BufferedOutputStream(new FileOutputStream(output)); try { Fop fop = fopFactory.newFop(MimeConstants.MIME_FOP_PRINT, out); TransformerFactory factory = TransformerFactory.newInstance(); Transformer transformer = factory.newTransformer(); Source src = new StreamSource(foFile); Result res = new SAXResult(fop.getDefaultHandler()); transformer.transform(src, res); } finally { out.close(); } } When this method is called, I am getting Exception in thread main java.lang.NoSuchMethodError: org.apache.fop.fonts.FontInfo.setEventListener(Lorg/apache/fop/fonts/FontEve ntListener;)V at org.apache.fop.fo.FOEventHandler.init(FOEventHandler.java:84) at org.apache.fop.area.AreaTreeHandler.init(AreaTreeHandler.java:100) at org.apache.fop.render.RendererFactory.createFOEventHandler(RendererFactory.j ava:359) at org.apache.fop.fo.FOTreeBuilder.init(FOTreeBuilder.java:99) at org.apache.fop.apps.Fop.createDefaultHandler(Fop.java:147) at org.apache.fop.apps.Fop.init(Fop.java:82) at org.apache.fop.apps.FopFactory.newFop(FopFactory.java:271) at org.apache.fop.apps.FopFactory.newFop(FopFactory.java:248) at me.jan.Producer.createPDF(Producer.java:32) I have no idea what to check. I think it is related to fonts but that exception is not very clear to me. Win7/64bit, Java 1.6, Fop1.0 Regards, Jan - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Problems with FOP and image
ImageIO.write(bufferedImage, JPEG, file); On 06/07/2011 08:21 AM, Oscar.Flores wrote: Ok i actually register the handler now what i have to do is setup this handler or not?? and how can i do that, also it seem that the bmp its not recognice also what can i do?? thanks for the help rob also i am trying to convert the images to see if it that helps Rob Sargent-4 wrote: On 06/06/2011 02:29 PM, Oscar.Flores wrote: Hi what can be the difference between execute the program in netbeans (where it works and print the images and the jar in the console) Different classes being loaded by Netbeans than the console app. Get Netbeans to show you the full classpath it's using in it's %classpath variable also i tried the imageIO.getImageReadersBySuffix but i cant interpretate the data y.y, its that or always its true in the boolean variable, and how can i register the handler?? Talk to IIORegistry, some thing like IIORegistry.getDefaultInstance().registerServiceProvider(new CLibJPEGImageReaderSpi()); IIORegistry.getDefaultInstance().registerServiceProvider(new CLibJPEGImageWriterSpi()); Note: those are not necessarily the services you have in your setup. Thanks Rob Sargent-4 wrote: See the javadoc on IIORegistry. With ImageIO you may have to register your handler(s). What does ImageIO.getImageReadersBySuffix() give you. For certain jpegs we don't use ImageIO, rather the classes in com.sun.image.codec.jpeg: try { FileOutputStream fos = new FileOutputStream(file); JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(fos); JPEGEncodeParam param = encoder.getDefaultJPEGEncodeParam(image.getRaster(), JPEGDecodeParam.COLOR_ID_CMYK); param.setQuality(1, false); encoder.encode(image.getRaster(), param); fos.close(); } catch (Throwable t) { logger.debug(t.getMessage()); } But generally we use ImageIO On 06/06/2011 08:29 AM, Oscar.Flores wrote: Yeah i think i need your help again i tried tu run the .jar file in the console it work but without images this it what appears GRAVE: Error while processing image: I:\cfd\rfc.jpg (image/jpeg) org.apache.xmlgraphics.image.loader.ImageException: Cannot load image (no suitable loader/converter combination available) for I:\cfd\rfc.jpg (image/jpeg) i tried download the jai-imagio add to the class path but it dont work Rob Sargent-4 wrote: Very odd. I'm having no problems getting images into pdfs using fop-1.0. On 06/03/2011 11:04 AM, Oscar.Flores wrote: aaa hey thanks for the help the other day, i resolve the problem changing the version of FOP for the 0.95beta instead of the 1.0, it works now it prints the image and its good, thanks and we are in touch if anything else fails jejeje Rob Sargent-4 wrote: Nothing in the log from the transformer? On 06/03/2011 09:47 AM, Oscar.Flores wrote: hi there i have another problem i hope you can help me the pdf that i create with foe has no image, it dont show any of them, the xsl seems to be rigth i tested with EditX and the pdf show me the image, what can it be, i have xmlgraphics-commons-1.5svn, fop 1.0, fop-pdf-images 2.0.1 Snapshot for the render of the image but it don work please help!!! :,( - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org :-):confused::confused::confused::confused:=) - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Problems with FOP and image
Since you're now into xmlgraphics, I think you're best bet is here http://xmlgraphics.apache.org/commons/image-loader.html On 06/07/2011 10:18 AM, Oscar.Flores wrote: Hi ok this is for generate images that dont need to be decompress later?? and the result image i put in my xsl ?? then it should work, aaa i change to fop 1.0 and xml communs 1.4 and its the same jejeje dont find the image preload org.apache.fop.fo.flow.ExternalGraphic bind SEVERE: Image not available: The file format is not supported. No ImagePreloader for *.jpg or *.bmp Rob Sargent-4 wrote: ImageIO.write(bufferedImage, JPEG, file); On 06/07/2011 08:21 AM, Oscar.Flores wrote: Ok i actually register the handler now what i have to do is setup this handler or not?? and how can i do that, also it seem that the bmp its not recognice also what can i do?? thanks for the help rob also i am trying to convert the images to see if it that helps Rob Sargent-4 wrote: On 06/06/2011 02:29 PM, Oscar.Flores wrote: Hi what can be the difference between execute the program in netbeans (where it works and print the images and the jar in the console) Different classes being loaded by Netbeans than the console app. Get Netbeans to show you the full classpath it's using in it's %classpath variable also i tried the imageIO.getImageReadersBySuffix but i cant interpretate the data y.y, its that or always its true in the boolean variable, and how can i register the handler?? Talk to IIORegistry, some thing like IIORegistry.getDefaultInstance().registerServiceProvider(new CLibJPEGImageReaderSpi()); IIORegistry.getDefaultInstance().registerServiceProvider(new CLibJPEGImageWriterSpi()); Note: those are not necessarily the services you have in your setup. Thanks Rob Sargent-4 wrote: See the javadoc on IIORegistry. With ImageIO you may have to register your handler(s). What does ImageIO.getImageReadersBySuffix() give you. For certain jpegs we don't use ImageIO, rather the classes in com.sun.image.codec.jpeg: try { FileOutputStream fos = new FileOutputStream(file); JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(fos); JPEGEncodeParam param = encoder.getDefaultJPEGEncodeParam(image.getRaster(), JPEGDecodeParam.COLOR_ID_CMYK); param.setQuality(1, false); encoder.encode(image.getRaster(), param); fos.close(); } catch (Throwable t) { logger.debug(t.getMessage()); } But generally we use ImageIO On 06/06/2011 08:29 AM, Oscar.Flores wrote: Yeah i think i need your help again i tried tu run the .jar file in the console it work but without images this it what appears GRAVE: Error while processing image: I:\cfd\rfc.jpg (image/jpeg) org.apache.xmlgraphics.image.loader.ImageException: Cannot load image (no suitable loader/converter combination available) for I:\cfd\rfc.jpg (image/jpeg) i tried download the jai-imagio add to the class path but it dont work Rob Sargent-4 wrote: Very odd. I'm having no problems getting images into pdfs using fop-1.0. On 06/03/2011 11:04 AM, Oscar.Flores wrote: aaa hey thanks for the help the other day, i resolve the problem changing the version of FOP for the 0.95beta instead of the 1.0, it works now it prints the image and its good, thanks and we are in touch if anything else fails jejeje Rob Sargent-4 wrote: Nothing in the log from the transformer? On 06/03/2011 09:47 AM, Oscar.Flores wrote: hi there i have another problem i hope you can help me the pdf that i create with foe has no image, it dont show any of them, the xsl seems to be rigth i tested with EditX and the pdf show me the image, what can it be, i have xmlgraphics-commons-1.5svn, fop 1.0, fop-pdf-images 2.0.1 Snapshot for the render of the image but it don work please help!!! :,( - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org :-):confused::confused::confused::confused:=) - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: fop called in xslt extension is not finding fonts
OK, my code is OK, but my fop config file didn't have an entry for the at-xml renderer. I simply duplicated the pdf renderer and the fonts are fine. On 06/03/2011 03:19 PM, Rob Sargent wrote: Never mind. My first cut at putting the interface into the getMethod call was broken. Obviously reflection requires the interface explicitly, not the implementation. On 06/03/2011 11:17 AM, Rob Sargent wrote: I'm having trouble with XMLRender.mimicRenderer(Render) using fop-1.0 Unfortunately I have to do this all via reflection: Here's the broken part: Method getRendererFactory = userAgent.getClass().getMethod(getRendererFactory, null); Object rendererFactory = getRendererFactory.invoke(userAgent, null); Method createRenderer = rendererFactory.getClass().getMethod(createRenderer, userAgent.getClass(), String.class); Object targetRenderer = createRenderer.invoke(rendererFactory, userAgent, AbstractFop9xStage.FOP_MIMETYPE_DEFAULT); //Now the special renderer for the intermediate file (AreaText style) Class xmlRendererClass = getFopClassLoader().loadClass(org.apache.fop.render.xml.XMLRenderer); Constructor xmlRendererConstructor = xmlRendererClass.getConstructor(null); Object xmlRenderer = xmlRendererConstructor.newInstance(null); Method mimicMethod = xmlRendererClass.getMethod(mimicRenderer, targetRenderer.getClass()); mimicMethod.invoke(xmlRenderer, targetRenderer); //Make sure special renderer is used Method setRendererMethod = userAgent.getClass().getMethod(setRendererOverride, xmlRenderer.getClass()); setRendererMethod.invoke(userAgent, xmlRenderer); The error is: java.lang.NoSuchMethodException: org.apache.fop.render.xml.XMLRenderer.mimicRenderer(org.apache.fop.render.intermediate.IFRenderer) I'm not sure why I'm getting the IFRenderer, but I've checked that that class is an implementation of Renderer so I don't understand the error. If I don't enter the broken block the pdf is generated correctly. (I only want to enter the broken block when I'm trying to use the same fop to spit out a portion of the document: a table of which I need to find the on-page size.) On 06/02/2011 03:46 PM, Rob Sargent wrote: Naturally I should have been more clear in my original posting: I'm using the AreaTree (application/X-fop-areatree) intermediate format not the IF form (application/X-fop-intermediate-format). the AT form gives me an easy answer to content length. I've also re-read the doc on AT and have some hope of resolving the problem. We'll see. On 06/02/2011 09:57 AM, Rob Sargent wrote: Chris, Thanks. This looks like what I need. Now I have to work it into my switch-hitting fop runner! Cheers, rjs On 06/02/2011 09:35 AM, Chris Bowditch wrote: On 02/06/2011 08:47, mehdi houshmand wrote: Hi Rob, Hi Rob, Mehdi is right that the problem when generating IF is down to the way the fop.xconf is organized by Renderer. The command line option he mentions is the way to resolve this from the command line. The API code we use to set the Mimic Renderer (the renderer from which to lookup configuration for the IF Renderer in the fop.xconf) is shown below: IFDocumentHandler targetHandler = m_factory.getRendererFactory().createDocumentHandler(m_foUserAgent, mimeType); IFSerializer ifSerializer = new IFSerializer(); ifSerializer.setContext(new IFContext(m_foUserAgent)); ifSerializer.mimicDocumentHandler(targetHandler); HTH, Chris I just tested this on my system and I was finding the same results as you... When I set the output format to IF, FOP wasn't working. So anyway, I fixed it by setting the output MIME type, which is done via the command line as such: ./fop -c fop.xconf test.fo -ifinsert mime-type output.if so in my case it was: ./fop -c fop.xconf test.fo -if application/pdf output.if When you think about it, it does make sense. You refer to fonts in the fop.xconf as a child of their rendering output, which allows you to distinguish different font files according to the document output format. There wouldn't be any way of FOP knowing your desired FINAL output format if you were processing to IF. How you do that using FOPs API, I don't know, but I can't imagine that would be hard to find out. Mehdi On 1 June 2011 19:18, Rob Sargentrsarg...@xmission.com wrote: Again with thanks to Jeremias, I'm successfully sizing the region-before for dynamically generated tables. I'm doing this via and xslt extension function (Xalan style). The xslt extension calls my sizing function which employs fop-1.0 to generate an IF from the given dom.Node. I notice that during the function's invocation of fop-1.0 that the named fonts are not found and are substituted with any in the resultant intermediate format output, with font-size=1000 (), with log messages like 'Font Optima-Oblique,normal,700 not found. Substituting with any,normal,700'. I'm doubly confused because the fo is ultimately processed to pdf
Re: Problems with FOP and image
I suspect running from your jar does not have/use the same classpath that is in effect while you're in the debugger. By what mechanism do you generate the jar? Is it an executable jar or are you running java -classpath your-jar-here:other-jars Main? Make your IDE (netbeans) display the classpath it uses to run your app and compare that with the above. On 06/09/2011 07:21 PM, Oscar.Flores wrote: aaa ok well my problem is that when i do the pdf in netbean the pdf is fine with images and evething but when i run the jar file in command it give me a error GRAVE: Error while processing image: I:\cfd\rfc.jpg (image/jpeg) org.apache.xmlgraphics.image.loader.ImageException: Cannot load image (no suitable loader/converter combination available) for I:\cfd\rfc.jpg (image/jpeg) so i dont no what its not working and if i have to add something to my code so the images can load i am s desperate what i am doing wrong?? i am sorry for the trouble and if a dont explain my self very good jejeje Rob Sargent-4 wrote: Not at all sure what your problem is. All I can do is show you what works for us. Our source xml looks like this: image image-id=381623861 reference-id=ref-220 width=750 height=750 image-space-id=space-1 position=5 image-pool-position=31 pos=4 file=ref_10_1002108221 !-- an actual file (.jpeg copied the working directory of the transformer -- fields / caption / annotations arrow_positions origHeight=750 origWidth=750 / /annotations /image Our xslt looks like this for each image needed. xsl:template name=image xsl:param name=img/ !-- This is the xml node from the source xml above -- xsl:param name=width/ xsl:param name=height select=$width/ xsl:param name=ignoreHeightfalse/xsl:param fo:block fo:external-graphic src={$img/@file} height={$height} width={$width} content-height=scale-to-fit content-width=scale-to-fit border=0.5pt solid black border-collapse=separate xsl:if test=$ignoreHeight != 'true' xsl:attribute name=height xsl:value-of select=$height/ /xsl:attribute /xsl:if /fo:external-graphic /fo:block /xsl:template Our generated fo looks like this: fo:table-cell fo:block fo:external-graphic border-collapse=separate border=0.5pt solid black content-width=scale-to-fit content-height=scale-to-fit width=2.5in height=2.5in src=ref_10_1002108221 / /fo:block /fo:table-cell And the generated pdfs include the image and are shipped to the printer. How does this stack up with what you have? On 06/09/2011 01:19 PM, Oscar.Flores wrote: Hi there well i still got the problem but searching IN INTERNET i find a JPEG renderer output for FOP its here http://marc.info/?l=fop-userm=125986752706366w=2 the cuestion is can i render the image that i want to put in the pdf, and then add to the xsl the render jpeg it will work?? and here explaints how use the render when he say uses fop as normal case what does it mean what else have to add to the code?? i hope you can help me Thanks!! // OutputStream out = what you want FopFactory fopFactory = FopFactory.newInstance(); RendererFactory rendererFactory = null; FOUserAgent foUserAgent = null; rendererFactory = fopFactory.getRendererFactory(); rendererFactory.addRendererMaker(new MultiRendererMaker(jpeg)); foUserAgent = fopFactory.newFOUserAgent(); rendererFactory.createRenderer(foUserAgent, image/jpeg); Fop fop = fopFactory.newFop(image/jpeg, foUserAgent, out); //Use fop as normal case Rob Sargent-4 wrote: Since you're now into xmlgraphics, I think you're best bet is here http://xmlgraphics.apache.org/commons/image-loader.html On 06/07/2011 10:18 AM, Oscar.Flores wrote: Hi ok this is for generate images that dont need to be decompress later?? and the result image i put in my xsl ?? then it should work, aaa i change to fop 1.0 and xml communs 1.4 and its the same jejeje dont find the image preload org.apache.fop.fo.flow.ExternalGraphic bind SEVERE: Image not available: The file format is not supported. No ImagePreloader for *.jpg or *.bmp Rob Sargent-4 wrote: ImageIO.write(bufferedImage, JPEG, file); On 06/07/2011 08:21 AM, Oscar.Flores wrote: Ok i actually register the handler now what i have to do is setup this handler or not?? and how can i do that, also it seem that the bmp its not recognice also what can i do?? thanks for the help rob also i am trying to convert the images to see if it that helps Rob Sargent-4 wrote: On 06/06/2011 02:29 PM, Oscar.Flores wrote: Hi what can be the difference between execute the program in netbeans (where it works and print the images and the jar in the console) Different classes being loaded by Netbeans than the console app. Get Netbeans to show you the full classpath it's using in it's %classpath variable also i tried the imageIO.getImageReadersBySuffix but i cant interpretate the data y.y, its that or always its true
How to determine which block are fo:table-row from XML-AT output?
Wondering if it's possible to programmatically identify which blocks in the areatree output correspond to fo:table-row calls, given that the entire page is a single fo:table. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: How to determine which block are fo:table-row from XML-AT output?
Thanks Vincent. Related to the flow-sideways issue. A stab at an alternative: was hoping grab to the block progression value of the row. Consider this thread closed, though I find the news that fo:table-row calls don't generate area both enlightening and confusing. On 06/10/2011 10:28 AM, Vincent Hennebert wrote: Hi Rob, On 10/06/11 17:12, Rob Sargent wrote: Wondering if it's possible to programmatically identify which blocks in the areatree output correspond to fo:table-row calls, given that the entire page is a single fo:table. There’s no way AFAICT, as an fo:table-row element does not generate any area. What exactly do you need to do? Vincent - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: flow sideways
Vincent, thank you again. You have probably solved this for me (once I truly grok the power of indent). Cheers, rjs On 06/10/2011 10:23 AM, Vincent Hennebert wrote: Hi Rob, (Sorry for the delay.) On 01/06/11 00:30, Rob Sargent wrote: I have a table of data which is designed to span across two facing pages. Thanks to the tip from Jeremias Maerki I can size the tables perfectly and allot the correct space in the region-before or each page. But how do I get the table to break across the two pages nicely? Since the definition of each line's depth my be determined by any column I cannot lay the two halves out separately. It would be cool if it would just flow nicely all by itself but that's not quite how flow works far as I know. Perhaps I could lay the entire table in both region and have it truncate the left/right overflow? That seems to me like the best way to achieve what you want. Normally you just have to play with start-indent and end-indent on the table. You can even set the other indent (end-indent or start-indent) to a negative value to avoid FOP warnings. Something like this: • for even pages: fo:table table-layout=fixed width=200% start-indent=0 end-indent=-100% fo:table-header start-indent=0 end-indent=0 ... /fo:table-header fo:table-body start-indent=0 end-indent=0 ... /fo:table-body /fo:table • for odd pages: fo:table table-layout=fixed width=200% start-indent=-100% end-indent=0 fo:table-header start-indent=0 end-indent=0 ... /fo:table-header fo:table-body start-indent=0 end-indent=0 ... /fo:table-body /fo:table (You may have to adjust the width of the table a bit to account for its borders.) Seems possible for the left page, but would it work for the right hand page. i.e. Can one force the region to in essence fill from the right. Or is there a correct way to accomplish this? All pointer welcome, rjs HTH, Vincent - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: How to determine which block are fo:table-row from XML-AT output?
Hello Andreas, Thanks for the clarification and spec. reference. On 06/10/2011 10:49 AM, Andreas L. Delmelle wrote: On 10 Jun 2011, at 18:40, Rob Sargent wrote: Hi Rob snip / Consider this thread closed, though I find the news that fo:table-row calls don't generate area both enlightening and confusing. It is literally defined so in the Recommendation: see Areas at http://www.w3.org/TR/xsl/#fo_table-row. I can see what you mean. It does make perfect sense, but from FOP perspective, also poses the challenge of properly implementing id on fo:table-row... Since there is no area to attach the id to, we currently have no location in the area tree that ref-ids can point to. Regards Andreas --- - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Problems with FOP and image
Do you have a config file for log4j. Usually it's in a resource tree. Are you copying that to your deployment? Is your ant script including the config file in the jar of your application? On 06/13/2011 10:12 AM, Oscar.Flores wrote: Ok yeah the log4j its having isuees to find the configuration log4j:WARN No appenders could be found for logger (org.apache.fop.util.ContentHandlerFactoryRegistry). log4j:WARN Please initialize the log4j system properly. log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info. i go to the faq guide and it say try loading the class or resource yourself. If you can't find it, neither will log4j. aaa i dont know where to set this also here its my xlst http://old.nabble.com/file/p31835645/FacturasOMF.xsl FacturasOMF.xsl and the fo file that generate the editix http://old.nabble.com/file/p31835645/Prueba.fo Prueba.fo Rob Sargent-4 wrote: The first thing is to really dig into what you did to netbeans to get it to work... I've forgotten what your stylesheet looked like, so maybe if you show us again how you're referencing your images we might notice a problem. It might also help to see the fo generated during your transformation. Can you grab that just after xslt and just before fop calls. Are you sure there is no error being logged somewhere when you run from the command line? (Where is log4j writing and at what level?) Oscar.Flores wrote: You where absolutly rigth i miss a few libraries to add into the jar file, i modified the build.xml to add the package and jar that i need, now the error message is not there but still the images dont show in the pdf i remeber that i do something in netbeans so they can add to the pdf but i cant remeber i dont now if there is still a library that is missing or i am adding more than it should be This is what i use : cfdi-base-0.1.6-SNAPSHOT.jar guava-r09.jar guava-r09-gwt.jar jaxb-impl-2.1.10.jar avalon-framework-api-4.3.jar avalon-framework-cvs-20020806.jar avalon-logkit-2.1.jar not-yet-commons-ssl-0.3.11.jar commons-codec-1.5.jar commons-codec-1.5-sources.jar log4j-1.2.16.jar fop.jar jdom.jar xmlgraphics-commons-1.4.jar commons-io-1.3.1.jar fop-pdf-images-2.0.1.SNAPSHOT.jar pdfbox-app-1.5.0.jar fontbox-1.3.1.jar jempbox-1.3.1.jar xercesImpl-2.7.1.jar batik-all-1.7.jar xml-apis-1.3.04.jar xml-apis-ext-1.3.04.jar avalon-framework-4.2.0.jar xalan-2.7.0.jar serializer-2.7.0.jar commons-logging-1.0.4.jar jai_codec.jar jai_core.jar batik-ext.jar jai_imageio-1.1-sources.jar Thanks Rob for the help Rob Sargent-4 wrote: I suspect running from your jar does not have/use the same classpath that is in effect while you're in the debugger. By what mechanism do you generate the jar? Is it an executable jar or are you running java -classpath your-jar-here:other-jars Main? Make your IDE (netbeans) display the classpath it uses to run your app and compare that with the above. On 06/09/2011 07:21 PM, Oscar.Flores wrote: aaa ok well my problem is that when i do the pdf in netbean the pdf is fine with images and evething but when i run the jar file in command it give me a error GRAVE: Error while processing image: I:\cfd\rfc.jpg (image/jpeg) org.apache.xmlgraphics.image.loader.ImageException: Cannot load image (no suitable loader/converter combination available) for I:\cfd\rfc.jpg (image/jpeg) so i dont no what its not working and if i have to add something to my code so the images can load i am s desperate what i am doing wrong?? i am sorry for the trouble and if a dont explain my self very good jejeje Rob Sargent-4 wrote: Not at all sure what your problem is. All I can do is show you what works for us. Our source xml looks like this: image image-id=381623861 reference-id=ref-220 width=750 height=750 image-space-id=space-1 position=5 image-pool-position=31 pos=4 file=ref_10_1002108221 !-- an actual file (.jpeg copied the working directory of the transformer -- fields / caption / annotations arrow_positions origHeight=750 origWidth=750 / /annotations /image Our xslt looks like this for each image needed. xsl:template name=image xsl:param name=img/ !-- This is the xml node from the source xml above -- xsl:param name=width/ xsl:param name=height select=$width/ xsl:param name=ignoreHeightfalse/xsl:param fo:block fo:external-graphic src={$img/@file} height={$height} width={$width} content-height=scale-to-fit content-width=scale-to-fit border=0.5pt solid black border-collapse=separate xsl:if test=$ignoreHeight != 'true' xsl:attribute name=height xsl:value-of select=$height/ /xsl:attribute /xsl:if /fo:external-graphic /fo:block /xsl:template Our generated fo looks like this: fo:table-cell fo:block fo:external-graphic border-collapse=separate border=0.5pt solid black content-width=scale-to-fit content-height=scale-to-fit width=2.5in height=2.5in src=ref_10_1002108221 / /fo:block /fo:table-cell
Re: Problems with FOP and image
Try this log4j.xml: Place it at the root of your jar file ?xml version=1.0 encoding=UTF-8? !DOCTYPE log4j:configuration SYSTEM log4j.dtd log4j:configuration xmlns:log4j=http://jakarta.apache.org/log4j/; debug=false appender name=CONSOLE class=org.apache.log4j.ConsoleAppender param name=Target value=System.out/ param name=Threshold value=DEBUG/ layout class=org.apache.log4j.PatternLayout param name=ConversionPattern value=%d{ABSOLUTE} %-5p [%c{1}] %m%n/ /layout /appender category name=org priority value=DEBUG/ /category category name=org.apache priority value=WARN/ /category category name=org.springframework priority value=WARN/ /category category name=org.hibernate priority value=DEBUG/ /category category name=net priority value=ERROR/ /category category name=javax priority value=ERROR/ /category category name=java priority value=ERROR/ /category category name=sun priority value=ERROR/ /category category name=org.jboss priority value=INFO/ /category category name=org.jboss.seam priority value=ERROR/ /category root appender-ref ref=CONSOLE/ /root /log4j:configuration On 06/13/2011 11:06 AM, Oscar.Flores wrote: ok i dont thik i have a configuracion file i find the code that i put in the other post i think its the basic Rob Sargent-4 wrote: Do you have a config file for log4j. Usually it's in a resource tree. Are you copying that to your deployment? Is your ant script including the config file in the jar of your application? On 06/13/2011 10:12 AM, Oscar.Flores wrote: Ok yeah the log4j its having isuees to find the configuration log4j:WARN No appenders could be found for logger (org.apache.fop.util.ContentHandlerFactoryRegistry). log4j:WARN Please initialize the log4j system properly. log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info. i go to the faq guide and it say try loading the class or resource yourself. If you can't find it, neither will log4j. aaa i dont know where to set this also here its my xlst http://old.nabble.com/file/p31835645/FacturasOMF.xsl FacturasOMF.xsl and the fo file that generate the editix http://old.nabble.com/file/p31835645/Prueba.fo Prueba.fo Rob Sargent-4 wrote: The first thing is to really dig into what you did to netbeans to get it to work... I've forgotten what your stylesheet looked like, so maybe if you show us again how you're referencing your images we might notice a problem. It might also help to see the fo generated during your transformation. Can you grab that just after xslt and just before fop calls. Are you sure there is no error being logged somewhere when you run from the command line? (Where is log4j writing and at what level?) Oscar.Flores wrote: You where absolutly rigth i miss a few libraries to add into the jar file, i modified the build.xml to add the package and jar that i need, now the error message is not there but still the images dont show in the pdf i remeber that i do something in netbeans so they can add to the pdf but i cant remeber i dont now if there is still a library that is missing or i am adding more than it should be This is what i use : cfdi-base-0.1.6-SNAPSHOT.jar guava-r09.jar guava-r09-gwt.jar jaxb-impl-2.1.10.jar avalon-framework-api-4.3.jar avalon-framework-cvs-20020806.jar avalon-logkit-2.1.jar not-yet-commons-ssl-0.3.11.jar commons-codec-1.5.jar commons-codec-1.5-sources.jar log4j-1.2.16.jar fop.jar jdom.jar xmlgraphics-commons-1.4.jar commons-io-1.3.1.jar fop-pdf-images-2.0.1.SNAPSHOT.jar pdfbox-app-1.5.0.jar fontbox-1.3.1.jar jempbox-1.3.1.jar xercesImpl-2.7.1.jar batik-all-1.7.jar xml-apis-1.3.04.jar xml-apis-ext-1.3.04.jar avalon-framework-4.2.0.jar xalan-2.7.0.jar serializer-2.7.0.jar commons-logging-1.0.4.jar jai_codec.jar jai_core.jar batik-ext.jar jai_imageio-1.1-sources.jar Thanks Rob for the help Rob Sargent-4 wrote: I suspect running from your jar does not have/use the same classpath that is in effect while you're in the debugger. By what mechanism do you generate the jar? Is it an executable jar or are you running java -classpath your-jar-here:other-jars Main? Make your IDE (netbeans) display the classpath it uses to run your app and compare that with the above. On 06/09/2011 07:21 PM, Oscar.Flores wrote: aaa ok well my problem is that when i do the pdf in netbean the pdf is fine with images and evething but when i run the jar file in command it give me a error GRAVE: Error while processing image: I:\cfd\rfc.jpg (image/jpeg) org.apache.xmlgraphics.image.loader.ImageException: Cannot load image (no suitable loader/converter combination available) for I:\cfd\rfc.jpg (image/jpeg) so i dont no what its not working and if i have to add something to my code so the images can load i am s desperate what i am doing wrong?? i am sorry for the trouble and if a dont explain my self very good jejeje Rob Sargent-4 wrote: Not at all sure what your problem is. All I can do is show you what works for us. Our source
Re: Problems with FOP and image
foUserAgent as desired // Setup output File pdffile = new File(args[5]); OutputStream out = new java.io.FileOutputStream(pdffile); out = new java.io.BufferedOutputStream(out); try { // Construct fop with desired output format Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, out); // Setup XSLT TransformerFactory factory = TransformerFactory.newInstance(); Transformer transformer = factory.newTransformer(new StreamSource(args[4])); // Set the value of a in the stylesheet transformer.setParameter(versionParam, 2.0); // Setup input for XSLT transformation Source src = new JDOMSource(documentJDOM); // Resulting SAX events (the generated FO) must be piped through to FOP Result res = new SAXResult(fop.getDefaultHandler()); // Start XSLT transformation and FOP processing // System.setProperty(java.awt.headless, true); transformer.transform(src, res); } finally { out.close(); } System.out.println(Success!); } catch (Exception e) { e.printStackTrace(System.err); System.exit(-1); } logger.info(Exiting application.); } Rob Sargent-4 wrote: Try this log4j.xml: Place it at the root of your jar file ?xml version=1.0 encoding=UTF-8? !DOCTYPE log4j:configuration SYSTEM log4j.dtd log4j:configuration xmlns:log4j=http://jakarta.apache.org/log4j/; debug=false appender name=CONSOLE class=org.apache.log4j.ConsoleAppender layout class=org.apache.log4j.PatternLayout /layout /appender category name=org priority value=DEBUG/ /category category name=org.apache priority value=WARN/ /category category name=org.springframework priority value=WARN/ /category category name=org.hibernate priority value=DEBUG/ /category category name=net priority value=ERROR/ /category category name=javax priority value=ERROR/ /category category name=java priority value=ERROR/ /category category name=sun priority value=ERROR/ /category category name=org.jboss priority value=INFO/ /category category name=org.jboss.seam priority value=ERROR/ /category root appender-ref ref=CONSOLE/ /root /log4j:configuration On 06/13/2011 11:06 AM, Oscar.Flores wrote: ok i dont thik i have a configuracion file i find the code that i put in the other post i think its the basic Rob Sargent-4 wrote: Do you have a config file for log4j. Usually it's in a resource tree. Are you copying that to your deployment? Is your ant script including the config file in the jar of your application? On 06/13/2011 10:12 AM, Oscar.Flores wrote: Ok yeah the log4j its having isuees to find the configuration log4j:WARN No appenders could be found for logger (org.apache.fop.util.ContentHandlerFactoryRegistry). log4j:WARN Please initialize the log4j system properly. log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info. i go to the faq guide and it say try loading the class or resource yourself. If you can't find it, neither will log4j. aaa i dont know where to set this also here its my xlst http://old.nabble.com/file/p31835645/FacturasOMF.xsl FacturasOMF.xsl and the fo file that generate the editix http://old.nabble.com/file/p31835645/Prueba.fo Prueba.fo Rob Sargent-4 wrote: The first thing is to really dig into what you did to netbeans to get it to work... I've forgotten what your stylesheet looked like, so maybe if you show us again how you're referencing your images we might notice a problem. It might also help to see the fo generated during your transformation. Can you grab that just after xslt and just before fop calls. Are you sure there is no error being logged somewhere when you run from the command line? (Where is log4j writing and at what level?) Oscar.Flores wrote: You where absolutly rigth i miss a few libraries to add into the jar file, i modified the build.xml to add the package and jar that i need, now the error message is not there but still the images dont show in the pdf i remeber that i do something in netbeans so they can add to the pdf but i cant remeber i dont now if there is still a library that is missing or i am adding more than it should be This is what i use : cfdi-base-0.1.6-SNAPSHOT.jar guava-r09.jar guava-r09-gwt.jar jaxb-impl-2.1.10.jar avalon-framework-api-4.3.jar avalon-framework-cvs-20020806.jar avalon-logkit-2.1.jar not-yet-commons-ssl-0.3.11.jar commons-codec-1.5.jar commons-codec-1.5-sources.jar log4j-1.2.16.jar fop.jar jdom.jar xmlgraphics-commons-1.4.jar commons-io-1.3.1.jar fop-pdf-images-2.0.1.SNAPSHOT.jar pdfbox-app-1.5.0.jar fontbox-1.3.1.jar jempbox-1.3.1.jar xercesImpl-2.7.1.jar batik-all-1.7.jar xml-apis-1.3.04.jar xml-apis-ext-1.3.04.jar avalon-framework-4.2.0.jar xalan
Re: Problems with FOP and image
I'm not sure I'm following correctly: does removing the xmlgraphics jar cause netbeans to behave the same as the command-line run of you app? If so, I suspect netbeans is registering services for you. Your own code will have to make a call to one of the IIORegistry.registerServiceProvider() methods. On 06/13/2011 05:02 PM, Oscar.Flores wrote: Ok i get it, actually the ImageIO library i added because i read in the xmlgrapics that if something like the message org.apache.xmlgraphics.image.loader.ImageException: Cannot load image (no suitable loader/converter combination available)appear i have to add the jar file to the classpath but that all it say no configuration or anything, then i delete the imagenIO libs and still i have the same output in netbeans so xmlgrapics seem to have the problem in the plugins or i have to configure something Rob Sargent-4 wrote: Then it seems to me netbeans (if it's producing good output == assumptionA) is still using something that the command-line isn't. And given assumptionA, you're java code is correct in terms of FOP and your configuration isn't for ImageIO. Show your ImageIO related code and are you sure it's in your app. Use the logger to show a message when you add your loader. Or list all ImageIO services: IIORegistry.getServiceProviders() On 06/13/2011 03:01 PM, Oscar.Flores wrote: ok well i put the xml in scr of my proyect i see that i still have the same issues of the image render of any image i dont now if the xml its in place i put the code down to see if something its missing 15:45:07,827 ERROR [render] Error while processing image: c:\cfd\nombregp.bmp (i mage/bmp) org.apache.xmlgraphics.image.loader.ImageException: Cannot load image (no suitab le loader/converter combination available) for c:\cfd\nombregp.bmp (image/bmp) at org.apache.xmlgraphics.image.loader.ImageManager.getImage(ImageManage import mx.bigdata.sat.cfd.schema.Comprobante; import mx.bigdata.sat.cfd.CFDv2; import mx.bigdata.sat.security.KeyLoader; import org.jdom.*; import org.jdom.input.SAXBuilder; import org.jdom.output.XMLOutputter; import org.jdom.output.Format; import org.jdom.transform.JDOMSource; //Java import java.io.File; import java.io.OutputStream; //JAXP import javax.xml.transform.Transformer; import javax.xml.transform.TransformerFactory; import javax.xml.transform.Source; import javax.xml.transform.Result; import javax.xml.transform.stream.StreamSource; import javax.xml.transform.sax.SAXResult; //FOP import org.apache.fop.apps.FOUserAgent; import org.apache.fop.apps.Fop; import org.apache.fop.apps.FopFactory; import org.apache.fop.apps.MimeConstants; //log4j import org.apache.log4j.*; import org.apache.log4j.xml.DOMConfigurator; public final class Main { @SuppressWarnings(unchecked) static Logger logger = Logger.getLogger(Main.class); public static void main(String[] args) throws Exception { DOMConfigurator.configure(D:/Mis documentos/NetBeansProjects/Factura/src/factura/log4j.xml); logger.info(Entering application.); try { File file = new File(args[0]); Comprobante comp = CFDv2.newComprobante(new FileInputStream(file)); CFDv2 cfd = new CFDv2(comp); PrivateKey key = KeyLoader.loadPKCS8PrivateKey(new FileInputStream(args[1]),(args[2])); X509Certificate cert = KeyLoader.loadX509Certificate(new FileInputStream(args[3])); Comprobante sellado = cfd.sellarComprobante(key, cert); String cadena = cfd.getCadenaOriginal(); String sello = sellado.getSello(); // Creamos el builder basado en SAX SAXBuilder builder = new SAXBuilder(); // Construimos el arbol DOM a partir del fichero xml Document documentJDOM = builder.build(new FileInputStream(args[0])); Element raiz = documentJDOM.getRootElement();//toma el nodo raiz del documento. raiz.setAttribute(sello, sello); raiz.setAttribute(certificado, sellado.getCertificado()); //System.out.println(raiz.getAttributeValue(sello)); //System.out.println(raiz.getAttributeValue(certificado)); // Recorremos los hijos de la etiqueta raíz ListElement hijosRaiz = raiz.getChildren(); boolean Bandera=false; for(Element hijo: hijosRaiz) { // Obtenemos el nombre y su contenido de tipo texto String nombre = hijo.getName(); if (nombre.equals(Addenda)) { ListElement subHijo = hijo.getChildren(); for(Element hij: subHijo) { hij.setAttribute(CadenaOriginal, cadena); //System.out.println(CadenaOriginal: +hij.getAttributeValue(CadenaOriginal
Re: Problems with FOP and image
Some jar to which netbeans has access has those classes. Look in the output of jar tvf each of your jars and see if any of those has the named classes. If you find a jar with those classes make sure it's part of your classpath for you app. Are you making any calls like ImageIO.write(BufferedImage, JPEG, jpegImageFile)? On 06/13/2011 05:31 PM, Oscar.Flores wrote: ok i made a test and tell me that the class is missign but maybe what you say its rigth and it register the handler so i gonna register the services so i do this public static void main(String[] args) throws Exception { DOMConfigurator.configure(D:/Mis documentos/NetBeansProjects/Factura/src/factura/log4j.xml); logger.info(Entering application.); IIORegistry.getDefaultInstance().registerServiceProvider(new CLibJPEGImageReaderSpi()); IIORegistry.getDefaultInstance().registerServiceProvider(new CLibJPEGImageWriterSpi()); also after register my services it telling me that the class CLibJPEGImageReaderSpi() and CLibJPEGImageWriterSpi() is missing but only in command after register mi service, something more has to be done?? Rob Sargent-4 wrote: I'm not sure I'm following correctly: does removing the xmlgraphics jar cause netbeans to behave the same as the command-line run of you app? If so, I suspect netbeans is registering services for you. Your own code will have to make a call to one of the IIORegistry.registerServiceProvider() methods. On 06/13/2011 05:02 PM, Oscar.Flores wrote: Ok i get it, actually the ImageIO library i added because i read in the xmlgrapics that if something like the message org.apache.xmlgraphics.image.loader.ImageException: Cannot load image (no suitable loader/converter combination available)appear i have to add the jar file to the classpath but that all it say no configuration or anything, then i delete the imagenIO libs and still i have the same output in netbeans so xmlgrapics seem to have the problem in the plugins or i have to configure something Rob Sargent-4 wrote: Then it seems to me netbeans (if it's producing good output == assumptionA) is still using something that the command-line isn't. And given assumptionA, you're java code is correct in terms of FOP and your configuration isn't for ImageIO. Show your ImageIO related code and are you sure it's in your app. Use the logger to show a message when you add your loader. Or list all ImageIO services: IIORegistry.getServiceProviders() On 06/13/2011 03:01 PM, Oscar.Flores wrote: ok well i put the xml in scr of my proyect i see that i still have the same issues of the image render of any image i dont now if the xml its in place i put the code down to see if something its missing 15:45:07,827 ERROR [render] Error while processing image: c:\cfd\nombregp.bmp (i mage/bmp) org.apache.xmlgraphics.image.loader.ImageException: Cannot load image (no suitab le loader/converter combination available) for c:\cfd\nombregp.bmp (image/bmp) at org.apache.xmlgraphics.image.loader.ImageManager.getImage(ImageManage import mx.bigdata.sat.cfd.schema.Comprobante; import mx.bigdata.sat.cfd.CFDv2; import mx.bigdata.sat.security.KeyLoader; import org.jdom.*; import org.jdom.input.SAXBuilder; import org.jdom.output.XMLOutputter; import org.jdom.output.Format; import org.jdom.transform.JDOMSource; //Java import java.io.File; import java.io.OutputStream; //JAXP import javax.xml.transform.Transformer; import javax.xml.transform.TransformerFactory; import javax.xml.transform.Source; import javax.xml.transform.Result; import javax.xml.transform.stream.StreamSource; import javax.xml.transform.sax.SAXResult; //FOP import org.apache.fop.apps.FOUserAgent; import org.apache.fop.apps.Fop; import org.apache.fop.apps.FopFactory; import org.apache.fop.apps.MimeConstants; //log4j import org.apache.log4j.*; import org.apache.log4j.xml.DOMConfigurator; public final class Main { @SuppressWarnings(unchecked) static Logger logger = Logger.getLogger(Main.class); public static void main(String[] args) throws Exception { DOMConfigurator.configure(D:/Mis documentos/NetBeansProjects/Factura/src/factura/log4j.xml); logger.info(Entering application.); try { File file = new File(args[0]); Comprobante comp = CFDv2.newComprobante(new FileInputStream(file)); CFDv2 cfd = new CFDv2(comp); PrivateKey key = KeyLoader.loadPKCS8PrivateKey(new FileInputStream(args[1]),(args[2])); X509Certificate cert = KeyLoader.loadX509Certificate(new FileInputStream(args[3])); Comprobante sellado = cfd.sellarComprobante(key, cert); String cadena = cfd.getCadenaOriginal(); String sello = sellado.getSello(); // Creamos el builder basado en SAX SAXBuilder builder = new SAXBuilder
Re: Problems with FOP and image
Did you go through all your jars looking for 'CLibJPEGImageReaderSpi'. My greatest suspicion is that you don't have all your jars lined up. Which jar(s) do you think supplies these? What is your environment: just windows or do you have any tools like cygwin? The jpegImageFile would be the filename in your xsl the external-resource. If you're just using a file that is already in place you don't have to re-write it. On 06/14/2011 08:29 AM, Oscar.Flores wrote: No i dont, and that weird jejeje netbeans seems to do that for me, so the calls like ImageIO.write(BufferedImage, JPEG, jpegImageFile)? do i have to do it in every image that i put in the pdf?? and the image is gererate directly in the pdf??how can i do it?? Rob Sargent-4 wrote: Some jar to which netbeans has access has those classes. Look in the output of jar tvfeach of your jars and see if any of those has the named classes. If you find a jar with those classes make sure it's part of your classpath for you app. Are you making any calls like ImageIO.write(BufferedImage, JPEG, jpegImageFile)? On 06/13/2011 05:31 PM, Oscar.Flores wrote: ok i made a test and tell me that the class is missign but maybe what you say its rigth and it register the handler so i gonna register the services so i do this public static void main(String[] args) throws Exception { DOMConfigurator.configure(D:/Mis documentos/NetBeansProjects/Factura/src/factura/log4j.xml); logger.info(Entering application.); IIORegistry.getDefaultInstance().registerServiceProvider(new CLibJPEGImageReaderSpi()); IIORegistry.getDefaultInstance().registerServiceProvider(new CLibJPEGImageWriterSpi()); also after register my services it telling me that the class CLibJPEGImageReaderSpi() and CLibJPEGImageWriterSpi() is missing but only in command after register mi service, something more has to be done?? Rob Sargent-4 wrote: I'm not sure I'm following correctly: does removing the xmlgraphics jar cause netbeans to behave the same as the command-line run of you app? If so, I suspect netbeans is registering services for you. Your own code will have to make a call to one of the IIORegistry.registerServiceProvider() methods. On 06/13/2011 05:02 PM, Oscar.Flores wrote: Ok i get it, actually the ImageIO library i added because i read in the xmlgrapics that if something like the message org.apache.xmlgraphics.image.loader.ImageException: Cannot load image (no suitable loader/converter combination available)appear i have to add the jar file to the classpath but that all it say no configuration or anything, then i delete the imagenIO libs and still i have the same output in netbeans so xmlgrapics seem to have the problem in the plugins or i have to configure something Rob Sargent-4 wrote: Then it seems to me netbeans (if it's producing good output == assumptionA) is still using something that the command-line isn't. And given assumptionA, you're java code is correct in terms of FOP and your configuration isn't for ImageIO. Show your ImageIO related code and are you sure it's in your app. Use the logger to show a message when you add your loader. Or list all ImageIO services: IIORegistry.getServiceProviders() On 06/13/2011 03:01 PM, Oscar.Flores wrote: ok well i put the xml in scr of my proyect i see that i still have the same issues of the image render of any image i dont now if the xml its in place i put the code down to see if something its missing 15:45:07,827 ERROR [render] Error while processing image: c:\cfd\nombregp.bmp (i mage/bmp) org.apache.xmlgraphics.image.loader.ImageException: Cannot load image (no suitab le loader/converter combination available) for c:\cfd\nombregp.bmp (image/bmp) at org.apache.xmlgraphics.image.loader.ImageManager.getImage(ImageManage import mx.bigdata.sat.cfd.schema.Comprobante; import mx.bigdata.sat.cfd.CFDv2; import mx.bigdata.sat.security.KeyLoader; import org.jdom.*; import org.jdom.input.SAXBuilder; import org.jdom.output.XMLOutputter; import org.jdom.output.Format; import org.jdom.transform.JDOMSource; //Java import java.io.File; import java.io.OutputStream; //JAXP import javax.xml.transform.Transformer; import javax.xml.transform.TransformerFactory; import javax.xml.transform.Source; import javax.xml.transform.Result; import javax.xml.transform.stream.StreamSource; import javax.xml.transform.sax.SAXResult; //FOP import org.apache.fop.apps.FOUserAgent; import org.apache.fop.apps.Fop; import org.apache.fop.apps.FopFactory; import org.apache.fop.apps.MimeConstants; //log4j import org.apache.log4j.*; import org.apache.log4j.xml.DOMConfigurator; public final class Main { @SuppressWarnings(unchecked) static Logger logger = Logger.getLogger(Main.class); public static void main(String[] args) throws Exception { DOMConfigurator.configure(D:/Mis
Re: FOP Extension to handle Wiki Syntax
We have success editing the fo programmatically, parsing out some special strings our application embeds in the xml/text nodes. Not something we're necessarily proud of, but it works perfectly well. On 06/14/2011 09:54 AM, kalgon wrote: You're right, I shouldn't have been talking so much about the context of what I want to achieve, the only question that matters to me is: is it possible for an extension to programmatically add standard FO nodes to the main FO tree, if yes how?. That is all I want to know and until now, nobody has been able to answer that question. I see that FOP does have a lot of extension points but very few documentation about their usage, and I don't mind it this is not the correct way of doing things. I never started the debate about that, I just wanted a simple plain answer to my question. Regards, Kalgon Christopher R. Maden wrote: On 06/14/2011 11:23 AM, kalgon wrote: I understand but if we want to be strict, XSLT only transform from XML to another format (often XML but also Text). In my case wiki syntax is not XML so we could say it shouldn't be transformed through XSLT. Text nodes are part of XML... XSLT can handle processing the contents of those text nodes. However, it’s not always the best tool for doing that. I would probably write something in your language-of-choice that takes in an XML tree and writes it out identically, except for upgrading the free-text markup. There are converters out there to do it... the Freebase BFG project used one written by one of the original Wikipedia markup designers... see URL: https://secure.wikimedia.org/wikipedia/en/wiki/User:Magnus_Manske. This has gotten off-topic for FOP. If you decide to do this in XSLT, seeURL: http://www.mulberrytech.com/xsl/xsl-list/. Otherwise, see the discussion fora for whatever other programming language you’re using. ~Chris -- Chris Maden, text nerdURL: http://crism.maden.org/ “Before I built a wall I’d ask to know / What I was walling in or out, / And to whom I was like to give offence.” — RF, Mending Wall GnuPG Fingerprint: C6E4 E2A9 C9F8 71AC 9724 CAA3 19F8 6677 0077 C319 - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Problems with FOP and image
On 06/14/2011 11:06 AM, Oscar.Flores wrote: Yeah i do the class is in jai-imageio-1.1-sources.jar, the enviroment is just Having the file in the ...sources.jar won't do the runtime world much good. You need the jar of .class files for jai-imageio, not .java files windows xp, and the bufferedImage will be the path of the image?? No, the bufferedImage is an in-memory instance of BufferedImage holding the bits of the image. In the case that you have to read it from one place and write it to another. Rob Sargent-4 wrote: Did you go through all your jars looking for 'CLibJPEGImageReaderSpi'. My greatest suspicion is that you don't have all your jars lined up. Which jar(s) do you think supplies these? What is your environment: just windows or do you have any tools like cygwin? The jpegImageFile would be the filename in your xsl the external-resource. If you're just using a file that is already in place you don't have to re-write it. On 06/14/2011 08:29 AM, Oscar.Flores wrote: No i dont, and that weird jejeje netbeans seems to do that for me, so the calls like ImageIO.write(BufferedImage, JPEG, jpegImageFile)? do i have to do it in every image that i put in the pdf?? and the image is gererate directly in the pdf??how can i do it?? Rob Sargent-4 wrote: Some jar to which netbeans has access has those classes. Look in the output of jar tvfeach of your jars and see if any of those has the named classes. If you find a jar with those classes make sure it's part of your classpath for you app. Are you making any calls like ImageIO.write(BufferedImage, JPEG, jpegImageFile)? On 06/13/2011 05:31 PM, Oscar.Flores wrote: ok i made a test and tell me that the class is missign but maybe what you say its rigth and it register the handler so i gonna register the services so i do this public static void main(String[] args) throws Exception { DOMConfigurator.configure(D:/Mis documentos/NetBeansProjects/Factura/src/factura/log4j.xml); logger.info(Entering application.); IIORegistry.getDefaultInstance().registerServiceProvider(new CLibJPEGImageReaderSpi()); IIORegistry.getDefaultInstance().registerServiceProvider(new CLibJPEGImageWriterSpi()); also after register my services it telling me that the class CLibJPEGImageReaderSpi() and CLibJPEGImageWriterSpi() is missing but only in command after register mi service, something more has to be done?? Rob Sargent-4 wrote: I'm not sure I'm following correctly: does removing the xmlgraphics jar cause netbeans to behave the same as the command-line run of you app? If so, I suspect netbeans is registering services for you. Your own code will have to make a call to one of the IIORegistry.registerServiceProvider() methods. On 06/13/2011 05:02 PM, Oscar.Flores wrote: Ok i get it, actually the ImageIO library i added because i read in the xmlgrapics that if something like the message org.apache.xmlgraphics.image.loader.ImageException: Cannot load image (no suitable loader/converter combination available)appear i have to add the jar file to the classpath but that all it say no configuration or anything, then i delete the imagenIO libs and still i have the same output in netbeans so xmlgrapics seem to have the problem in the plugins or i have to configure something Rob Sargent-4 wrote: Then it seems to me netbeans (if it's producing good output == assumptionA) is still using something that the command-line isn't. And given assumptionA, you're java code is correct in terms of FOP and your configuration isn't for ImageIO. Show your ImageIO related code and are you sure it's in your app. Use the logger to show a message when you add your loader. Or list all ImageIO services: IIORegistry.getServiceProviders() On 06/13/2011 03:01 PM, Oscar.Flores wrote: ok well i put the xml in scr of my proyect i see that i still have the same issues of the image render of any image i dont now if the xml its in place i put the code down to see if something its missing 15:45:07,827 ERROR [render] Error while processing image: c:\cfd\nombregp.bmp (i mage/bmp) org.apache.xmlgraphics.image.loader.ImageException: Cannot load image (no suitab le loader/converter combination available) for c:\cfd\nombregp.bmp (image/bmp) at org.apache.xmlgraphics.image.loader.ImageManager.getImage(ImageManage import mx.bigdata.sat.cfd.schema.Comprobante; import mx.bigdata.sat.cfd.CFDv2; import mx.bigdata.sat.security.KeyLoader; import org.jdom.*; import org.jdom.input.SAXBuilder; import org.jdom.output.XMLOutputter; import org.jdom.output.Format; import org.jdom.transform.JDOMSource; //Java import java.io.File; import java.io.OutputStream; //JAXP import javax.xml.transform.Transformer; import javax.xml.transform.TransformerFactory; import javax.xml.transform.Source; import javax.xml.transform.Result; import javax.xml.transform.stream.StreamSource; import javax.xml.transform.sax.SAXResult
Re: Table cell not wrapping - how to insert zero width space?
Or maybe hyphenation. Working well for me. Cheers, On 06/15/2011 08:42 AM, Chetan Shirol wrote: I came to know from the other discussion forum that table cell text not wrapping can be solved by inserting zero width space. I want to know how to implement this and if there is any example then it will help. Please note that the text to be put in PDF in our case is dynamic. Thanks in advance. Regards, Chetan V S - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Problems with FOP and image
Is the pdf you posted made via the .bat file then? And it has all the images you need? Which image is giving you all the trouble? I see that you are incorrectly sizing the area into which you are putting the address of the client. Alternatively you have placed the table of items too high. Are you using fixed positions? Those to pieces (client-address and invoice-items) should be in consecutive blocks. On 06/17/2011 09:52 AM, Oscar.Flores wrote: No i still can print the images in pdf in console what i do for now is call a bat to make the transformation with fo until i figure out what the problem is in log appear that can find a proper converter for the images also another problem its that the table its to big it dont fit to the data here its the pdf that result http://old.nabble.com/file/p31870136/Prueba3.pdf Prueba3.pdf Warning(1979/26): fo:table, table-layout=auto is currently not supported by FOP but in my xslt it ike thisfo:table table-layout=fixed width=100% the version of fop i use its 1.0 Rob Sargent-4 wrote: I don't think you want to read and write to the same place. If the file is where you want it to be and it's otherwise in perfect shape you should be fine. But if you do want to read it in and write it to some deployed area the that's what you want to do. Almost: ImageIO.write(*newImage*, JPEG, jpegImageFile); So without adding the ImageIO.write() call, are you getting the pdf you want yet? If not, what actual errors are you seeing in the logs. The warning about fo:table is not causing you any trouble. What version of fop are you running (sorry I've forgotten) On 06/15/2011 02:51 PM, Oscar.Flores wrote: Hi thanks for the help yeah i haven see that its was .java and not .class, ok then if i follow correctly what you are saying then it has to be something like this BufferedImage newImage = new BufferedImage (C:\Logo.jpg) ImageIO.write(BufferedImage, JPEG, jpegImageFile) jpegImageFile will be the XML call rigth something like C:\Logo.jpg) and another thing Warning(1979/26): fo:table, table-layout=auto is currently not supported by FOP but in my xslt it ike thisfo:table table-layout=fixed width=100% so i dont now what its causing the ploblem Rob Sargent-4 wrote: On 06/14/2011 11:06 AM, Oscar.Flores wrote: Yeah i do the class is in jai-imageio-1.1-sources.jar, the enviroment is just Having the file in the ...sources.jar won't do the runtime world much good. You need the jar of .class files for jai-imageio, not .java files windows xp, and the bufferedImage will be the path of the image?? No, the bufferedImage is an in-memory instance of BufferedImage holding the bits of the image. In the case that you have to read it from one place and write it to another. Rob Sargent-4 wrote: Did you go through all your jars looking for 'CLibJPEGImageReaderSpi'. My greatest suspicion is that you don't have all your jars lined up. Which jar(s) do you think supplies these? What is your environment: just windows or do you have any tools like cygwin? The jpegImageFile would be the filename in your xsl the external-resource. If you're just using a file that is already in place you don't have to re-write it. On 06/14/2011 08:29 AM, Oscar.Flores wrote: No i dont, and that weird jejeje netbeans seems to do that for me, so the calls like ImageIO.write(BufferedImage, JPEG, jpegImageFile)? do i have to do it in every image that i put in the pdf?? and the image is gererate directly in the pdf??how can i do it?? Rob Sargent-4 wrote: Some jar to which netbeans has access has those classes. Look in the output of jar tvfeach of your jars and see if any of those has the named classes. If you find a jar with those classes make sure it's part of your classpath for you app. Are you making any calls like ImageIO.write(BufferedImage, JPEG, jpegImageFile)? On 06/13/2011 05:31 PM, Oscar.Flores wrote: ok i made a test and tell me that the class is missign but maybe what you say its rigth and it register the handler so i gonna register the services so i do this public static void main(String[] args) throws Exception { DOMConfigurator.configure(D:/Mis documentos/NetBeansProjects/Factura/src/factura/log4j.xml); logger.info(Entering application.); IIORegistry.getDefaultInstance().registerServiceProvider(new CLibJPEGImageReaderSpi()); IIORegistry.getDefaultInstance().registerServiceProvider(new CLibJPEGImageWriterSpi()); also after register my services it telling me that the class CLibJPEGImageReaderSpi() and CLibJPEGImageWriterSpi() is missing but only in command after register mi service, something more has to be done?? Rob Sargent-4 wrote: I'm not sure I'm following correctly: does removing the xmlgraphics jar cause netbeans to behave the same as the command-line run of you app? If so, I suspect netbeans is registering services for you. Your own code will have to make a call to one of the IIORegistry.registerServiceProvider
Re: flow sideways
This indent stuff very nearly does the trick, but not quite. The outer edges of both pages are perfect, so the -negative start-indent on the right-hand page pulls the right edge of the table exactly where I want it (in line with the text margin of the page) by outdenting exactly half the table. The left-hand page start correctly too but this isn't much of a surprise. :) However the gutters near the spine are not respected. I define my page margins as follows: xsl:variable name=leftPageMargins 0.0in 0.833in 0.6in 0.0in/xsl:variable xsl:variable name=rightPageMargins0.0in 0.0in 0.6in 0.833in/xsl:variable hoping to have the table not write into the 0.833in gutters. I define a margin-left/right on the region-body and region-before to set the outer edges correctly (there's even a good reason for doing this). I've tried playing with the indent numbers but that only shifts the start point. I've tried overflow=hidden on the region but this just gives me a completely blank area!? No effect with overflow=hidden on the table data. (Confession: the table of data is, for reasons long since lost, in a cell of a containing table but wrapping the table in a fo:block overflow=hidden doesn't help.) I'm this close to setting color=white background-color=white in the last/first visible column but that kind of programming in xsl is just plain ugly. So my initial objective has been accomplished: I can perfectly size all tables, including those which span facing pages. I can show the table data as it would appear on each page. I just show a little more than I would like. This will have to do for now, until I gain the strength to do the white-on-white trick. Other chores beckon at this point. Cheers, On 06/10/2011 10:23 AM, Vincent Hennebert wrote: Hi Rob, (Sorry for the delay.) On 01/06/11 00:30, Rob Sargent wrote: I have a table of data which is designed to span across two facing pages. Thanks to the tip from Jeremias Maerki I can size the tables perfectly and allot the correct space in the region-before or each page. But how do I get the table to break across the two pages nicely? Since the definition of each line's depth my be determined by any column I cannot lay the two halves out separately. It would be cool if it would just flow nicely all by itself but that's not quite how flow works far as I know. Perhaps I could lay the entire table in both region and have it truncate the left/right overflow? That seems to me like the best way to achieve what you want. Normally you just have to play with start-indent and end-indent on the table. You can even set the other indent (end-indent or start-indent) to a negative value to avoid FOP warnings. Something like this: • for even pages: fo:table table-layout=fixed width=200% start-indent=0 end-indent=-100% fo:table-header start-indent=0 end-indent=0 ... /fo:table-header fo:table-body start-indent=0 end-indent=0 ... /fo:table-body /fo:table • for odd pages: fo:table table-layout=fixed width=200% start-indent=-100% end-indent=0 fo:table-header start-indent=0 end-indent=0 ... /fo:table-header fo:table-body start-indent=0 end-indent=0 ... /fo:table-body /fo:table (You may have to adjust the width of the table a bit to account for its borders.) Seems possible for the left page, but would it work for the right hand page. i.e. Can one force the region to in essence fill from the right. Or is there a correct way to accomplish this? All pointer welcome, rjs HTH, Vincent - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: flow sideways
Let it be know, far and wide: I'm an idiot; Vincent is a saviour. Much thanks to the whole crew working on fop. On 06/20/2011 08:30 AM, Vincent Hennebert wrote: Hi Rob, On 17/06/11 22:27, Rob Sargent wrote: This indent stuff very nearly does the trick, but not quite. The outer edges of both pages are perfect, so the -negative start-indent on the right-hand page pulls the right edge of the table exactly where I want it (in line with the text margin of the page) by outdenting exactly half the table. The left-hand page start correctly too but this isn't much of a surprise. :) However the gutters near the spine are not respected. I define my page margins as follows: xsl:variable name=leftPageMargins 0.0in 0.833in 0.6in 0.0in/xsl:variable xsl:variable name=rightPageMargins0.0in 0.0in 0.6in 0.833in/xsl:variable hoping to have the table not write into the 0.833in gutters. I define a margin-left/right on the region-body and region-before to set the outer edges correctly (there's even a good reason for doing this). I've tried playing with the indent numbers but that only shifts the start point. I've tried overflow=hidden on the region but this just gives me a completely blank area!? This is due to Bugzilla #49910, partially fixed in Trunk. https://issues.apache.org/bugzilla/show_bug.cgi?id=49910 No effect with overflow=hidden on the table data. (Confession: the table of data is, for reasons long since lost, in a cell of a containing table but wrapping the table in a fo:block overflow=hidden doesn't help.) Try with fo:block-container instead: fo:block-container width=100% height=100% overflow=hidden !-- The table -- /fo:block-container I'm this close to setting color=white background-color=white in the last/first visible column but that kind of programming in xsl is just plain ugly. So my initial objective has been accomplished: I can perfectly size all tables, including those which span facing pages. I can show the table data as it would appear on each page. I just show a little more than I would like. This will have to do for now, until I gain the strength to do the white-on-white trick. Other chores beckon at this point. Cheers, HTH, Vincent On 06/10/2011 10:23 AM, Vincent Hennebert wrote: Hi Rob, (Sorry for the delay.) On 01/06/11 00:30, Rob Sargent wrote: I have a table of data which is designed to span across two facing pages. Thanks to the tip from Jeremias Maerki I can size the tables perfectly and allot the correct space in the region-before or each page. But how do I get the table to break across the two pages nicely? Since the definition of each line's depth my be determined by any column I cannot lay the two halves out separately. It would be cool if it would just flow nicely all by itself but that's not quite how flow works far as I know. Perhaps I could lay the entire table in both region and have it truncate the left/right overflow? That seems to me like the best way to achieve what you want. Normally you just have to play with start-indent and end-indent on the table. You can even set the other indent (end-indent or start-indent) to a negative value to avoid FOP warnings. Something like this: • for even pages: fo:table table-layout=fixed width=200% start-indent=0 end-indent=-100% fo:table-header start-indent=0 end-indent=0 ... /fo:table-header fo:table-body start-indent=0 end-indent=0 ... /fo:table-body /fo:table • for odd pages: fo:table table-layout=fixed width=200% start-indent=-100% end-indent=0 fo:table-header start-indent=0 end-indent=0 ... /fo:table-header fo:table-body start-indent=0 end-indent=0 ... /fo:table-body /fo:table (You may have to adjust the width of the table a bit to account for its borders.) Seems possible for the left page, but would it work for the right hand page. i.e. Can one force the region to in essence fill from the right. Or is there a correct way to accomplish this? All pointer welcome, rjs HTH, Vincent - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
fop not handling svn rotated text on linux
Using fop-0.95 in this case. We generate a small svg file for the outside edge of each page and put the section name and page number (et al). The text is rotated +/-90 degrees for the section name. We're using Helvetica. Certain character combinations are just wrongly spaced but especially Jo which actually touch each other in the final pdf. Worse yet, this only happens on our linux boxes: OpenSuse 11.2 and 11.4 and Ubuntu. Windows boxes print just fine. How embarrassing is that!? Any pointers appreciated, - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: fop not handling svn rotated text on linux
Medhi, I've loaded acroread on the shared linux box and the pdf looks fine. Do you still want the pdf? Or does this become an Evince issue? Cheers, rjs mehdi houshmand wrote: Hi Rob, Could you upload the PDF in question (if it's not too big) and it'll give us a better idea of what the issue is. Thanks Mehdi On 25 June 2011 04:37, Bernard Giannetti thebernmeis...@hotmail.com wrote: Something which happened to me (unrelated to rotating text) but I noticed a difference between the PDF viewing engines of Adobe and Ubuntu's Document Viewer. There is some bug in the way the underlying library (used by Document Viewer) does rendering - I cannot remember the specifics but the bug was there still a few months ago. So perhaps look at your PDF using Adobe PDF viewer on Linux? Date: Fri, 24 Jun 2011 17:08:20 -0600 From: rsarg...@xmission.com To: fop-users@xmlgraphics.apache.org Subject: fop not handling svn rotated text on linux Using fop-0.95 in this case. We generate a small svg file for the outside edge of each page and put the section name and page number (et al). The text is rotated +/-90 degrees for the section name. We're using Helvetica. Certain character combinations are just wrongly spaced but especially Jo which actually touch each other in the final pdf. Worse yet, this only happens on our linux boxes: OpenSuse 11.2 and 11.4 and Ubuntu. Windows boxes print just fine. How embarrassing is that!? Any pointers appreciated, - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: fop not handling SVG rotated text on linux
I would really appreciate someone editing the Subject for the archives: s/svn/svg/g But apparently enough people saw through my type. Thanks gang. Rob Sargent wrote: Medhi, I've loaded acroread on the shared linux box and the pdf looks fine. Do you still want the pdf? Or does this become an Evince issue? Cheers, rjs mehdi houshmand wrote: Hi Rob, Could you upload the PDF in question (if it's not too big) and it'll give us a better idea of what the issue is. Thanks Mehdi On 25 June 2011 04:37, Bernard Giannetti thebernmeis...@hotmail.com wrote: Something which happened to me (unrelated to rotating text) but I noticed a difference between the PDF viewing engines of Adobe and Ubuntu's Document Viewer. There is some bug in the way the underlying library (used by Document Viewer) does rendering - I cannot remember the specifics but the bug was there still a few months ago. So perhaps look at your PDF using Adobe PDF viewer on Linux? Date: Fri, 24 Jun 2011 17:08:20 -0600 From: rsarg...@xmission.com To: fop-users@xmlgraphics.apache.org Subject: fop not handling svn rotated text on linux Using fop-0.95 in this case. We generate a small svg file for the outside edge of each page and put the section name and page number (et al). The text is rotated +/-90 degrees for the section name. We're using Helvetica. Certain character combinations are just wrongly spaced but especially Jo which actually touch each other in the final pdf. Worse yet, this only happens on our linux boxes: OpenSuse 11.2 and 11.4 and Ubuntu. Windows boxes print just fine. How embarrassing is that!? Any pointers appreciated, - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: fop not handling svn rotated text on linux
Roger, that. Will advise the Evince people. mehdi houshmand wrote: Hi Rob, No I don't it's necessary if you're happy that it's not a FOP issue. Mehdi On 25 June 2011 21:55, Rob Sargent rsarg...@xmission.com wrote: Medhi, I've loaded acroread on the shared linux box and the pdf looks fine. Do you still want the pdf? Or does this become an Evince issue? Cheers, rjs mehdi houshmand wrote: Hi Rob, Could you upload the PDF in question (if it's not too big) and it'll give us a better idea of what the issue is. Thanks Mehdi On 25 June 2011 04:37, Bernard Giannetti thebernmeis...@hotmail.com wrote: Something which happened to me (unrelated to rotating text) but I noticed a difference between the PDF viewing engines of Adobe and Ubuntu's Document Viewer. There is some bug in the way the underlying library (used by Document Viewer) does rendering - I cannot remember the specifics but the bug was there still a few months ago. So perhaps look at your PDF using Adobe PDF viewer on Linux? Date: Fri, 24 Jun 2011 17:08:20 -0600 From: rsarg...@xmission.com To: fop-users@xmlgraphics.apache.org Subject: fop not handling svn rotated text on linux Using fop-0.95 in this case. We generate a small svg file for the outside edge of each page and put the section name and page number (et al). The text is rotated +/-90 degrees for the section name. We're using Helvetica. Certain character combinations are just wrongly spaced but especially Jo which actually touch each other in the final pdf. Worse yet, this only happens on our linux boxes: OpenSuse 11.2 and 11.4 and Ubuntu. Windows boxes print just fine. How embarrassing is that!? Any pointers appreciated, - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Problems with FOP and image
Are netbeans and your command-line using the same installation of java? Can you isolate you image handling code for us? On 06/27/2011 03:28 PM, Oscar.Flores wrote: yeah i add the imageio.jar and the clibwrap.jar that comes in the bundle to the classpath and put them in the jdk/jre bin and lib like in the instruction says Windows The jar file must be placed in jre\lib\ext and the native library in jre\bin. but still got the same issues - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: fop not handling svn rotated text on linux
Mehdi, Sorry about the size of the pdf: I was hoping that removing the images would make it simple enough or that the svg would suffice. Knowing that you think it's a bug is re-assuring. Not sure what P2 normal means in terms of time, so with a pointer to what you think is the problem, I would be happy dive in. I meant to register this against version 0.95 but I have moved this (portion of our) product to 1.0. Cheers, rjs On 06/28/2011 01:43 AM, mehdi houshmand wrote: Hi Rob, I took a quick look at this and just a note for future. If you see this kind of problem, could you reduce the FO and PDF produced to isolate the problem. There's a lot of visual noise here that makes finding the issue more difficult, however, this does look like a FOP bug, I've created a bug https://issues.apache.org/bugzilla/show_bug.cgi?id=51441. I'll post any findings on there. Mehdi On 27 June 2011 21:17, Rob Sargent rsarg...@xmission.com wrote: Doth my eye deceive me? I'm back to thinking this is an FOP bug. Attached please find an example pdf, it fo and the include svg files. I manage to get good output by mis-specifying a font!! svg:text font-family=-monotype-arial-medium-o-normal--0-0-0-0-p-0-microsoft-cp1252 This generates a glorious stack trace but at least the J and the o of Joint aren't touching each other. On 06/26/2011 03:17 AM, mehdi houshmand wrote: Hi Rob, No I don't it's necessary if you're happy that it's not a FOP issue. Mehdi On 25 June 2011 21:55, Rob Sargent rsarg...@xmission.com wrote: Medhi, I've loaded acroread on the shared linux box and the pdf looks fine. Do you still want the pdf? Or does this become an Evince issue? Cheers, rjs mehdi houshmand wrote: Hi Rob, Could you upload the PDF in question (if it's not too big) and it'll give us a better idea of what the issue is. Thanks Mehdi On 25 June 2011 04:37, Bernard Giannetti thebernmeis...@hotmail.com wrote: Something which happened to me (unrelated to rotating text) but I noticed a difference between the PDF viewing engines of Adobe and Ubuntu's Document Viewer. There is some bug in the way the underlying library (used by Document Viewer) does rendering - I cannot remember the specifics but the bug was there still a few months ago. So perhaps look at your PDF using Adobe PDF viewer on Linux? Date: Fri, 24 Jun 2011 17:08:20 -0600 From: rsarg...@xmission.com To: fop-users@xmlgraphics.apache.org Subject: fop not handling svn rotated text on linux Using fop-0.95 in this case. We generate a small svg file for the outside edge of each page and put the section name and page number (et al). The text is rotated +/-90 degrees for the section name. We're using Helvetica. Certain character combinations are just wrongly spaced but especially Jo which actually touch each other in the final pdf. Worse yet, this only happens on our linux boxes: OpenSuse 11.2 and 11.4 and Ubuntu. Windows boxes print just fine. How embarrassing is that!? Any pointers appreciated, - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: fop not handling svn rotated text on linux
Roger. Will give it a shot. rjs On 06/28/2011 10:03 AM, mehdi houshmand wrote: No problem. If you want any advice this is what I'd do: First double check it's not a kerning issue in the system font. I think this is unlikely, but we need to double check that. I'd do that by copying the font, and embedding the font in the PDF with the #PCDATA as Jo (to do this you'll have to put it in the fop.xconf and use a non-Base14 name). If the #PCDATA text shows the same issues, the problem is a font one, and we can be fairly confident it's not a FOP issue. If however this isn't repeatable with #PCDATA then we've got an issue. You'll already have the font in a local directory, so check it's type, check do some debugging in PDFPainter.drawText(...) and find out why the kerning is behaving as it is. i think it's a type1 font. I'll try and do the above myself if I get some time to spare. Just make sure you post any findings on the bugzilla entry so we can track it. Thanks Mehdi On 28 June 2011 16:44, Rob Sargent rsarg...@xmission.com wrote: Mehdi, Sorry about the size of the pdf: I was hoping that removing the images would make it simple enough or that the svg would suffice. Knowing that you think it's a bug is re-assuring. Not sure what P2 normal means in terms of time, so with a pointer to what you think is the problem, I would be happy dive in. I meant to register this against version 0.95 but I have moved this (portion of our) product to 1.0. Cheers, rjs On 06/28/2011 01:43 AM, mehdi houshmand wrote: Hi Rob, I took a quick look at this and just a note for future. If you see this kind of problem, could you reduce the FO and PDF produced to isolate the problem. There's a lot of visual noise here that makes finding the issue more difficult, however, this does look like a FOP bug, I've created a bug https://issues.apache.org/bugzilla/show_bug.cgi?id=51441. I'll post any findings on there. Mehdi On 27 June 2011 21:17, Rob Sargent rsarg...@xmission.com wrote: Doth my eye deceive me? I'm back to thinking this is an FOP bug. Attached please find an example pdf, it fo and the include svg files. I manage to get good output by mis-specifying a font!! svg:text font-family=-monotype-arial-medium-o-normal--0-0-0-0-p-0-microsoft-cp1252 This generates a glorious stack trace but at least the J and the o of Joint aren't touching each other. On 06/26/2011 03:17 AM, mehdi houshmand wrote: Hi Rob, No I don't it's necessary if you're happy that it's not a FOP issue. Mehdi On 25 June 2011 21:55, Rob Sargent rsarg...@xmission.com wrote: Medhi, I've loaded acroread on the shared linux box and the pdf looks fine. Do you still want the pdf? Or does this become an Evince issue? Cheers, rjs mehdi houshmand wrote: Hi Rob, Could you upload the PDF in question (if it's not too big) and it'll give us a better idea of what the issue is. Thanks Mehdi On 25 June 2011 04:37, Bernard Giannetti thebernmeis...@hotmail.com wrote: Something which happened to me (unrelated to rotating text) but I noticed a difference between the PDF viewing engines of Adobe and Ubuntu's Document Viewer. There is some bug in the way the underlying library (used by Document Viewer) does rendering - I cannot remember the specifics but the bug was there still a few months ago. So perhaps look at your PDF using Adobe PDF viewer on Linux? Date: Fri, 24 Jun 2011 17:08:20 -0600 From: rsarg...@xmission.com To: fop-users@xmlgraphics.apache.org Subject: fop not handling svn rotated text on linux Using fop-0.95 in this case. We generate a small svg file for the outside edge of each page and put the section name and page number (et al). The text is rotated +/-90 degrees for the section name. We're using Helvetica. Certain character combinations are just wrongly spaced but especially Jo which actually touch each other in the final pdf. Worse yet, this only happens on our linux boxes: OpenSuse 11.2 and 11.4 and Ubuntu. Windows boxes print just fine. How embarrassing is that!? Any pointers appreciated, - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: fop not handling svn rotated text on linux
Well, that explains why the bold text of my sidebar looks fine! Give that this SVG we're talking about I have to get _some_ font into the OS's fonts setup. Also give that the stylesheet has to work on Windows, Mac and Linux, what are the chances of um, er aliasing FreeSans as Helvetica? Looks like I could do that in /etc/fonts/fonts.config? Any hope there? Thanks much, rjs On 06/29/2011 05:19 AM, Vincent Hennebert wrote: Hi, I added some comments to the Bugzilla report. More details regarding this specific issue: Linux systems don’t have the Helvetica font, they use the Nimbus Sans L clone. So you would have to specify ‘Nimbus Sans L’ as the font family. The problem is, a condensed variant of this font exists, and is wrongly selected by Java (on my system at least, Ubuntu 10.10 with a Sun 1.6 JVM) for the bold weight. Which means that if you need bold fonts you may not be able to use Nimbus Sans L. You can choose any other font instead, for example FreeSans which is a TrueType version of Helvetica with more glyphs. HTH, Vincent On 28/06/11 18:25, Rob Sargent wrote: Roger. Will give it a shot. rjs On 06/28/2011 10:03 AM, mehdi houshmand wrote: No problem. If you want any advice this is what I'd do: First double check it's not a kerning issue in the system font. I think this is unlikely, but we need to double check that. I'd do that by copying the font, and embedding the font in the PDF with the #PCDATA as Jo (to do this you'll have to put it in the fop.xconf and use a non-Base14 name). If the #PCDATA text shows the same issues, the problem is a font one, and we can be fairly confident it's not a FOP issue. If however this isn't repeatable with #PCDATA then we've got an issue. You'll already have the font in a local directory, so check it's type, check do some debugging in PDFPainter.drawText(...) and find out why the kerning is behaving as it is. i think it's a type1 font. I'll try and do the above myself if I get some time to spare. Just make sure you post any findings on the bugzilla entry so we can track it. Thanks Mehdi On 28 June 2011 16:44, Rob Sargent rsarg...@xmission.com wrote: Mehdi, Sorry about the size of the pdf: I was hoping that removing the images would make it simple enough or that the svg would suffice. Knowing that you think it's a bug is re-assuring. Not sure what P2 normal means in terms of time, so with a pointer to what you think is the problem, I would be happy dive in. I meant to register this against version 0.95 but I have moved this (portion of our) product to 1.0. Cheers, rjs On 06/28/2011 01:43 AM, mehdi houshmand wrote: Hi Rob, I took a quick look at this and just a note for future. If you see this kind of problem, could you reduce the FO and PDF produced to isolate the problem. There's a lot of visual noise here that makes finding the issue more difficult, however, this does look like a FOP bug, I've created a bug https://issues.apache.org/bugzilla/show_bug.cgi?id=51441. I'll post any findings on there. Mehdi On 27 June 2011 21:17, Rob Sargent rsarg...@xmission.com wrote: Doth my eye deceive me? I'm back to thinking this is an FOP bug. Attached please find an example pdf, it fo and the include svg files. I manage to get good output by mis-specifying a font!! svg:text font-family=-monotype-arial-medium-o-normal--0-0-0-0-p-0-microsoft-cp1252 This generates a glorious stack trace but at least the J and the o of Joint aren't touching each other. On 06/26/2011 03:17 AM, mehdi houshmand wrote: Hi Rob, No I don't it's necessary if you're happy that it's not a FOP issue. Mehdi On 25 June 2011 21:55, Rob Sargent rsarg...@xmission.com wrote: Medhi, I've loaded acroread on the shared linux box and the pdf looks fine. Do you still want the pdf? Or does this become an Evince issue? Cheers, rjs mehdi houshmand wrote: Hi Rob, Could you upload the PDF in question (if it's not too big) and it'll give us a better idea of what the issue is. Thanks Mehdi On 25 June 2011 04:37, Bernard Giannetti thebernmeis...@hotmail.com wrote: Something which happened to me (unrelated to rotating text) but I noticed a difference between the PDF viewing engines of Adobe and Ubuntu's Document Viewer. There is some bug in the way the underlying library (used by Document Viewer) does rendering - I cannot remember the specifics but the bug was there still a few months ago. So perhaps look at your PDF using Adobe PDF viewer on Linux? Date: Fri, 24 Jun 2011 17:08:20 -0600 From: rsarg...@xmission.com To: fop-users@xmlgraphics.apache.org Subject: fop not handling svn rotated text on linux Using fop-0.95 in this case. We generate a small svg file for the outside edge of each page and put the section name and page number (et al). The text is rotated +/-90 degrees for the section name. We're using Helvetica. Certain character combinations are just wrongly
Re: fop not handling svn rotated text on linux
I'm on OpenSuSE-11.4. I have 240 /usr/share/fonts/100dpi/helv*.pcf.gz. Are these unavailable for SVG/PDF generation? My /etc/fonts/fonts.conf names dir/usr/share/fonts/dir (and three other dirs which don't exist). Expressly adding dir/usr/share/fonts/100dpi/dir to /etc/fonts/conf.avail/local.conf and fc-cache doesn't appear to help. fontforge-2011, to my understanding, does not convert pcf files. On 06/29/2011 10:44 AM, Rob Sargent wrote: Well, that explains why the bold text of my sidebar looks fine! Give that this SVG we're talking about I have to get _some_ font into the OS's fonts setup. Also give that the stylesheet has to work on Windows, Mac and Linux, what are the chances of um, er aliasing FreeSans as Helvetica? Looks like I could do that in /etc/fonts/fonts.config? Any hope there? Thanks much, rjs On 06/29/2011 05:19 AM, Vincent Hennebert wrote: Hi, I added some comments to the Bugzilla report. More details regarding this specific issue: Linux systems don’t have the Helvetica font, they use the Nimbus Sans L clone. So you would have to specify ‘Nimbus Sans L’ as the font family. The problem is, a condensed variant of this font exists, and is wrongly selected by Java (on my system at least, Ubuntu 10.10 with a Sun 1.6 JVM) for the bold weight. Which means that if you need bold fonts you may not be able to use Nimbus Sans L. You can choose any other font instead, for example FreeSans which is a TrueType version of Helvetica with more glyphs. HTH, Vincent On 28/06/11 18:25, Rob Sargent wrote: Roger. Will give it a shot. rjs On 06/28/2011 10:03 AM, mehdi houshmand wrote: No problem. If you want any advice this is what I'd do: First double check it's not a kerning issue in the system font. I think this is unlikely, but we need to double check that. I'd do that by copying the font, and embedding the font in the PDF with the #PCDATA as Jo (to do this you'll have to put it in the fop.xconf and use a non-Base14 name). If the #PCDATA text shows the same issues, the problem is a font one, and we can be fairly confident it's not a FOP issue. If however this isn't repeatable with #PCDATA then we've got an issue. You'll already have the font in a local directory, so check it's type, check do some debugging in PDFPainter.drawText(...) and find out why the kerning is behaving as it is. i think it's a type1 font. I'll try and do the above myself if I get some time to spare. Just make sure you post any findings on the bugzilla entry so we can track it. Thanks Mehdi On 28 June 2011 16:44, Rob Sargent rsarg...@xmission.com wrote: Mehdi, Sorry about the size of the pdf: I was hoping that removing the images would make it simple enough or that the svg would suffice. Knowing that you think it's a bug is re-assuring. Not sure what P2 normal means in terms of time, so with a pointer to what you think is the problem, I would be happy dive in. I meant to register this against version 0.95 but I have moved this (portion of our) product to 1.0. Cheers, rjs On 06/28/2011 01:43 AM, mehdi houshmand wrote: Hi Rob, I took a quick look at this and just a note for future. If you see this kind of problem, could you reduce the FO and PDF produced to isolate the problem. There's a lot of visual noise here that makes finding the issue more difficult, however, this does look like a FOP bug, I've created a bug https://issues.apache.org/bugzilla/show_bug.cgi?id=51441. I'll post any findings on there. Mehdi On 27 June 2011 21:17, Rob Sargent rsarg...@xmission.com wrote: Doth my eye deceive me? I'm back to thinking this is an FOP bug. Attached please find an example pdf, it fo and the include svg files. I manage to get good output by mis-specifying a font!! svg:text font-family=-monotype-arial-medium-o-normal--0-0-0-0-p-0-microsoft-cp1252 This generates a glorious stack trace but at least the J and the o of Joint aren't touching each other. On 06/26/2011 03:17 AM, mehdi houshmand wrote: Hi Rob, No I don't it's necessary if you're happy that it's not a FOP issue. Mehdi On 25 June 2011 21:55, Rob Sargent rsarg...@xmission.com wrote: Medhi, I've loaded acroread on the shared linux box and the pdf looks fine. Do you still want the pdf? Or does this become an Evince issue? Cheers, rjs mehdi houshmand wrote: Hi Rob, Could you upload the PDF in question (if it's not too big) and it'll give us a better idea of what the issue is. Thanks Mehdi On 25 June 2011 04:37, Bernard Giannetti thebernmeis...@hotmail.com wrote: Something which happened to me (unrelated to rotating text) but I noticed a difference between the PDF viewing engines of Adobe and Ubuntu's Document Viewer. There is some bug in the way the underlying library (used by Document Viewer) does rendering - I cannot remember the specifics but the bug was there still a few months ago. So perhaps look at your PDF using
Re: Problems with FOP and image
Great news! On 06/30/2011 02:27 PM, Oscar.Flores wrote: Jejeje guest what it works now i update my JVM to 6.26 and my JDK to 6.26, NetBeans 7.0 and put the build.xml and now really add all the libraries that needs my program to work in the console yeeah!!! after weeks jejeje thanks so much Rob you have been so much helpfull!!thanks man!! Rob Sargent-4 wrote: - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: fop not handling svn rotated text on linux
Did you follow the link Vincent posted in Bugzilla? IIC, that explains exactly what the core issue is, and shows what needs to be done to work around it. Obviously, that would mean your FOP config is not portable across all platforms, but that seems justifiable. In the middle of a release here, so I confess I just now got through Vincent's pointers. And as expected (by some at least), no Helvetica from java.awt.GraphicsEnvironment.getAvailableFontFamilyNames so it's impossible to name correctly :) However, I don't follow your last point on a justifiable non-portable config. Luckily there is only one Linux box that I need to do this correctly so I'm willing to tweak that config file by hand if it comes to that. That machine is responsible for the final pdf for the publishers. I'm not sure what the mac users are seeing, but the Windows users are doing fine with the call for Helvetica. Trying the alias trick . I'm on OpenSuSE-11.4. I have 240 /usr/share/fonts/100dpi/helv*.pcf.gz. Are these unavailable for SVG/PDF generation? Perhaps. PCF is a format used by Xserve, which is the reason why you have them installed. This does not necessarily mean that the Java AWT implementation has built-in support for PCF fonts, though... HTH! Andreas --- - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: fop not handling svn rotated text on linux
The news about the mac is reassuring, thanks. So far I've swapped out the alias for Numbus Sans L for FreeSans in /etc/fonts/conf.avail/30-metric-aliases.conf: fonts-config; fc-cache; placed the following in my fop config xml font kerning=yes embed-url=FreeSans.ttf font-triplet name=Helvetica style=normal weight=normal/ /font font kerning=yes embed-url=FreeSansBold.ttf font-triplet name=Helvetica style=normal weight=bold/ /font but this has been a dead end. I think I've mentioned that replacing svg:text font-family=Helvetica font-style=normal font-weight=normal font-size=10pt text-anchor=end x=-35 y=25 with svg:text font-family=-monotype-arial-medium-o-normal--0-0-0-0-p-0-microsoft-cp1252 font-size=10pt text-anchor=end x=-35 y=25 gets me good output so I'll go with that even though it generates a huge stacktrace with each call to print. Thanks to all, rjs On 06/30/2011 03:09 PM, Andreas L. Delmelle wrote: On 30 Jun 2011, at 22:56, Rob Sargent wrote: Did you follow the link Vincent posted in Bugzilla? IIC, that explains exactly what the core issue is, and shows what needs to be done to work around it. Obviously, that would mean your FOP config is not portable across all platforms, but that seems justifiable. snip / However, I don't follow your last point on a justifiable non-portable config. I meant that a config file will, almost by definition, be tied to the local system/platform that FOP runs on. In a way, it is precisely meant to make sure that environment-specific stuff can be 'configured' with relative ease. Luckily there is only one Linux box that I need to do this correctly so I'm willing to tweak that config file by hand if it comes to that. That machine is responsible for the final pdf for the publishers. I'm not sure what the mac users are seeing, but the Windows users are doing fine with the call for Helvetica. Just so you know: the minimized sample Mehdi attached to the bug report renders fine on OS X without custom config. Regards Andreas --- - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: fop not handling svn rotated text on linux
Even with auto-detect on? Wait a second... Did you also configure FOP to locate the FreeSans.ttf file? See: http://xmlgraphics.apache.org/fop/1.0/fonts.html#basics, and beyond If FOP is not specifically told to look elsewhere, and it would not find that TTF in the working directory, then as a result, it would still fall back to the default sans-serif and use the inappropriate metrics. Regards, Andreas --- - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: fop not handling svn rotated text on linux
I've now copied all the FreeSans files into the distribution (an eclipse plugin based setup) and expressly call for FreeSans in the svg file. The result is much the same as from relying on auto-detect: Just a different spacing problem from that which we get when we call for Helvetica: The J and o are too widely spaced; the i and the n are touching. Just a reminder: the svg files look fine (and indistinguishable) with either FreeSans or Helvetica. It's just the pdf that is problematic. On 06/30/2011 04:12 PM, Andreas L. Delmelle wrote: On 30 Jun 2011, at 23:47, Rob Sargent wrote: The news about the mac is reassuring, thanks. So far I've swapped out the alias for Numbus Sans L for FreeSans in /etc/fonts/conf.avail/30-metric-aliases.conf: fonts-config; fc-cache; placed the following in my fop config xml font kerning=yes embed-url=FreeSans.ttf font-triplet name=Helvetica style=normal weight=normal/ /font Wait a second... Did you also configure FOP to locate the FreeSans.ttf file? See: http://xmlgraphics.apache.org/fop/1.0/fonts.html#basics, and beyond If FOP is not specifically told to look elsewhere, and it would not find that TTF in the working directory, then as a result, it would still fall back to the default sans-serif and use the inappropriate metrics. Regards, Andreas --- - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: fop not handling svn rotated text on linux
I need to get this reply off, but I also need to double check my setup as I'm switching back and forth from 0.95 to 1.0 on this and the odds that I've confused things are approaching 1 :( I'm coming to the conclusion that to guarantee all platforms use the same font I must include it in the distribution of the client. As I've said, we're already including non-standard fonts (e.g. Optima), but my naive assumption that, since it's part and parcel of PDF, simply naming Helvetica was enough is clearly wrong. Now can I just use the truetype arial which _is_ on my box (but does not rectify the current situation) and would presumably be what the pc users are getting. Or am I better off getting a commercial truetype Helvetica? On 06/30/2011 05:16 PM, Andreas L. Delmelle wrote: On 01 Jul 2011, at 00:25, Rob Sargent wrote: Even with auto-detect on? In that case, the answer to my question would be: Yes, FOP is configured to look elsewhere. Still, it just occurred to me that the font definition you added, would only influence the specifications of font and font-family in the FO, or Helvetica specs passed by Batik to FOP. The latter is precisely what does *not* happen, and causes the issue. Batik asks Java for Helvetica but gets something different. This font, however, is apparently not known to FOP. At least, not by that name... So, first thing to do, is to find out exactly which font Java AWT *does* give to Batik for Helvetica. Then we have to find out why FOP doesn't recognize it. Concerning the observation that it renders correctly if you use a 'wrong' font-family specification: that might be a worthwhile option to explore. Which exact font does Batik revert to in that case...? BTW: What exactly does that stack trace point to that you mentioned? Regards Andreas --- - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org * CSSEngine: exception property.syntax.error:org.w3c.css.sac.CSSParseException: Unexpected token: 20 (see LexicalUnits). [Bootstrap] [Print Preview Thread] [2011-07-01 09:22:48,799] ERROR - STDERR AttrValue:-monotype-arial-medium-o-normal--0-0-0-0-p-0-microsoft-cp1252 [Bootstrap] [Print Preview Thread] [2011-07-01 09:22:48,799] ERROR - STDERR Exception:org.w3c.css.sac.CSSParseException [Bootstrap] [Print Preview Thread] [2011-07-01 09:22:48,799] ERROR - STDERR org.w3c.css.sac.CSSParseException: Unexpected token: 20 (see LexicalUnits). [Bootstrap] [Print Preview Thread] [2011-07-01 09:22:48,800] ERROR - STDERR at org.apache.batik.css.parser.Parser.createCSSParseException(Unknown Source) [Bootstrap] [Print Preview Thread] [2011-07-01 09:22:48,800] ERROR - STDERR at org.apache.batik.css.parser.Parser.parseTerm(Unknown Source) [Bootstrap] [Print Preview Thread] [2011-07-01 09:22:48,800] ERROR - STDERR at org.apache.batik.css.parser.Parser.parseExpression(Unknown Source) [Bootstrap] [Print Preview Thread] [2011-07-01 09:22:48,800] ERROR - STDERR at org.apache.batik.css.parser.Parser.parsePropertyValueInternal(Unknown Source) [Bootstrap] [Print Preview Thread] [2011-07-01 09:22:48,800] ERROR - STDERR at org.apache.batik.css.parser.Parser.parsePropertyValue(Unknown Source) [Bootstrap] [Print Preview Thread] [2011-07-01 09:22:48,800] ERROR - STDERR at org.apache.batik.css.engine.CSSEngine.getCascadedStyleMap(Unknown Source) [Bootstrap] [Print Preview Thread] [2011-07-01 09:22:48,800] ERROR - STDERR at org.apache.batik.css.engine.CSSEngine.getComputedStyle(Unknown Source) [Bootstrap] [Print Preview Thread] [2011-07-01 09:22:48,800] ERROR - STDERR at org.apache.batik.bridge.CSSUtilities.getComputedStyle(Unknown Source) [Bootstrap] [Print Preview Thread] [2011-07-01 09:22:48,800] ERROR - STDERR at org.apache.batik.bridge.CSSUtilities.convertDisplay(Unknown Source) [Bootstrap] [Print Preview Thread] [2011-07-01 09:22:48,800] ERROR - STDERR at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(Unknown Source) [Bootstrap] [Print Preview Thread] [2011-07-01 09:22:48,800] ERROR - STDERR at org.apache.batik.bridge.GVTBuilder.buildComposite(Unknown Source) [Bootstrap] [Print Preview Thread] [2011-07-01 09:22:48,801] ERROR - STDERR at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(Unknown Source) [Bootstrap] [Print Preview Thread] [2011-07-01 09:22:48,801] ERROR - STDERR at org.apache.batik.bridge.GVTBuilder.buildComposite(Unknown Source) [Bootstrap] [Print Preview Thread] [2011-07-01 09:22:48,801] ERROR - STDERR at org.apache.batik.bridge.GVTBuilder.build(Unknown Source) [Bootstrap] [Print Preview Thread] [2011-07-01 09:22:48,801] ERROR - STDERR at org.apache.fop.render.pdf.PDFImageHandlerSVG.handleImage(PDFImageHandlerSVG.java:93) [Bootstrap] [Print Preview Thread] [2011-07-01 09:22:48,801] ERROR - STDERR
Re: fop not handling svn rotated text on linux
Andreas L. Delmelle wrote: On 01 Jul 2011, at 18:20, Rob Sargent wrote: Hi Rob snip / I'm coming to the conclusion that to guarantee all platforms use the same font I must include it in the distribution of the client. As I've said, we're already including non-standard fonts (e.g. Optima), but my naive assumption that, since it's part and parcel of PDF, simply naming Helvetica was enough is clearly wrong. Given the fact that (a substitute for) Helvetica may not be available (or just is slightly different) on the client... It is not entirely true that it's part and parcel of PDF. The PDF Specification states only that viewer applications can assume the Base14 fonts to always be available, so as not to force said viewers to include them in the application package. Not necessarily naive, but you're just bitten by the fact that, at the end of the day, there simply is no such thing as true platform-independency, especially where it concerns interoperability between two basically separate Java apps. Some things depend on the implementation of the Java runtime and the actual configuration of the OS it runs on. Assuming that you know which font is actually selected by the JVM/OS, then you could try creating a substitution mapping in FOP's config, like: substitution from font-family=Helvetica / to font-family=.../ /substitution This give me some hope, thanks. see: http://xmlgraphics.apache.org/fop/1.0/fonts.html#substitution That will force FOP to use the metrics for that font, rather than the default Base14 Helvetica (also for your FO, so there will be consistency, if that is what you are looking for). Incidentally, trying to use literal SansSerif in SVG triggered the same issue on OS X. The reason is that, for the Apple JVM SansSerif is an alias for Lucida Grande. I can confirm that I see change when adding a mapping such as above, however, the appropriate font-file cannot be parsed by FOP currently... Still, you might be able to resolve it this way on your end. Now can I just use the truetype arial which _is_ on my box (but does not rectify the current situation) and would presumably be what the pc users are getting. Or am I better off getting a commercial truetype Helvetica? That depends on what you want to do with it. Keep in mind that buying the Helvetica font would only grant you personal use. It comes pre-installed on most common systems, but that license does not permit the user-developers to just include it in their own projects. That is very likely precisely the reason why it is left out of Linux, as a matter of principle. What when you happen to run into a colleague that has the same issue? He/she should then have to buy it as well. If the vendor gets wind of you redistributing the font in your own software, or just copying it to multiple clients within your organization, he may not like it, and force you to pay more. There is a reason FOP can only redistribute the *metrics* for the Base14 fonts, not the fonts themselves. Since you're already including other fonts, in case you have not done so yet, be sure to check for those as well whether or not you are permitted to include them. Regards, Andreas --- - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: fop not handling svn rotated text on linux
I have to drop this for a bit: We've just release new software and we all know how much fun that is... Unfortunately I've had no luck with a substitution block in my fop config file _comme ca_: renderers renderer mime=application/pdf filterList !-- provides compression using zlib flate (default is on) -- valueflate/value /filterList fonts substitution substitution from font-family=Helvetica font-weight=normal font-style=normal/ to font-family=FreeSans font-weight=normal font-style=normal/ /substitution substitution from font-family=Helvetica font-weight=bold font-style=normal/ to font-family=FreeSans font-weight=bold font-style=normal/ /substitution /substitution where my svg file calls for Helvetica and I have placed the FreeSans*.ttf and corresponding xml files (self generated locally using org.apache.fop.fonts.apps.TTFReader) in my listed fonts and in the jar. I'll try to pick this up again when thing settle down here, rjs On 07/04/2011 04:44 PM, Rob Sargent wrote: Andreas L. Delmelle wrote: On 01 Jul 2011, at 18:20, Rob Sargent wrote: Hi Rob snip / I'm coming to the conclusion that to guarantee all platforms use the same font I must include it in the distribution of the client. As I've said, we're already including non-standard fonts (e.g. Optima), but my naive assumption that, since it's part and parcel of PDF, simply naming Helvetica was enough is clearly wrong. Given the fact that (a substitute for) Helvetica may not be available (or just is slightly different) on the client... It is not entirely true that it's part and parcel of PDF. The PDF Specification states only that viewer applications can assume the Base14 fonts to always be available, so as not to force said viewers to include them in the application package. Not necessarily naive, but you're just bitten by the fact that, at the end of the day, there simply is no such thing as true platform-independency, especially where it concerns interoperability between two basically separate Java apps. Some things depend on the implementation of the Java runtime and the actual configuration of the OS it runs on. Assuming that you know which font is actually selected by the JVM/OS, then you could try creating a substitution mapping in FOP's config, like: substitution from font-family=Helvetica / to font-family=.../ /substitution This give me some hope, thanks. see: http://xmlgraphics.apache.org/fop/1.0/fonts.html#substitution That will force FOP to use the metrics for that font, rather than the default Base14 Helvetica (also for your FO, so there will be consistency, if that is what you are looking for). Incidentally, trying to use literal SansSerif in SVG triggered the same issue on OS X. The reason is that, for the Apple JVM SansSerif is an alias for Lucida Grande. I can confirm that I see change when adding a mapping such as above, however, the appropriate font-file cannot be parsed by FOP currently... Still, you might be able to resolve it this way on your end. Now can I just use the truetype arial which _is_ on my box (but does not rectify the current situation) and would presumably be what the pc users are getting. Or am I better off getting a commercial truetype Helvetica? That depends on what you want to do with it. Keep in mind that buying the Helvetica font would only grant you personal use. It comes pre-installed on most common systems, but that license does not permit the user-developers to just include it in their own projects. That is very likely precisely the reason why it is left out of Linux, as a matter of principle. What when you happen to run into a colleague that has the same issue? He/she should then have to buy it as well. If the vendor gets wind of you redistributing the font in your own software, or just copying it to multiple clients within your organization, he may not like it, and force you to pay more. There is a reason FOP can only redistribute the *metrics* for the Base14 fonts, not the fonts themselves. Since you're already including other fonts, in case you have not done so yet, be sure to check for those as well whether or not you are permitted to include them. Regards, Andreas --- - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: fop not handling svn rotated text on linux
My mistake. A rash assumption that the example was simply glossing over the renderer specific stuff. (Seemed reasonable to me that one might want different fonts in different renderers) I now have the following (partial) config. file and am still not getting a clean Joint. fop version=1.0 !-- Base URL for resolving relative URLs -- base./base font-base./font-base fonts substitutions substitution from font-family=Helvetica font-weight=normal font-style=normal/ to font-family=FreeSans font-weight=normal font-style=normal/ /substitution substitution from font-family=Helvetica font-weight=bold font-style=normal/ to font-family=FreeSans font-weight=bold font-style=normal/ /substitution /substitutions /fonts !-- Default page-height and page-width, in case value is specified as auto -- default-page-settings height=11in width=8.26in/ !-- Information for specific renderers -- !-- Uses renderer mime type for renderers -- renderers renderer mime=application/pdf filterList !-- provides compression using zlib flate (default is on) -- valueflate/value /filterList fonts font kerning=yes embed-url=FreeSans.ttf font-triplet name=FreeSans style=normal weight=normal/ /font font kerning=yes embed-url=FreeSansBold.ttf font-triplet name=FreeSans style=normal weight=bold/ /font and I have confirmed that the font files are in my distribution. The only message I get from the FOP run is: [Fop100Stage] [Print Preview Thread] [2011-07-07 10:58:27,161] DEBUG - Looking for hyph jar: longpath/fop/fop100/fop/lib/fop-hyph.jar!/hyph/ [FOP] [Print Preview Thread] [2011-07-07 10:58:27,161] DEBUG - target-resolution set to: 72.0dpi (px2mm=0.3528) where the first message confirms for me that I'm getting the correct fop version. Sorry to be so obtuse on this but I just can't seem to make this behave nicely. On 07/07/2011 09:37 AM, Andreas L. Delmelle wrote: On 07 Jul 2011, at 16:36, Rob Sargent wrote: Hi Rob snip / Unfortunately I've had no luck with a substitution block in my fop config file _comme ca_: renderers renderer mime=application/pdf filterList !-- provides compression using zlib flate (default is on) -- valueflate/value /filterList fonts substitution Sorry if I did not make that clearer, but this is the wrong place. The substitutions block is applies to all renderers and should go into a fonts element that is a direct child of the root of the config file. See also the example on the page (link sent earlier). HTH! Andreas - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: fop not handling svn rotated text on linux
Andreas, First off, thanks for your persistence in this matter. I do not see the 'DEBUB - FontInfo ... replacing ...' line (nor the others you mention) but this is likely a symptom of the setting of my log level. Let me try to address that first. I'm perhaps erroneously confident in my fop set since I am getting other locally defined fonts in other parts of our system. rjs On 07/07/2011 11:45 AM, Andreas L. Delmelle wrote: On 07 Jul 2011, at 19:07, Rob Sargent wrote: Hi Rob My mistake. A rash assumption that the example was simply glossing over the renderer specific stuff. (Seemed reasonable to me that one might want different fonts in different renderers) I now have the following (partial) config. file and am still not getting a clean Joint. snip / OK, that looks good. and I have confirmed that the font files are in my distribution. The only message I get from the FOP run is: [Fop100Stage] [Print Preview Thread] [2011-07-07 10:58:27,161] DEBUG - Looking for hyph jar: longpath/fop/fop100/fop/lib/fop-hyph.jar!/hyph/ [FOP] [Print Preview Thread] [2011-07-07 10:58:27,161] DEBUG - target-resolution set to: 72.0dpi (px2mm=0.3528) where the first message confirms for me that I'm getting the correct fop version. Provided that this is the config file that is used, you should then see, a bit further down, something like ... DEBUG - FontInfo - Helvetica,normal,400: Replacing Helvetica (priority=0) by FreeSans (priority=0) ... Do you see a reference like that? If yes, do you also see the FreeSans font being registered a bit higher up? If not, that could mean either of: - a different config is actually used at runtime - the FreeSans font failed to load properly - the FreeSans font is still not the one that Java AWT falls back on for Helvetica, so the metrics still don't match As for the latter, the key is that via the config you _can_ make FOP follow suit, but you really need to make sure that it _is_ the FreeSans font that is used by Batik. Does that font have a narrower 'J' glyph than standard Helvetica? It doesn't seem so, from what I can tell... Regards Andreas --- - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: fop not handling svn rotated text on linux
We're beating each other up. I've moved forward to 1.0 for this problem. I can't seem to get my logger setup properly. I have these in my original log4j.properties file log4j.logger.org.apache.fop=ERROR log4j.logger.org.apache.xmlgraphics=ERROR I've changed them both to DEBUG, but only the xmlgraphics gets any noisier? On 07/07/2011 12:55 PM, Andreas L. Delmelle wrote: On 07 Jul 2011, at 20:01, Rob Sargent wrote: Hi Rob First off, thanks for your persistence in this matter. No problem. I do not see the 'DEBUB - FontInfo ... replacing ...' line (nor the others you mention) but this is likely a symptom of the setting of my log level. Let me try to address that first. Or... Oh boy, how could I miss that?! I had to go back a step and look at the very first words of the initial post. You said you were using 0.95, and font-substitution was not yet implemented then. Apologies for the confusion if that is the reason it is missing from the log. In that case, the only resort may indeed be to register explicit triplets per renderer, mapping the Helvetica family to the appropriate TTF files. Should be possible with 0.95, I believe, since it is actually required for PDF/A which was already in that release. The key then remains to find out _exactly_ which font is selected on your system to substitute Helvetica. As I hinted, it should be one with a narrower 'J', which explains the visual effect. Regards Andreas --- - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Mysterious left truncation of table in region-before: version 1.0 only
Is this by any chance a know bug in version 1.0? I place a single row table, single cell table in the region before. In version 0.95 the table, which has background set to silver renders perfectly, spanning the entire region-before. Using versions 1.0, the left ~0.83 inches of the table are obliterated. The text is centered properly as if the cell spanned the region width. I've tried placing the entire table in a block-container to no avail. Weirder still is that only in one flow, (the second of two) does the truncation appear. Both flows use the same template to define the table. The two fo files are identical (according to emacs's ediff). Is that believable? xsl:template name=title-header xsl:param name=bgcolor select=$backgroundcolor/ xsl:param name=titleText/ xsl:variable name=documentId select=/*/metadata/id/ fo:block-container fo:table background-color={$bgcolor} table-layout=fixed width=100% margin-top={$titleHeaderMargin} border-collapse=separate fo:table-column column-width=proportional-column-width(1)/ fo:table-body fo:table-row height={$titleHeaderHeight} fo:table-cell display-align=center border={$tableBorder} fo:block font-family=Optima font-size=12pt padding-before=2pt font-weight=bold text-align=center xsl:value-of select=ec:xsltConvertDocumentName($documentId, $titleText)/ /fo:block /fo:table-cell /fo:table-row /fo:table-body /fo:table /fo:block-container /xsl:template - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Mysterious left truncation of table in region-before: version 1.0 only
Understood. It'll take some work to trim the fo, since our documents are so heavily populated with medical images. Hence I wanted to be sure this wasn't a known issue. I'll be on vacation next week so don't wait up for me. :) Cheers, rjs Andreas L. Delmelle wrote: On 14 Jul 2011, at 05:58, Rob Sargent wrote: Hi Rob Is this by any chance a know bug in version 1.0? Searching for open issues in Bugzilla that contain both table and region-before yielded no results. So, I would assume that, if it is a bug, it is not a known one (or already fixed in trunk --didn't search the closed bugs). At any rate, sorry to keep repeating this, but... it is difficult --not to say: virtually impossible- to say more without the actual FO file. Preferably, if not too time-consuming, trimmed down to the smallest FO that shows the issue. Is it possible to post something like that here? If you can't because it contains confidential info, you can send it to me off-list if that works for you. I place a single row table, single cell table in the region before. In version 0.95 the table, which has background set to silver renders perfectly, spanning the entire region-before. Using versions 1.0, the left ~0.83 inches of the table are obliterated. The text is centered properly as if the cell spanned the region width. .83in is almost 60pt, 'roughly' .83in could be exactly that. Perhaps this gives a clue? Is there some margin/indent specified as 60pt? If you specify a border on the table, does that disappear on the left as well? I've tried placing the entire table in a block-container to no avail. Weirder still is that only in one flow, (the second of two) does the truncation appear. Both flows use the same template to define the table. The two fo files are identical (according to emacs's ediff). Is that believable? While that seems strange, I would not rule it out without having taken a closer look. KR Andreas --- - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Mysterious left truncation of table in region-before: version 1.0 only
Drats. I played with the fo after attaching it and before sending. The commented-out region-before lines are the ones which cause the problem. On 07/14/2011 09:51 PM, Rob Sargent wrote: Call off the hounds, I've found the root cause. I still think it's quite interesting how the two version deal with the situation so differently. As I said there are two flows (or more correctly? page-sequences). The definition of the region-before in the first sequence is more specific in it's dimensions. Here a left-hand page definition for this sequence: fo:simple-page-master margin-bottom=0.6in margin-top=0in page-height=11in page-width=8.5in master-name=rest-even fo:region-body margin-left=0.0in margin-right=0.833in margin-bottom=0.7in margin-top=0.66in column-gap=0.25in column-count=2 / fo:region-before margin-top=5mm margin-left=0.75in margin-right=0.833in extent=0.66in region-name=header-rest / fo:region-start extent=0.75in region-name=sidebar-left / /fo:simple-page-master where as the second sequence used region-before definitions like this: fo:simple-page-master page-width=8.5in page-height=11in margin=0in 0.833in 0in 0in master-name=leftimages fo:region-body margin-left=0.75in margin-top=0.66in margin-bottom=0.6in column-gap=0.25in column-count=2 / fo:region-before margin-left=0.0in overflow=hidden region-name=header-images extent=0.66in / fo:region-after region-name=footer-images extent=0.7in / fo:region-start extent=0.75in region-name=sidebar-left / /fo:simple-page-master I suspect the main culprit is the 'margin-left=0.0'. This made 0.83 inches of the LEFT side of the single celled table simply disappear. One could cover the region-before with a background colour and see the background where there should have been the title cell. Running v-1.0 with-d produces nicer information than 0.95 and that helped but 0.95 was more lenient (and that helped ;) ) Rob Sargent wrote: Understood. It'll take some work to trim the fo, since our documents are so heavily populated with medical images. Hence I wanted to be sure this wasn't a known issue. I'll be on vacation next week so don't wait up for me. :) Cheers, rjs Andreas L. Delmelle wrote: On 14 Jul 2011, at 05:58, Rob Sargent wrote: Hi Rob Is this by any chance a know bug in version 1.0? Searching for open issues in Bugzilla that contain both table and region-before yielded no results. So, I would assume that, if it is a bug, it is not a known one (or already fixed in trunk --didn't search the closed bugs). At any rate, sorry to keep repeating this, but... it is difficult --not to say: virtually impossible- to say more without the actual FO file. Preferably, if not too time-consuming, trimmed down to the smallest FO that shows the issue. Is it possible to post something like that here? If you can't because it contains confidential info, you can send it to me off-list if that works for you. I place a single row table, single cell table in the region before. In version 0.95 the table, which has background set to silver renders perfectly, spanning the entire region-before. Using versions 1.0, the left ~0.83 inches of the table are obliterated. The text is centered properly as if the cell spanned the region width. .83in is almost 60pt, 'roughly' .83in could be exactly that. Perhaps this gives a clue? Is there some margin/indent specified as 60pt? If you specify a border on the table, does that disappear on the left as well? I've tried placing the entire table in a block-container to no avail. Weirder still is that only in one flow, (the second of two) does the truncation appear. Both flows use the same template to define the table. The two fo files are identical (according to emacs's ediff). Is that believable? While that seems strange, I would not rule it out without having taken a closer look. KR Andreas --- - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Mysterious left truncation of table in region-before: version 1.0 only
No the commented lines are in the fo I attached to message previous to the drats. The issue is resolved though I think the difference in the behaviour between the two revs is ,um, er, spectacular. ;) On 07/15/2011 01:44 PM, Andreas L. Delmelle wrote: On 15 Jul 2011, at 15:57, Rob Sargent wrote: Hi Rob Drats. I played with the fo after attaching it and before sending. The commented-out region-before lines are the ones which cause the problem. Sorry, but which commented lines are you referring to? I do not see any in the posted fragment... Am I missing something? Do you mean the issue is still unresolved? ... Here a left-hand page definition for this sequence: fo:simple-page-master margin-bottom=0.6in margin-top=0in page-height=11in page-width=8.5in master-name=rest-even fo:region-body margin-left=0.0in margin-right=0.833in margin-bottom=0.7in margin-top=0.66in column-gap=0.25in column-count=2 / fo:region-before margin-top=5mm margin-left=0.75in margin-right=0.833in extent=0.66in region-name=header-rest / OK, I see. Just so you know, margin-* properties do not apply to region-before, nor to any of the other side-regions for that matter. Apparently, given your description, this would be handled incorrectly in FOP 1.0. That said, however, I cannot reproduce such an issue with FOP trunk. Admittedly, I am trying to piece together a sample using the simple-page-master you posted, and FOP, as I half expected, just seems to ignore the margin. As the spec states, literally: Every formatting property may be specified on every formatting object. So, it is not an error. It should not have side-effects either, though... KR Andreas --- - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Outputting intrinsic dimension info of images
What type if images are you using? On unix, the 'file' command on .png files gives the dimension. For tiff I use tiff-info. On 07/26/2011 10:42 AM, Erik Wiklander wrote: Hi, I'm using fo:external-graphic to include images in the pdf. Is there any way that I can find out the intrinsic width and height of an image? So that I can include that information in the resulting pdf. Thanks //Erik
Re: Content spanning multiple pages issue
OP might also be interested in calculating the required offset on the second page (end of the table) at which to place (absolutely??) the follow-on text. If so follow the (ill-named) thread breakpoint suggestions please. One is tempted to ask why the WYSIWYG editor doesn't open a second page... Andreas L. Delmelle wrote: On 30 Jul 2011, at 21:13, Fernando Israel wrote: Hi Fernando, snip / So I now have to rephrase the question. Can I have a table within an absolute postioned block container go over to a second page it its length requires so ?. I guess that the answer is no, but I better ask. You guess correct. BTW, it just occurred to me, while re-examining the FO you sent, that the 'position' property does not apply to fo:block, so it actually serves no purpose there. Specifying the property can almost be seen as wasteful, because it 'overburdens' the property parser. Big word, because it does not matter _that_ much, but less is more. :-) If the answer is no, given my description of the objective, can you think of a different way of trying to achieve the objective ?. Let's see... The block-container will only be broken if its top/left positioning is relative, which FOP does not support. Never mind, because that is not what you want anyway. You would get a page-break, sure enough, but it would still cause _some_ of the content to be clipped. In fact, what would happen if FOP were to implement it, is that the block-container would be broken using the full available page-height, as it does not interact with the absolute-positioned ones. Then, the generated areas on each page are offset by the specified amount. Hardly surprising that nobody has ever even asked questions about this on the user-list (at least AFAIK). It doesn't look useful --but I'm straying... Given the above, and assuming that, in the example you sent, you would only need to see that one block flowing to the next page, you could try using space-before (instead of top) and start-indent (instead of left) to create the displacement effect. Something like: fo:block-container space-before=8.3cm start-indent=1cm width=auto height=auto fo:block start-indent=0 font-family=Comic Sans MS,cursive font-size=16px font-weight=700 font-style=normal text-align=left color=rgb(0,0,0) padding=4px fo:blockTEXT 9/fo:block fo:block Here is some sample code /fo:block fo:block Here is some sample code /fo:block ... That way, at least that block-container will be split over multiple pages, if necessary. Any absolute-positioned content following it, will have its single area on the last page spanned by the preceding, relative-positioned content. Since it is likely not known in advance how many lines will end up on that last page, figuring out the right value for 'top' in such cases would be quite a challenge. Using 'bottom' displacement may offer a way out, here, but still... If there is then yet more following relative-positioned content, it becomes increasingly difficult to manage, since there is no clue as to what the initial offset should be. You would have to resort to using forced breaks to make it a bit easier. It all really depends on how complex the eventual result can become. If it's only a single block that should flow to the next page, and it is not itself interrupted/followed by absolute-positioned content, the above would suffice: use a regular block-container with space-before for the initial displacement on the first page, or even leave that block-container out entirely, and just insert the block. Not sure if this will help, but it's very difficult to say, generically, how best to address this, without actually having seen some of the more complex cases. Regards, Andreas --- - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org