Re: AFP special characters from Windows TTF fonts
Hey Rob, It's generally best practice to ask fop-specific questions the fop-users mailing list, that way you'll get much better support by the community at large rather than a single person. As to your question, honestly I've barely worked on AFP or FOP for that matter in a while and wouldn't be confident answering your question. Maybe one of the other guys can help? Apologies for not being particularly useful, Mehdi On 4 April 2014 16:04, Ron Snyder rsnyd...@humana.com wrote: Hello Medhi, I wanted to reach out to you and see if you can provide me with technical notes on how Apache FOP determines mapping of Windows TTF characters to AFP output. I have been researching and reading various articles on the latest mapping (no longer using EBCDIC but UTF16) My ultimate goal is to get ‘hollow bullet’ character in Calibri TTF font to output to PDF and AFP using the same encoding. I am somewhat familiar with how to write the parameters to define AFP fonts in FOP.XCONF. Can you validate my assumptions of how FOP determines characters from window TTF fonts to FOP AFP rendered output? (based on section of code from FOP.XCONF below) font afp-font name=Bullet type=raster codepage=T100ANSI encoding=Cp500 afp-raster-font size=8 characterset=C0CA08NP/ afp-raster-font size=10 characterset=C0CA10NP/ afp-raster-font size=12 characterset=C0CA12NP/ afp-raster-font size=13 characterset=C0CA13NP/ afp-raster-font size=14 characterset=C0CA14NP/ /afp-font font-triplet name=FS Humana style=normal weight=normal/ font-triplet name=any style=normal weight=normal/ /font font afp-font name=Hollow type=raster codepage=T100ANSI encoding=Cp1252 afp-raster-font size=8 characterset=C0CA08BP/ afp-raster-font size=10 characterset=C0CA10BP/ afp-raster-font size=12 characterset=C0CA12BP/ afp-raster-font size=13 characterset=C0CA13BP/ afp-raster-font size=14 characterset=C0CA14BP/ /afp-font font-triplet name=FS Humana style=normal weight=normal/ font-triplet name=any style=normal weight=normal/ /font 1. By using the mapping for the “Bullet” and encoding=”cp500”, the mappings are based on EBCDIC (because cp500 is based on EBCDIC) and use the CODE points within the cp500 to map to matching Code Points with the T100ANSI, determining the equivalent hexadecimal point of the character (and T100ANSI is EBCDIC based) ○ (U25CB) ● (U2022) · (U00B7) (based on cp500 U2022 and U00B7 are included in the AFP character set and based on T100ANSI only U00B7 is available to be output to AFP. 2. Where are the cp500 and cp1252 files located in FOP? 3. Can ‘custom’ encoding files be used? (where should these be located?) 4. By using the mapping for the “Bullet” and encoding=”cp1252”, the mappings are based on ASCII (because cp1252 is based on ASCII keyboard mappings) and use the CODE points within the cp500 to map to matching Code Points with the T100ANSI, determining the equivalent hexadecimal point of the character (and T100ANSI is EBCDIC based) ○ (U25CB) ● (U2022) · (U00B7) (based on cp1252 U2022 and U00B7 are included in the AFP character set and based on T100ANSI only U00B7 is available to be output to AFP. (where does ASCII to EBCDIC conversion take place?) note that all characters ○ (U25CB) ● (U2022) · (U00B7) output correctly to PDF, but only U00B7 outputs to AFP If you are not the correct person to obtain this information can you provide me with the contact information of the person I should be reaching out to? Thanks, Ron The information transmitted is intended only for the person or entity to which it is addressed and may contain CONFIDENTIAL material. If you receive this material/information in error, please contact the sender and delete or destroy the material/information.
Re: java.lang.IllegalArgumentException: 14 when processing math
Hi Tyler, The standard protocol when asking the community for help is to provide the FO (FOP's input XML file) and any fonts/configuration settings you have. We can't really help you without those pieces of information; when you upload them, we can start helping you with your problem. Thanks Mehdi On 8 November 2012 22:39, tyler ty...@ifactory.com wrote: I have three different XML files with a lot of math in them (quantum physics). With each of them, when I use FOP to generate pdf's I get the following exception (let me know if you want to see the full stack trace, here's the top with all the FOP lines): In one of the files, here is one snippet that will throw the error (it's not thrown when I comment this out): Are there any symbols in there that might be unsupported? Is there something else I should be considering that might trigger this error? Please let me know if there is other information I can provide to help track this down. Thanks in advance for any pointers. -- View this message in context: http://apache-fop.1065347.n5.nabble.com/java-lang-IllegalArgumentException-14-when-processing-math-tp37306.html Sent from the FOP - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: post 1.1 config changes
Hi Jason, The backwards incompatibility of this API has been discussed quite a lot, and I'm sorry you're having these issues. If you're looking for examples for how to configure the new FopFactory, I'd say look in the source [1], there are plenty of examples on how to do it, there's also quite a bit of information on the wiki [2]. Sorry for the inconvenience, Mehdi [1] http://svn.eu.apache.org/viewvc/xmlgraphics/fop/trunk/examples/embedding/java/embedding/ [2] http://wiki.apache.org/xmlgraphics-fop/FopFactoryConfiguration On 8 November 2012 01:54, Jason Harrop jhar...@gmail.com wrote: I maintain the docx4j project I reported https://issues.apache.org/bugzilla/show_bug.cgi?id=54094 which was apparently fixed in July, but didn't make it into FOP 1.1 (just released). So, I thought I'd test a FOP nightly (20121107) to verify it has been fixed. But config seems to have changed extensively post 1.1 Post 1.1, I can see FopFactoryBuilder, mentioned at http://wiki.apache.org/xmlgraphics-fop/FopFactoryConfiguration which contains public FopFactoryBuilder setConfiguration(Configuration cfg) { fopFactoryConfigBuilder.setConfiguration(cfg); return this; } but that class didn't make it into 1.1 (it has FopFactoryConfigurator) So, Is it feasible/sensible to try to be interchangeable between FOP 1.1 and whatever is to come? Has someone written code which facilitates this? Please excuse if there are posts on this topic already. thanks .. Jason
Re: post 1.1 config changes
Hi Jason, I don't think anyone has, or if they have, they haven't published it to the community. Hope that helps, Mehdi On 8 November 2012 09:53, Jason Harrop jhar...@gmail.com wrote: Hi Mehdi Thanks for your reply. I'm happy I can write configuration code for current SVN head. But my question is whether anyone has produced/shared configuration code which works with both current SVN head, and FOP 1.1 ie using reflection as necessary. If not, we may just wait for the next release of FOP, and support only that. thanks .. Jason On Thu, Nov 8, 2012 at 8:44 PM, Mehdi Houshmand med1...@gmail.com wrote: Hi Jason, The backwards incompatibility of this API has been discussed quite a lot, and I'm sorry you're having these issues. If you're looking for examples for how to configure the new FopFactory, I'd say look in the source [1], there are plenty of examples on how to do it, there's also quite a bit of information on the wiki [2]. Sorry for the inconvenience, Mehdi [1] http://svn.eu.apache.org/viewvc/xmlgraphics/fop/trunk/examples/embedding/java/embedding/ [2] http://wiki.apache.org/xmlgraphics-fop/FopFactoryConfiguration On 8 November 2012 01:54, Jason Harrop jhar...@gmail.com wrote: I maintain the docx4j project I reported https://issues.apache.org/bugzilla/show_bug.cgi?id=54094 which was apparently fixed in July, but didn't make it into FOP 1.1 (just released). So, I thought I'd test a FOP nightly (20121107) to verify it has been fixed. But config seems to have changed extensively post 1.1 Post 1.1, I can see FopFactoryBuilder, mentioned at http://wiki.apache.org/xmlgraphics-fop/FopFactoryConfiguration which contains public FopFactoryBuilder setConfiguration(Configuration cfg) { fopFactoryConfigBuilder.setConfiguration(cfg); return this; } but that class didn't make it into 1.1 (it has FopFactoryConfigurator) So, Is it feasible/sensible to try to be interchangeable between FOP 1.1 and whatever is to come? Has someone written code which facilitates this? Please excuse if there are posts on this topic already. thanks .. Jason
Re: Need help to get Arabic working with FOP
Hi Bernardo, By the looks of the exception you've got an error in the FO you're creating, which probably has nothing to do with Arabic support. If you're wondering which fonts to use, I'd suggest you read the Apache FOP website, it should give you all the information you need [1]. As for your erroneous FO, I'd suggest the following; use an XSLT transformer to create the FO, then use that as the input to FOP and you should get some information from the error as to which FO construct is erroring. If you're still having issues, post the FO to this forum (though under a new thread, it's won't be relevant to the original thread). Hope that helps Mehdi [1] http://xmlgraphics.apache.org/fop/trunk/complexscripts.html#fonts_arabic On 8 November 2012 11:39, Bernardo Gonzalez Kriegel bgkrie...@gmail.comwrote: Hello, I think that it's not so simple, but as Eduard pointed out you need: a) a correct font b) fop-1.1 c) fo generation d) fop configuration I am also frustrated, I have not been able to generate a PDF in Arabic. So, these are my questions/experiences: a) I'm using Arial Unicode MS [1]. It's a good choice? b) I downloaded the last version from [2] c) I tried xsltproc, that converts any gliph into character codes (ej. 3.8 (#x628;#x627;#x644;#x639;#x631;#x628;#x64A;#x629;)), or saxon that leaves the gliphs intact (3.8 (بالعربية)) d) I've edited fop.xconf to register the font In any case, not only fop refuses to generate a pdf, complaining about missing glyphs and hyphenation, but aborts with many org.apache.fop.fo.ValidationException. So, anyone know's or can point to a document to learn about these questions a) What font is recommended, or have been used with success? b) What is the best way to generate the FO? c) What configuration do you use to register the font? d) There are any examples? Best regards, Bernardo [1] http://www.microsoft.com/typography/fonts/family.aspx?fid=24 [2] http://xmlgraphics.apache.org/fop/1.1/ -- Bernardo Gonzalez Kriegel bgkrie...@gmail.com On Thu, Nov 8, 2012 at 4:53 AM, Eduard Tibet eduard.ti...@i-free.comwrote: Brian, It's simple. I'll try to explain. 1. Check if fonts, available on your system, support Arabic glyphs. 2. Write down (i.e. in any text editor) the names of these fonts. 3. Open your fo file and check the names of the fonts you are using. Please, note, that the font families in your fo file should have the same names as your font files in your system. 4. Try to use the exact fonts with Arabic glyphs instead of autodetect. Try to use the following: http://xmlgraphics.apache.org/fop/1.1/fonts.html#advanced (but hold the step 2 in your mind). Finally, you need to get: 1. The names of the fonts file in your system, that contains Arabic glyphs. 2. The fo file with font families that exists in your system and contains Arabic glyphs. 3. The configuration file that makes a dependency between the font files in your system and font names fo file. -- Best regards, Eduard Tibet -Original Message- From: Brian Hansen [mailto:greencopperm...@gmail.com] Sent: Thursday, November 08, 2012 11:06 AM To: fop-users@xmlgraphics.apache.org Subject: Need help to get Arabic working with FOP Hi I'm pulling my hair out in frustration! I have been trying for so long to get Arabic fonts to display correct when using Docbook (converting XML to FO using Xsltproc and then to PDF using FOP). I'm sorry, but I just don't understand the documentation for FOP. It's not clear enough for me. I'm running FOP 1.0 on Linux. I need to know exacty, step by step, what I need to do to get Arabic text rendered properly. Instead # is shown. I have created this file foprc.xconf: fop renderers renderer mime=application/pdf fonts auto-detect/ /fonts /renderer /renderers /fop When I run FOP I use this command: $ fop -c foprc.xconf -fo filename.fo -pdf filename.pdf I get this message: SNIP Font Symbol,normal,700 not found. Substituting with Symbol,normal,400. Font ZapfDingbats,normal,700 not found. Substituting with ZapfDingbats,normal,400. Glyph ? (0x627, afii57415) not available in font Helvetica-Bold. Glyph ? (0x644, afii57444) not available in font Helvetica-Bold. Glyph ? (0x625, afii57413) not available in font Helvetica-Bold. Glyph ? (0x633, afii57427) not available in font Helvetica-Bold. Glyph ? (0x645, afii57445) not available in font Helvetica-Bold. Glyph ? (0x64a, afii57450) not available in font Helvetica-Bold. Glyph ? (0x629, afii57417) not available in font Helvetica-Bold. Glyph ? (0x646, afii57446) not available in font Helvetica-Bold. Glyph ? (0x644, afii57444) not available in font Times-Roman. Glyph ? (0x627, afii57415) not available in font Times-Roman. Glyph ? (0x625, afii57413) not available in font Times-Roman. Glyph ? (0x647,
Re: Need help to get Arabic working with FOP
Ahh yeah, that doesn't mean it doesn't work though. You can reference fonts [1], but you'll need them installed if you want to view them. Alternatively you could either 1) buy the license or 2) uhm *cough* change the bit flag which tells Fop the font is not embeddable [2] *cough*... Woahh that was an informative cough! Obviously any changes you make to the font are ill advised in a commercial setting, but may help you test the font before purchasing it. Mehdi [1] http://xmlgraphics.apache.org/fop/1.1/fonts.html *cough* [2] http://www.microsoft.com/typography/otspec/os2.htm#fst *cough* On 8 November 2012 13:30, Bernardo Gonzalez Kriegel bgkrie...@gmail.comwrote: Hi Mehdi, You are right, I used the example and configuration sent by Luis Bernardo, and fop works well. As for the fonts, his (Luis) example used Arial, I also tested ArialUnicodeMS and works. Traditional arabic (BTW, the links on the page are wrong) produces this error: org.apache.fop.apps.FOPException: The font trado.ttf is not embeddable due to a licensing restriction. Thank you, Bernardo -- Bernardo Gonzalez Kriegel bgkrie...@gmail.com On Thu, Nov 8, 2012 at 9:12 AM, Mehdi Houshmand med1...@gmail.com wrote: Hi Bernardo, By the looks of the exception you've got an error in the FO you're creating, which probably has nothing to do with Arabic support. If you're wondering which fonts to use, I'd suggest you read the Apache FOP website, it should give you all the information you need [1]. As for your erroneous FO, I'd suggest the following; use an XSLT transformer to create the FO, then use that as the input to FOP and you should get some information from the error as to which FO construct is erroring. If you're still having issues, post the FO to this forum (though under a new thread, it's won't be relevant to the original thread). Hope that helps Mehdi [1] http://xmlgraphics.apache.org/fop/trunk/complexscripts.html#fonts_arabic On 8 November 2012 11:39, Bernardo Gonzalez Kriegel bgkrie...@gmail.comwrote: Hello, I think that it's not so simple, but as Eduard pointed out you need: a) a correct font b) fop-1.1 c) fo generation d) fop configuration I am also frustrated, I have not been able to generate a PDF in Arabic. So, these are my questions/experiences: a) I'm using Arial Unicode MS [1]. It's a good choice? b) I downloaded the last version from [2] c) I tried xsltproc, that converts any gliph into character codes (ej. 3.8 (#x628;#x627;#x644;#x639;#x631;#x628;#x64A;#x629;)), or saxon that leaves the gliphs intact (3.8 (بالعربية)) d) I've edited fop.xconf to register the font In any case, not only fop refuses to generate a pdf, complaining about missing glyphs and hyphenation, but aborts with many org.apache.fop.fo.ValidationException. So, anyone know's or can point to a document to learn about these questions a) What font is recommended, or have been used with success? b) What is the best way to generate the FO? c) What configuration do you use to register the font? d) There are any examples? Best regards, Bernardo [1] http://www.microsoft.com/typography/fonts/family.aspx?fid=24 [2] http://xmlgraphics.apache.org/fop/1.1/ -- Bernardo Gonzalez Kriegel bgkrie...@gmail.com On Thu, Nov 8, 2012 at 4:53 AM, Eduard Tibet eduard.ti...@i-free.comwrote: Brian, It's simple. I'll try to explain. 1. Check if fonts, available on your system, support Arabic glyphs. 2. Write down (i.e. in any text editor) the names of these fonts. 3. Open your fo file and check the names of the fonts you are using. Please, note, that the font families in your fo file should have the same names as your font files in your system. 4. Try to use the exact fonts with Arabic glyphs instead of autodetect. Try to use the following: http://xmlgraphics.apache.org/fop/1.1/fonts.html#advanced (but hold the step 2 in your mind). Finally, you need to get: 1. The names of the fonts file in your system, that contains Arabic glyphs. 2. The fo file with font families that exists in your system and contains Arabic glyphs. 3. The configuration file that makes a dependency between the font files in your system and font names fo file. -- Best regards, Eduard Tibet -Original Message- From: Brian Hansen [mailto:greencopperm...@gmail.com] Sent: Thursday, November 08, 2012 11:06 AM To: fop-users@xmlgraphics.apache.org Subject: Need help to get Arabic working with FOP Hi I'm pulling my hair out in frustration! I have been trying for so long to get Arabic fonts to display correct when using Docbook (converting XML to FO using Xsltproc and then to PDF using FOP). I'm sorry, but I just don't understand the documentation for FOP. It's not clear enough for me. I'm running FOP 1.0 on Linux. I need to know exacty, step by step, what I need to do to get Arabic text rendered properly. Instead # is shown. I have created this file foprc.xconf: fop
Re: FOP 1.1 out of memory
Hi Stefan, Thanks for your support, people have worked hard to give you that warm fuzzy feeling, so it's nice to know that work is appreciated. As for your FO, you need to provide a little more information: 1) Tables in the FO tend to consume quite a lot of memory, especially when they span multiple pages, are you using them for laying out the documents? 2) Fonts take up more room than they really should; are you using custom fonts? Are you embedding fonts? Those are the usual culprits that come to mind (though others may wish to add to them), if you can upload the FO, then someone will take a look at it. Hope that helps, Mehdi On 24 October 2012 19:49, Stefan Hinz stefan.h...@oracle.com wrote: I like FOP 1.1 a lot: Unlike previous versions, it tells you which page it's processing, which can make debugging easier, and also it gives you that warm fuzzy feeling that you're somewhat in control of things. :-) However, with really big books, I'm hitting a wall, like this: Okt 24, 2012 8:21:16 PM org.apache.fop.events.**LoggingEventListener processEvent INFO: Rendered page #2630. Exception in thread main java.lang.OutOfMemoryError: GC overhead limit exceeded That is, FOP stops at about 2600 pages with an out of memory error. On Stackoverflow (http://preview.tinyurl.com/**94qute5http://preview.tinyurl.com/94qute5), there's an indication why this happens: This message means that for some reason the garbage collector is taking an excessive amount of time (by default 98% of all CPU time of the process) and recovers very little memory in each run (by default 2% of the heap). This effectively means that your program stops doing any progress and is busy running only the garbage collection at all time. Does this mean it's a FOP 1.1 bug, or would there be anything I could do to give it/Java more memory and prevent it from failing? The error happens on an 8 GB RAM 4-core machine. At the time FOP ended, there was like 2 GB RAM left. -- Cheers, Stefan Hinz stefan.h...@oracle.com, MySQL Documentation Manager Phone: +49-30-82702940, Fax: +49-30-82702941, http://dev.mysql.com/doc ORACLE Deutschland B.V. Co. KG Registered Office: Riesstr. 25, 80992 Muenchen, Germany Commercial Register: Local Court Of Munich, HRA 95603 Managing Director: Jürgen Kunz General Partner: ORACLE Deutschland Verwaltung B.V. Hertogswetering 163/167, 3543 AS Utrecht, Niederlande Register Of Chamber Of Commerce: Midden-Niederlande, No. 30143697 Managing Directors: Alexander van der Ven, Astrid Kepper, Val Maher --**--**- To unsubscribe, e-mail: fop-users-unsubscribe@**xmlgraphics.apache.orgfop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-help@xmlgraphics.**apache.orgfop-users-h...@xmlgraphics.apache.org
Re: fop -version to include version number with svn_trunk?
I think this makes sense, I don't, however, know how hard it is to implement going backwards. Also, since we've just voted and released the 1.1 version, I don't think this warrants a 1.1.1 release so it might be a while before this fix is implemented in a released JAR. But it's definitely a good suggestion going forward, in my opinion. Let's see what the others think. Thanks Mehdi On 24 October 2012 17:28, Philip Olson phi...@roshambo.org wrote: Hello, While testing multiple FOP versions, sometimes I confuse myself and forget my current version. I nearly always checkout from SVN and fop -version always returns FOP Version svn-trunk but I request that it also include the branch version number. So either 0.9, 1.0, 1.1, etc. Thoughts? Regards, Philip - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: SVG text misplaced
While you may be right Pascal, I'm sure this isn't a good example of a legitimate use-case. But then what do we use? A long? Then what have we really done? Realistically we're just moving the boundaries from which FOP accurately displays text/images etc.. What I'm asking is why would a long be any more appropriate than an int? This use-case is not a legitimate use-case in my belief. I appreciate Matthias, you said that Corel Draw (I didn't even know that was still going) was used to create it, but there must be some settings in Corel Draw to decrease the canvas or similar. The image is being drawn on a ludicrously large canvas and then scaled down... If your concern is the rounding issue, I'm not sure there's necessarily an easy solution. Though PostScript and PDF support decimal numbers, some formats e.g. AFP don't have a native concept of floating-point numbers. But that's a whole 'nother can of worms. I've made my thoughts on the issues with FOP's cavalier attitude towards rounding in AFP clear previously in a bug report. On 25 September 2012 08:11, Pascal Sancho psancho@gmail.com wrote: Hi, 1st, this discussion should move to fop-dev list now. 2nd, there is definitively some issues that are due to length handled as integer (char width you pointed here, i-p-d changes from page to page because length is rounded when it result in float value (metric to imperial conversion, divisions, etc.) So, I wonder whether integer is the appropriate type for length values (I'm sure it is not). 2012/9/24 Matthias Reischenbacher matthias8...@gmx.at: Hi Mehdi, thanks a lot for having a closer look! You pointed me in the right direction and I managed to read the char width with the long data type and cast to int after the conversion back to pts. Since this is more a hack than a definitive fix, I'll don't create a patch for now. What do you think of converting all font size related variables from int to long? I didn't do so because a lot of code would have to be modified and I'm not sure how this would impact memory consumption. I'm not in full control of the SVG creation (files are exported from Corel Draw), that's the reason why the SVG file is a bit odd. Normally I don't use fo:instream-foreign-object/, that was only for providing a more compact test case. Thanks again for your help best regards, Matthias On 24.09.2012 06:14, mehdi houshmand wrote: Ok... This one's a tricksy little badger. Basically, because you're using a font-size that's so large (especially when you convert pts - mpts as FOP works in) we're basically seeing an integer-overflow issue: 2579 pts = 2579000 mpts 833mpts = width of M glyph in Helvetica In Java (read: 32-bit integers), try 2579000 * 833, the result is -2146660296, it should be 2148307000. This means when FOP attempts to draw the glyphs with the appropriate kerning, an erroneous value is being given as the glyph-width of the M character. I'm not really sure if this is a bug, there's always going to be a limitation on the size of the document FOP can produce because we have to work with integers that can overflow, if that limitation is 2147483648 / 1000 / 72 inches (or 29826 inches), I think we have enough scope there to feel assured that we're within the bounds of reasonable use. If you need any help changing your document to be a bit more FOP-friendly, please feel free to ask any further questions and I/we will try and help as much as we can. Hope that helps, Mehdi On 24 September 2012 09:38, mehdi houshmand med1...@gmail.com mailto:med1...@gmail.com wrote: Hi Matthias, I've just taken a quick look at this and I'm not really sure what you're attempting to do here. Why have you made the viewBox so large and then put scale to fit on the fo:instream-foreign-object? You can reduce the size of the view box such that you don't need to scale-to-fit the SVG image. Is there any reason why you're trying to use such large fonts sizes and drawing space? I'm going to look into why the kerning on that M is so far off, but you may be able to work around this issue. Thanks Mehdi On 24 September 2012 03:20, Matthias Reischenbacher matthias8...@gmx.at mailto:matthias8...@gmx.at wrote: Hi, one of my clients reported a strange problem with SVG text being misplaced in PDF output when very high font size values are used. The sample SVG file also uses very high viewBox values. I created a test case which reproduces the issue when increasing the font size from 2578pt to 2579pt: suddenly the characters are misaligned. The issue doesn't occur when outputting PNG or PS files, so perhaps this is only related to the PDF code. I've been debugging for several hours, but I can't find the cause. I'm
Re: Arab docbook
Hi, If you have questions about FOP, there is a fop-users mailing list where people can answer your questions. It's good to post questions there because your question will be answered by the people that know best how to solve your problem. As for bidi text, FOP 1.1rc1 [1] and trunk currently have bidi support. The website [2] has most the information you're looking for, especially the section about complex scripts [3]. If you have any further questions please don't hesitate to ask, though this is a new feature it's fairly widely used so someone should be able to help. Hope that helps, Mehdi [1] http://svn.eu.apache.org/viewvc/xmlgraphics/fop/tags/fop-1_1rc1/ [2] http://xmlgraphics.apache.org/ [3] http://xmlgraphics.apache.org/fop/trunk/complexscripts.html On 25 September 2012 15:50, Kia Teymourian k...@inf.fu-berlin.de wrote: Dear Bernardo, this is a very old mail communication in Apache FOP. So far I am informed about Apache FOP, the Problem with Bidi text is now solved in Apache FOP version 1 or in the current beta version of fop. Please read contact the apache fop developers, Mr. Mehdi Houshmand may have more update infos about this issue. Best regards, Kia Teymourian On 09/25/2012 04:41 PM, Bernardo Gonzalez Kriegel wrote: Dear Mr. Temourian, sorry to bother you with a question: I (with many other people) am trying to translate a manual to many languages, in particular one of those is Arabic. I can generate html, but until now I don't know how to generate a PDF in arabic. So, I would be very glad if you can point me to a document, howto or anything that you thinks that could help me. I would be very gratefull if you have a little time to answer, thank you very much. Bernardo PS: I found your name using google (ej. http://apache-fop.1065347.n5.nabble.com/Question-about-status-of-Bidi-support-and-Arabic-Persian-shaping-td22576.html ) PS2: We are translating the manual of an open source library system (http://es.koha-community.org/manual/) -- Bernardo Gonzalez Kriegel bgkrie...@gmail.com mailto:bgkrie...@gmail.com -- Dipl.-Inform. Kia Teymourian |Research Assistant http://www.teymourian.de Freie Universitaet Berlin| Institut fuer Informatik AG Corporate Semantic Web| Königin-Luise-Str. 24/26 http://www.corporate-semantic-web.de | 14195 Berlin, Germany Tel: +49(30)838-75254 | Fax: +49(30)838-75220 Key ID: 7E9CE257 Key Server: hkp://subkeys.pgp.net
Re: SVG text misplaced
Hi Matthias, I've just taken a quick look at this and I'm not really sure what you're attempting to do here. Why have you made the viewBox so large and then put scale to fit on the fo:instream-foreign-object? You can reduce the size of the view box such that you don't need to scale-to-fit the SVG image. Is there any reason why you're trying to use such large fonts sizes and drawing space? I'm going to look into why the kerning on that M is so far off, but you may be able to work around this issue. Thanks Mehdi On 24 September 2012 03:20, Matthias Reischenbacher matthias8...@gmx.atwrote: Hi, one of my clients reported a strange problem with SVG text being misplaced in PDF output when very high font size values are used. The sample SVG file also uses very high viewBox values. I created a test case which reproduces the issue when increasing the font size from 2578pt to 2579pt: suddenly the characters are misaligned. The issue doesn't occur when outputting PNG or PS files, so perhaps this is only related to the PDF code. I've been debugging for several hours, but I can't find the cause. I'm attaching a fo file which reproduces the issue and the current PDF output. Perhaps someone can have a look at it and tell me which code part I should check, in order to fix the issue. Thanks for your help. Best regards, Matthias - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: SVG text misplaced
Ok... This one's a tricksy little badger. Basically, because you're using a font-size that's so large (especially when you convert pts - mpts as FOP works in) we're basically seeing an integer-overflow issue: 2579 pts = 2579000 mpts 833mpts = width of M glyph in Helvetica In Java (read: 32-bit integers), try 2579000 * 833, the result is -2146660296, it should be 2148307000. This means when FOP attempts to draw the glyphs with the appropriate kerning, an erroneous value is being given as the glyph-width of the M character. I'm not really sure if this is a bug, there's always going to be a limitation on the size of the document FOP can produce because we have to work with integers that can overflow, if that limitation is 2147483648 / 1000 / 72 inches (or 29826 inches), I think we have enough scope there to feel assured that we're within the bounds of reasonable use. If you need any help changing your document to be a bit more FOP-friendly, please feel free to ask any further questions and I/we will try and help as much as we can. Hope that helps, Mehdi On 24 September 2012 09:38, mehdi houshmand med1...@gmail.com wrote: Hi Matthias, I've just taken a quick look at this and I'm not really sure what you're attempting to do here. Why have you made the viewBox so large and then put scale to fit on the fo:instream-foreign-object? You can reduce the size of the view box such that you don't need to scale-to-fit the SVG image. Is there any reason why you're trying to use such large fonts sizes and drawing space? I'm going to look into why the kerning on that M is so far off, but you may be able to work around this issue. Thanks Mehdi On 24 September 2012 03:20, Matthias Reischenbacher matthias8...@gmx.atwrote: Hi, one of my clients reported a strange problem with SVG text being misplaced in PDF output when very high font size values are used. The sample SVG file also uses very high viewBox values. I created a test case which reproduces the issue when increasing the font size from 2578pt to 2579pt: suddenly the characters are misaligned. The issue doesn't occur when outputting PNG or PS files, so perhaps this is only related to the PDF code. I've been debugging for several hours, but I can't find the cause. I'm attaching a fo file which reproduces the issue and the current PDF output. Perhaps someone can have a look at it and tell me which code part I should check, in order to fix the issue. Thanks for your help. Best regards, Matthias - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: nonexistent method signature used in examples (FopFactory.newInstance(URI)
Hi Michael, FOP trunk has had some changes made to it's public API, the link you posted is from trunk and not FOP1.1 RC1. The link below is the 1.1rc1 version of that same file. http://svn.apache.org/viewvc/xmlgraphics/fop/tags/fop-1_1rc1/examples/embedding/java/embedding/ExampleXML2PDF.java?revision=1357960view=markup Hope that helps Mehdi On 18 September 2012 13:40, Michael Megliola michael.megli...@gmail.comwrote: (Unless I am missing something...) The code examples for FOP 1.1.RC.1 use a method signature that does not exist in the distribution copy of the binaries: // configure fopFactory as desired final FopFactory fopFactory = FopFactory.newInstance(new File(.).toURI()); The related example is here: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/examples/embedding/java/embedding/ExampleXML2PDF.java?view=markup
Re: PDF Image / PDF Box / Fop
Hi Martin, Which version of the pdf-image plugin did you use? Looking at that error it looks as if you've got incompatible binaries. The FOP1.1rc1 requires the latest pdf-image plugin, I've tested it with a few documents and works fine, so try checking out trunk and compiling it. Hope that helps Mehdi On 11 September 2012 04:05, Martin Edge martin.e...@intellimail.com.auwrote: (and 0.95 works fine..) ** ** *From:* Martin Edge [mailto:martin.e...@intellimail.com.au] *Sent:* Tuesday, 11 September 2012 1:01 PM *To:* fop-users@xmlgraphics.apache.org *Subject:* PDF Image / PDF Box / Fop ** ** Hi, ** ** Trying to use PDF image on the latest FOP 1.1 rc1 and latest PDF-Image – * *** ** ** I get this for my source PDF (which in this case, is a blank pdf) ** ** Could not convert FO to PDF: Exception in thread main java.lang.VerifyError: (class: org/apache/fop/render/pdf/pdfbox/PDFBoxAdapter, method: cloneForNewDocument signature: (Ljava/lang/Object;Ljava/lang/Object;Ljava/util/Collection;)Ljava/lang/Object;) Incompatible argument to function at org.apache.fop.render.pdf.pdfbox.AbstractPDFBoxHandler.createFormForPDF(AbstractPDFBoxHandler.java:90) at org.apache.fop.render.pdf.pdfbox.PDFBoxImageHandler.handleImage(PDFBoxImageHandler.java:57) at org.apache.fop.render.intermediate.AbstractIFPainter.drawImage(AbstractIFPainter.java:228) at org.apache.fop.render.intermediate.AbstractIFPainter.drawImage(AbstractIFPainter.java:184) at org.apache.fop.render.intermediate.AbstractIFPainter.drawImageUsingImageHandler(AbstractIFPainter.java:149) at org.apache.fop.render.intermediate.AbstractIFPainter.drawImageUsingURI(AbstractIFPainter.java:271) ** ** Thought might be of interest as I believe 1.1 is almost ready to go. ** ** Thanks Martin. ** ** ** **
Re: PNG's embedded in PDFs, which are converted using PDF Image
Hi Martin, I think we had a look at this issue at some point last year, as far as I remember, transparencies aren't very well supported with the pdf-image plugin. I think the best way to implement them would be to use transparency groups to that you can better control layered transparencies. However, I haven't looked at how easy/hard any of this would be to implement. We investigated this a long time ago, so I could be wrong, but from your findings it looks like I'm not far off the mark. Sorry if that's not really of any help to you, Mehdi On 6 September 2012 10:46, Martin Edge martin.e...@intellimail.com.auwrote: Hi, ** ** Wondering if I could get some advice on how to address the issue whereby if a PNG is used within a PDF with a transparent background, and that image is then put within a PDF, where then we rely on pdf-image to convert (because ultimately I want to have the output use the less printer-resource hungry postscript) – that the transparency is converted to a black colour. ** ** Obviously the easiest answer is to just not use transparency, but I am dealing with PDFs supplied from external clients, so it would be better if I have a way of managing this. ** ** Ultimately what I am using this for is to generate flyer sheets for printing, where I am taking a base PDF as initial artwork, and then adding personalised address information for each recipient. ** ** Thanks in advance, Martin ** ** [image: Description: Description: intellimail_logo_small] *Martin Edge* ** ** ** ** image001.jpg
Re: Upgrade to fop trunk and URI resolving
Glenn, I made the necessary changes. I must admit, I didn't realise the consequences of changing the serialized form of the FontCache class so thank you for pointing that out. Mehdi On 10 August 2012 16:14, mehdi houshmand med1...@gmail.com wrote: Hi Matthias, You were, of course, correct and I've made the necessary change as well as some other improvements. Glenn, I'll take a look at this serialization ID next. Mehdi On 8 August 2012 08:30, mehdi houshmand med1...@gmail.com wrote: Ok, I'll do that at the same time. Thanks Glenn On 8 August 2012 07:49, Glenn Adams gl...@skynav.com wrote: On Wed, Aug 8, 2012 at 12:09 AM, mehdi houshmand med1...@gmail.comwrote: Do you have any more information than that? o.a.f.fonts.FontCache has changed in that URIs, which were previously stored as Strings, are now stored as java.net.URI, this means an exception is thrown when trying to deserialize the class. I believe this exception is caught somewhere and it causes a member of LazyFont to be null, is that what you're talking about? Or is there another issue? This basically means the fonts-cache isn't backwards compatible, you have to delete the old one (prior to Temp_URI_res merge) and it should regenerate with the new serialization. If you have changed the serialization for the font cache and haven't done so already, you should change the value(s) of serialVersionUID in the classes which have changed their serialization.
Re: Upgrade to fop trunk and URI resolving
Hi Matthias, You were, of course, correct and I've made the necessary change as well as some other improvements. Glenn, I'll take a look at this serialization ID next. Mehdi On 8 August 2012 08:30, mehdi houshmand med1...@gmail.com wrote: Ok, I'll do that at the same time. Thanks Glenn On 8 August 2012 07:49, Glenn Adams gl...@skynav.com wrote: On Wed, Aug 8, 2012 at 12:09 AM, mehdi houshmand med1...@gmail.comwrote: Do you have any more information than that? o.a.f.fonts.FontCache has changed in that URIs, which were previously stored as Strings, are now stored as java.net.URI, this means an exception is thrown when trying to deserialize the class. I believe this exception is caught somewhere and it causes a member of LazyFont to be null, is that what you're talking about? Or is there another issue? This basically means the fonts-cache isn't backwards compatible, you have to delete the old one (prior to Temp_URI_res merge) and it should regenerate with the new serialization. If you have changed the serialization for the font cache and haven't done so already, you should change the value(s) of serialVersionUID in the classes which have changed their serialization.
Re: Upgrade to fop trunk and URI resolving
Ok, I'll do that at the same time. Thanks Glenn On 8 August 2012 07:49, Glenn Adams gl...@skynav.com wrote: On Wed, Aug 8, 2012 at 12:09 AM, mehdi houshmand med1...@gmail.comwrote: Do you have any more information than that? o.a.f.fonts.FontCache has changed in that URIs, which were previously stored as Strings, are now stored as java.net.URI, this means an exception is thrown when trying to deserialize the class. I believe this exception is caught somewhere and it causes a member of LazyFont to be null, is that what you're talking about? Or is there another issue? This basically means the fonts-cache isn't backwards compatible, you have to delete the old one (prior to Temp_URI_res merge) and it should regenerate with the new serialization. If you have changed the serialization for the font cache and haven't done so already, you should change the value(s) of serialVersionUID in the classes which have changed their serialization.
Re: Upgrade to fop trunk and URI resolving
Hi Matthias I haven't had a chance to look at this, I will do so in the next few days. Sorry for the slow response, I will address this issue shortly. Mehdi On 2 August 2012 02:14, Matthias Reischenbacher matthias8...@gmx.at wrote: Hi Mehdi, thanks for updating the javadoc. I've been experimenting with the new API and I've found a minor bug about font configuration. Please have a look at the following piece of code of the ParserHelper inside DefaultFontConfig: private ParserHelper(Configuration cfg, boolean strict) throws FOPException { if (cfg == null || cfg.getChild(fonts, false) == null) { instance = null; } else { this.strict = strict; this.fontInfoCfg = cfg.getChild(fonts, false); instance = new DefaultFontConfig(cfg.**getChild(auto-detect, false) != null); parse(); } } The auto-detect element is not read from the this.fontInfoCfg element as it should be. Could you please fix that? Thanks, Matthias On 26.07.2012 11:03, mehdi houshmand wrote: Hi Matthias, I've added some javadocs that may help to enlighten devs about how to do some of the URI schema features you were asking about. As a potential user, if you could take a look and let me know whether it's clear enough, I'd be very grateful. I always find hard to know how much information to put in a javadoc... Thanks Mehdi On 26 July 2012 08:48, mehdi houshmand med1...@gmail.com mailto:med1...@gmail.com wrote: That was supposed to say RESOLVER FOR GIVEN SCHEMA. On 26 July 2012 08:46, mehdi houshmand med1...@gmail.com mailto:med1...@gmail.com wrote: Hi Matthias, Don't be so quick to thank us for this work, you may retract that once you start using it ;). 1. Good question. The way it works is that you give the FopFactory (either in a constructor or via the EnvironmentProfile) a base-URI, this will become the default base URI should a font-base not be given. 2. Yes, you can use a relative URI and it resolves against the default base URI described in 1). What I've tried to do is make all URIs resolve to against single base URI that is given in the constructor of the FopFactory. Interestingly though, I just noticed something we didn't consider. What if the URI given to the FopFactory isn't an absolute URI? We don't check at any point to ensure it is absolute... I think it would resolve against new URI(.) where-ever that may be. Maybe we want throw an IllegalArgumentException? I don't know. 3. There is some documentation as to how to do this, though I think we could have probably done better in publishing more detailed explanation as to what we've done here. So we have created a mechanism for handling URI schemes, since it's an integral part of the URI spec, and it's almost the raison d'etre. Look at the o.a.f.apps.io.**ResourceResolverFactory and its unit test (o.a.f.apps.io.**ResourceResolverFactoryTestCas**e) the static inner class **TestCreateSchemaAwareResourceR**esolverBuilderHelper (say that quickly 20 times) does what you're looking for. Essentially do the following: ResourceResolverFactory.**SchemaAwareResourceResolverBui**lder builder = ResourceResolverFactory.**createSchemaAwareResourceResol** verBuilder(DEFAULT RESOLVER); builder.**registerResourceResolverForSch**ema(SCHEMA, RESOLVER GIVEN SCEHMA); ... // you can add any number of schemas with their corresponding resolvers ResourceResolver resolver = builder.build(); // resolver is then used as the resolver given to either the FopFactoryBuilder or FopConfParser, either directly or via the EnvironmentProfile. I'd play around with this mechanism, it can be very powerful once you play around with URIs. You can define the the font-base as font:// and use font as the schema and thus have much finer control as to where the fonts are. This brings the full power of the URI spec to all resource acquisition. All you have to do is implement the ResourceResolver interface. Also, an FYI for you and anyone else that uses FOP in systems that require fine-grained control over I/O and file access; you can now control where FOP writes/reads from temporary files (scratch files used to save on memory.) By implementing the o.a.f.apps.io.**TempResourceResolver, you can mitigate any security risks from leaking information or any worries one may have. (Though realistically, the way FOP uses scratch files, that's not very likely, but it's always better safe than sorry.) I hope all that makes sense, if not, please feel
Re: Upgrade to fop trunk and URI resolving
Hi Jeremias, I'm sorry for the slow response, I will look at this when I get the chance to do so and get back to you. I would like to come to some sort of compromise on this, one where we're both happy with the acquisition of resources. Failing that, at least come to an agreement where neither of us are particularly happy but begrudgingly accept with a healthy amount of resentment ;) Mehdi On 26 July 2012 22:31, Jeremias Maerki d...@jeremias-maerki.ch wrote: (responded on fop-dev) Jeremias Maerki On 26.07.2012 20:17:17 mehdi houshmand wrote: I appreciate that there are inconveniences, but if you're just looking for backwards compatibility, the changes should be, for the most part, fairly minor. I'm sorry we haven't been able to convince you of the benefits of the changes, that's on me as the lead on this. I'm not sure really what else I can do to convince you, if you have specific concerns that we could address then I'd be happy to see if we can come to some sort of compromise. You talk about a java.xml.transform.URIResolver interface, are there any other things you'd like to see? On 26 July 2012 17:15, Jeremias Maerki d...@jeremias-maerki.ch wrote: That's not quite true. That worked perfectly before by setting your own JAXP URIResolver. You could even resolve a URI to a DOMSource (or SAXSource) containing an SVG image that you've dynamically built based on some data (think charts). With the new approach, you have to serialize that XML to a stream (buffered in memory or on disk) which costs performance. Not a very common use case, I know, but we're talking possibilities that are going away with the API changes. Previously, you could use Apache XML Commons Resolver for XML catalog functionality. Now you probably have to write an adapter from URIResolver to ResourceResolver (haven't had time to try that, yet). A convenience adapter is missing. Jeremias Maerki On 25.07.2012 22:25:52 Matthias Reischenbacher wrote: snip/ Btw... it's really nice that all data is loaded now through the new URI resolver. In the near future I'd like to use a custom scheme (e.g. myscheme://imageid) in order to load images instead of using HTTP. That wouldn't be possible without your change. So thanks! snip/ - 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: Upgrade to fop trunk and URI resolving
Jeremias, I was looking into this, and it became abundantly clear that I don't really know what you're trying to do with the java.xml.transform.URIResolver... Would something like this be appropriate as an adapter between the two interfaces? (The exception handling is pretty slap-dash). I don't have a great deal of experience with these XML libraries other than the fairly basic use-cases. I appreciate that the DOMSource serialization would be performance costly, but we already knew that... Mehdi On 30 July 2012 08:52, mehdi houshmand med1...@gmail.com wrote: Hi Jeremias, I'm sorry for the slow response, I will look at this when I get the chance to do so and get back to you. I would like to come to some sort of compromise on this, one where we're both happy with the acquisition of resources. Failing that, at least come to an agreement where neither of us are particularly happy but begrudgingly accept with a healthy amount of resentment ;) Mehdi On 26 July 2012 22:31, Jeremias Maerki d...@jeremias-maerki.ch wrote: (responded on fop-dev) Jeremias Maerki On 26.07.2012 20:17:17 mehdi houshmand wrote: I appreciate that there are inconveniences, but if you're just looking for backwards compatibility, the changes should be, for the most part, fairly minor. I'm sorry we haven't been able to convince you of the benefits of the changes, that's on me as the lead on this. I'm not sure really what else I can do to convince you, if you have specific concerns that we could address then I'd be happy to see if we can come to some sort of compromise. You talk about a java.xml.transform.URIResolver interface, are there any other things you'd like to see? On 26 July 2012 17:15, Jeremias Maerki d...@jeremias-maerki.ch wrote: That's not quite true. That worked perfectly before by setting your own JAXP URIResolver. You could even resolve a URI to a DOMSource (or SAXSource) containing an SVG image that you've dynamically built based on some data (think charts). With the new approach, you have to serialize that XML to a stream (buffered in memory or on disk) which costs performance. Not a very common use case, I know, but we're talking possibilities that are going away with the API changes. Previously, you could use Apache XML Commons Resolver for XML catalog functionality. Now you probably have to write an adapter from URIResolver to ResourceResolver (haven't had time to try that, yet). A convenience adapter is missing. Jeremias Maerki On 25.07.2012 22:25:52 Matthias Reischenbacher wrote: snip/ Btw... it's really nice that all data is loaded now through the new URI resolver. In the near future I'd like to use a custom scheme (e.g. myscheme://imageid) in order to load images instead of using HTTP. That wouldn't be possible without your change. So thanks! snip/ - 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 URIResolverAdapter.java Description: Binary data - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Upgrade to fop trunk and URI resolving
That was supposed to say RESOLVER FOR GIVEN SCHEMA. On 26 July 2012 08:46, mehdi houshmand med1...@gmail.com wrote: Hi Matthias, Don't be so quick to thank us for this work, you may retract that once you start using it ;). 1. Good question. The way it works is that you give the FopFactory (either in a constructor or via the EnvironmentProfile) a base-URI, this will become the default base URI should a font-base not be given. 2. Yes, you can use a relative URI and it resolves against the default base URI described in 1). What I've tried to do is make all URIs resolve to against single base URI that is given in the constructor of the FopFactory. Interestingly though, I just noticed something we didn't consider. What if the URI given to the FopFactory isn't an absolute URI? We don't check at any point to ensure it is absolute... I think it would resolve against new URI(.) where-ever that may be. Maybe we want throw an IllegalArgumentException? I don't know. 3. There is some documentation as to how to do this, though I think we could have probably done better in publishing more detailed explanation as to what we've done here. So we have created a mechanism for handling URI schemes, since it's an integral part of the URI spec, and it's almost the raison d'etre. Look at the o.a.f.apps.io.ResourceResolverFactory and its unit test (o.a.f.apps.io.ResourceResolverFactoryTestCase) the static inner class TestCreateSchemaAwareResourceResolverBuilderHelper (say that quickly 20 times) does what you're looking for. Essentially do the following: ResourceResolverFactory.SchemaAwareResourceResolverBuilder builder = ResourceResolverFactory.createSchemaAwareResourceResolverBuilder(DEFAULT RESOLVER); builder.registerResourceResolverForSchema(SCHEMA, RESOLVER GIVEN SCEHMA); ... // you can add any number of schemas with their corresponding resolvers ResourceResolver resolver = builder.build(); // resolver is then used as the resolver given to either the FopFactoryBuilder or FopConfParser, either directly or via the EnvironmentProfile. I'd play around with this mechanism, it can be very powerful once you play around with URIs. You can define the the font-base as font:// and use font as the schema and thus have much finer control as to where the fonts are. This brings the full power of the URI spec to all resource acquisition. All you have to do is implement the ResourceResolver interface. Also, an FYI for you and anyone else that uses FOP in systems that require fine-grained control over I/O and file access; you can now control where FOP writes/reads from temporary files (scratch files used to save on memory.) By implementing the o.a.f.apps.io.TempResourceResolver, you can mitigate any security risks from leaking information or any worries one may have. (Though realistically, the way FOP uses scratch files, that's not very likely, but it's always better safe than sorry.) I hope all that makes sense, if not, please feel free to ask me to clarify. Mehdi On 25 July 2012 21:25, Matthias Reischenbacher matthias8...@gmx.atwrote: Hi Mehdi, thanks for your explanation. Some questions: 1. What's the default font base directory? The same as the normal base directory? 2. Can I use a path relative to the normal base directory for the font base directory? 3. Back to URI resolving: I'm a bit afraid of breaking something if I implement my own URI resolver. What does the default resolver do? It would be nice if the default resolver would be part of the public API so that I can sub class it and just inject the authentication params (like before). Btw... it's really nice that all data is loaded now through the new URI resolver. In the near future I'd like to use a custom scheme (e.g. myscheme://imageid) in order to load images instead of using HTTP. That wouldn't be possible without your change. So thanks! Best regards, Matthias On 24.07.2012 04:23, mehdi houshmand wrote: Sorry Matthias, I'm an idiot. Not defining a font-base wasn't an over sight at all; I was just implementing a font-base injection mechanism and I remembered why we didn't allow this programmatically. You have to define the font-base using the font-base element in the fop-conf, that's the only way to do it and it's intentional. I'll take this opportunity to explain why we've done what we've done for the sake of the community, if you're not interested feel free to ignore the next section: Some of the problems we were seeing when dealing with a lot of these configuration classes was that people were adding new parameters and functionality to them incrementally, as is the case with open-source. The problem was that there were several ways of doing the same thing and getters/setters all over the place. So what we did was try and ask what would a user want to do? And how do we make that as easy as possible while still maintaining some encapsulation and immutability in these classes
Re: Upgrade to fop trunk and URI resolving
Hi Matthias, Don't be so quick to thank us for this work, you may retract that once you start using it ;). 1. Good question. The way it works is that you give the FopFactory (either in a constructor or via the EnvironmentProfile) a base-URI, this will become the default base URI should a font-base not be given. 2. Yes, you can use a relative URI and it resolves against the default base URI described in 1). What I've tried to do is make all URIs resolve to against single base URI that is given in the constructor of the FopFactory. Interestingly though, I just noticed something we didn't consider. What if the URI given to the FopFactory isn't an absolute URI? We don't check at any point to ensure it is absolute... I think it would resolve against new URI(.) where-ever that may be. Maybe we want throw an IllegalArgumentException? I don't know. 3. There is some documentation as to how to do this, though I think we could have probably done better in publishing more detailed explanation as to what we've done here. So we have created a mechanism for handling URI schemes, since it's an integral part of the URI spec, and it's almost the raison d'etre. Look at the o.a.f.apps.io.ResourceResolverFactory and its unit test (o.a.f.apps.io.ResourceResolverFactoryTestCase) the static inner class TestCreateSchemaAwareResourceResolverBuilderHelper (say that quickly 20 times) does what you're looking for. Essentially do the following: ResourceResolverFactory.SchemaAwareResourceResolverBuilder builder = ResourceResolverFactory.createSchemaAwareResourceResolverBuilder(DEFAULT RESOLVER); builder.registerResourceResolverForSchema(SCHEMA, RESOLVER GIVEN SCEHMA); ... // you can add any number of schemas with their corresponding resolvers ResourceResolver resolver = builder.build(); // resolver is then used as the resolver given to either the FopFactoryBuilder or FopConfParser, either directly or via the EnvironmentProfile. I'd play around with this mechanism, it can be very powerful once you play around with URIs. You can define the the font-base as font:// and use font as the schema and thus have much finer control as to where the fonts are. This brings the full power of the URI spec to all resource acquisition. All you have to do is implement the ResourceResolver interface. Also, an FYI for you and anyone else that uses FOP in systems that require fine-grained control over I/O and file access; you can now control where FOP writes/reads from temporary files (scratch files used to save on memory.) By implementing the o.a.f.apps.io.TempResourceResolver, you can mitigate any security risks from leaking information or any worries one may have. (Though realistically, the way FOP uses scratch files, that's not very likely, but it's always better safe than sorry.) I hope all that makes sense, if not, please feel free to ask me to clarify. Mehdi On 25 July 2012 21:25, Matthias Reischenbacher matthias8...@gmx.at wrote: Hi Mehdi, thanks for your explanation. Some questions: 1. What's the default font base directory? The same as the normal base directory? 2. Can I use a path relative to the normal base directory for the font base directory? 3. Back to URI resolving: I'm a bit afraid of breaking something if I implement my own URI resolver. What does the default resolver do? It would be nice if the default resolver would be part of the public API so that I can sub class it and just inject the authentication params (like before). Btw... it's really nice that all data is loaded now through the new URI resolver. In the near future I'd like to use a custom scheme (e.g. myscheme://imageid) in order to load images instead of using HTTP. That wouldn't be possible without your change. So thanks! Best regards, Matthias On 24.07.2012 04:23, mehdi houshmand wrote: Sorry Matthias, I'm an idiot. Not defining a font-base wasn't an over sight at all; I was just implementing a font-base injection mechanism and I remembered why we didn't allow this programmatically. You have to define the font-base using the font-base element in the fop-conf, that's the only way to do it and it's intentional. I'll take this opportunity to explain why we've done what we've done for the sake of the community, if you're not interested feel free to ignore the next section: Some of the problems we were seeing when dealing with a lot of these configuration classes was that people were adding new parameters and functionality to them incrementally, as is the case with open-source. The problem was that there were several ways of doing the same thing and getters/setters all over the place. So what we did was try and ask what would a user want to do? And how do we make that as easy as possible while still maintaining some encapsulation and immutability in these classes? How does relate to the font-base? Well, it seems like an abuse of encapsulation to allow users to set the font-base-URI directly onto the FontManager. Users
Re: Upgrade to fop trunk and URI resolving
Hi Matthias, I've added some javadocs that may help to enlighten devs about how to do some of the URI schema features you were asking about. As a potential user, if you could take a look and let me know whether it's clear enough, I'd be very grateful. I always find hard to know how much information to put in a javadoc... Thanks Mehdi On 26 July 2012 08:48, mehdi houshmand med1...@gmail.com wrote: That was supposed to say RESOLVER FOR GIVEN SCHEMA. On 26 July 2012 08:46, mehdi houshmand med1...@gmail.com wrote: Hi Matthias, Don't be so quick to thank us for this work, you may retract that once you start using it ;). 1. Good question. The way it works is that you give the FopFactory (either in a constructor or via the EnvironmentProfile) a base-URI, this will become the default base URI should a font-base not be given. 2. Yes, you can use a relative URI and it resolves against the default base URI described in 1). What I've tried to do is make all URIs resolve to against single base URI that is given in the constructor of the FopFactory. Interestingly though, I just noticed something we didn't consider. What if the URI given to the FopFactory isn't an absolute URI? We don't check at any point to ensure it is absolute... I think it would resolve against new URI(.) where-ever that may be. Maybe we want throw an IllegalArgumentException? I don't know. 3. There is some documentation as to how to do this, though I think we could have probably done better in publishing more detailed explanation as to what we've done here. So we have created a mechanism for handling URI schemes, since it's an integral part of the URI spec, and it's almost the raison d'etre. Look at the o.a.f.apps.io.ResourceResolverFactory and its unit test (o.a.f.apps.io.ResourceResolverFactoryTestCase) the static inner class TestCreateSchemaAwareResourceResolverBuilderHelper (say that quickly 20 times) does what you're looking for. Essentially do the following: ResourceResolverFactory.SchemaAwareResourceResolverBuilder builder = ResourceResolverFactory.createSchemaAwareResourceResolverBuilder(DEFAULT RESOLVER); builder.registerResourceResolverForSchema(SCHEMA, RESOLVER GIVEN SCEHMA); ... // you can add any number of schemas with their corresponding resolvers ResourceResolver resolver = builder.build(); // resolver is then used as the resolver given to either the FopFactoryBuilder or FopConfParser, either directly or via the EnvironmentProfile. I'd play around with this mechanism, it can be very powerful once you play around with URIs. You can define the the font-base as font:// and use font as the schema and thus have much finer control as to where the fonts are. This brings the full power of the URI spec to all resource acquisition. All you have to do is implement the ResourceResolver interface. Also, an FYI for you and anyone else that uses FOP in systems that require fine-grained control over I/O and file access; you can now control where FOP writes/reads from temporary files (scratch files used to save on memory.) By implementing the o.a.f.apps.io.TempResourceResolver, you can mitigate any security risks from leaking information or any worries one may have. (Though realistically, the way FOP uses scratch files, that's not very likely, but it's always better safe than sorry.) I hope all that makes sense, if not, please feel free to ask me to clarify. Mehdi On 25 July 2012 21:25, Matthias Reischenbacher matthias8...@gmx.atwrote: Hi Mehdi, thanks for your explanation. Some questions: 1. What's the default font base directory? The same as the normal base directory? 2. Can I use a path relative to the normal base directory for the font base directory? 3. Back to URI resolving: I'm a bit afraid of breaking something if I implement my own URI resolver. What does the default resolver do? It would be nice if the default resolver would be part of the public API so that I can sub class it and just inject the authentication params (like before). Btw... it's really nice that all data is loaded now through the new URI resolver. In the near future I'd like to use a custom scheme (e.g. myscheme://imageid) in order to load images instead of using HTTP. That wouldn't be possible without your change. So thanks! Best regards, Matthias On 24.07.2012 04:23, mehdi houshmand wrote: Sorry Matthias, I'm an idiot. Not defining a font-base wasn't an over sight at all; I was just implementing a font-base injection mechanism and I remembered why we didn't allow this programmatically. You have to define the font-base using the font-base element in the fop-conf, that's the only way to do it and it's intentional. I'll take this opportunity to explain why we've done what we've done for the sake of the community, if you're not interested feel free to ignore the next section: Some of the problems we were seeing when dealing with a lot of these configuration classes
Re: Upgrade to fop trunk and URI resolving
I appreciate that there are inconveniences, but if you're just looking for backwards compatibility, the changes should be, for the most part, fairly minor. I'm sorry we haven't been able to convince you of the benefits of the changes, that's on me as the lead on this. I'm not sure really what else I can do to convince you, if you have specific concerns that we could address then I'd be happy to see if we can come to some sort of compromise. You talk about a java.xml.transform.URIResolver interface, are there any other things you'd like to see? On 26 July 2012 17:15, Jeremias Maerki d...@jeremias-maerki.ch wrote: That's not quite true. That worked perfectly before by setting your own JAXP URIResolver. You could even resolve a URI to a DOMSource (or SAXSource) containing an SVG image that you've dynamically built based on some data (think charts). With the new approach, you have to serialize that XML to a stream (buffered in memory or on disk) which costs performance. Not a very common use case, I know, but we're talking possibilities that are going away with the API changes. Previously, you could use Apache XML Commons Resolver for XML catalog functionality. Now you probably have to write an adapter from URIResolver to ResourceResolver (haven't had time to try that, yet). A convenience adapter is missing. Jeremias Maerki On 25.07.2012 22:25:52 Matthias Reischenbacher wrote: snip/ Btw... it's really nice that all data is loaded now through the new URI resolver. In the near future I'd like to use a custom scheme (e.g. myscheme://imageid) in order to load images instead of using HTTP. That wouldn't be possible without your change. So thanks! snip/ - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Upgrade to fop trunk and URI resolving
Hi Matthias, The way we've implemented the interface, you can be completely in control of how HTTP is authenticated by implementing o.a.f.apps.io.ResourceResolver[1] and giving it to the FopFactoryBuilder/FopConfParser[2]. As for the base URI for fonts, you can set this in the fop-conf, we haven't created a way to set this programmatically, that was an oversight on our end. I'll enable a way to do this and get back to you. [1] http://wiki.apache.org/xmlgraphics-fop/URIResolution [2] http://wiki.apache.org/xmlgraphics-fop/FopFactoryConfiguration Hope that helps, Mehdi On 24 July 2012 00:01, Matthias Reischenbacher matthias8...@gmx.at wrote: Hi, I just tried to upgrade to latest trunk and noticed two compatibility issues with my application which I couldn't fix on my own: * The fontManager has no setBaseURL method anymore. How is the base URL set now? * The FOURIResolver class doesn't exist anymore. Sub classing it for applying HTTP basic authentication parameters is therefore not possible. See also: http://wiki.apache.org/**xmlgraphics-fop/HowTo/** BasicHttpAuthenticationhttp://wiki.apache.org/xmlgraphics-fop/HowTo/BasicHttpAuthentication How is HTTP authentication handled now? Thanks for your help, Matthias --**--**- To unsubscribe, e-mail: fop-users-unsubscribe@**xmlgraphics.apache.orgfop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-help@xmlgraphics.**apache.orgfop-users-h...@xmlgraphics.apache.org
Re: Upgrade to fop trunk and URI resolving
Sorry Matthias, I'm an idiot. Not defining a font-base wasn't an over sight at all; I was just implementing a font-base injection mechanism and I remembered why we didn't allow this programmatically. You have to define the font-base using the font-base element in the fop-conf, that's the only way to do it and it's intentional. I'll take this opportunity to explain why we've done what we've done for the sake of the community, if you're not interested feel free to ignore the next section: Some of the problems we were seeing when dealing with a lot of these configuration classes was that people were adding new parameters and functionality to them incrementally, as is the case with open-source. The problem was that there were several ways of doing the same thing and getters/setters all over the place. So what we did was try and ask what would a user want to do? And how do we make that as easy as possible while still maintaining some encapsulation and immutability in these classes? How does relate to the font-base? Well, it seems like an abuse of encapsulation to allow users to set the font-base-URI directly onto the FontManager. Users shouldn't need to care about these internal mechanisms, they should be able to just configure it and it works. So we decided to enforce a single parameter to set the font-base (font-base in the fop-conf) because th only reason someone would want to define a font-base-URI would be if they had custom fonts setup, and in order to do so they'd need a fop-conf anyways. So we might as well enforce a single point of entry for the font-base-URI, otherwise you'll have to do if (x != null) checks all over the place and how would you decide which parameter overrides which? Why should a programmatically set font-base override the one found in the font-base? How do we document this so that users it's abundantly obvious to users? We asked ourselves is there a use case for setting this programmatically rather than through the fop-conf? We couldn't see why anyone would want to do that. We have tried to reduce the number of entry points for injecting configuration parameters, for two reasons; 1) because it wasn't documented and certainly wasn't obvious which parameters overrode which, when two of the same config parameters were used; 2) for the sake of developers, so that once the FopFactory hand been created, its state is mostly immutable (it has mutable members) and we can make certain assertions on the immutability of the members. Hope that makes our intentions clear, Mehdi On 24 July 2012 07:35, mehdi houshmand med1...@gmail.com wrote: Hi Matthias, The way we've implemented the interface, you can be completely in control of how HTTP is authenticated by implementing o.a.f.apps.io.ResourceResolver[1] and giving it to the FopFactoryBuilder/FopConfParser[2]. As for the base URI for fonts, you can set this in the fop-conf, we haven't created a way to set this programmatically, that was an oversight on our end. I'll enable a way to do this and get back to you. [1] http://wiki.apache.org/xmlgraphics-fop/URIResolution [2] http://wiki.apache.org/xmlgraphics-fop/FopFactoryConfiguration Hope that helps, Mehdi On 24 July 2012 00:01, Matthias Reischenbacher matthias8...@gmx.atwrote: Hi, I just tried to upgrade to latest trunk and noticed two compatibility issues with my application which I couldn't fix on my own: * The fontManager has no setBaseURL method anymore. How is the base URL set now? * The FOURIResolver class doesn't exist anymore. Sub classing it for applying HTTP basic authentication parameters is therefore not possible. See also: http://wiki.apache.org/**xmlgraphics-fop/HowTo/** BasicHttpAuthenticationhttp://wiki.apache.org/xmlgraphics-fop/HowTo/BasicHttpAuthentication How is HTTP authentication handled now? Thanks for your help, Matthias --**--**- To unsubscribe, e-mail: fop-users-unsubscribe@**xmlgraphics.apache.orgfop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-help@xmlgraphics.**apache.orgfop-users-h...@xmlgraphics.apache.org
Re: fop and hyphenation produces NullPointerException
Hi Wilhelm, I've created a bug[1] to track this issue, I'll investigate and post any findings. Mehdi [1] https://issues.apache.org/bugzilla/show_bug.cgi?id=53586 On 21 July 2012 17:00, Wilhelm wilhelm.me...@fh-kl.de wrote: Am 21.07.2012 14:22, schrieb mehdi houshmand: Hi, This looks like the NPE is occurring during layout, could you please provide the FO that causes this issue? If you could, try and cut down the FO as minimal as possible, just so that whomever looks at this issue can find the problem as quickly as possible. attached you find the offending test.fo (it was generated from test.xml). Thanks Mehdi On 21 July 2012 13:16, Wilhelm wilhelm.me...@fh-kl.de mailto:wilhelm.me...@fh-kl.de** wrote: Am 21.07.2012 13 tel:21.07.2012%2013:47, schrieb rsarg...@xmission.com mailto:rsarg...@xmission.com**: Show the stack trace. start of the next element list is: page=112 col=0 Exception org.apache.fop.apps.__**FOPException java.lang.NullPointerException at org.apache.fop.cli.__**InputHandler.transformTo(__** InputHandler.java:302) at org.apache.fop.cli.__**InputHandler.renderTo(__** InputHandler.java:130) at org.apache.fop.cli.Main.__**startFOP(Main.java:174) at org.apache.fop.cli.Main.main(_**_Main.java:205) Caused by: java.lang.NullPointerException at org.apache.fop.layoutmgr.__**inline.__** InlineStackingLayoutManager.__**getChangedKnuthElements(__** InlineStackingLayoutManager.__**java:376) at org.apache.fop.layoutmgr.__**inline.InlineLayoutManager.__** getChangedKnuthElements(__**InlineLayoutManager.java:537) at org.apache.fop.layoutmgr.__**inline.__** InlineStackingLayoutManager.__**getChangedKnuthElements(__** InlineStackingLayoutManager.__**java:368) at org.apache.fop.layoutmgr.__**inline.InlineLayoutManager.__** getChangedKnuthElements(__**InlineLayoutManager.java:537) at org.apache.fop.layoutmgr.__**inline.LineLayoutManager.__** processUpdates(__**LineLayoutManager.java:1349) at org.apache.fop.layoutmgr.__**inline.LineLayoutManager.__** findHyphenationPoints(__**LineLayoutManager.java:1318) at org.apache.fop.layoutmgr.__**inline.LineLayoutManager.__** findOptimalBreakingPoints(__**LineLayoutManager.java:797) at org.apache.fop.layoutmgr.__**inline.LineLayoutManager.__** createLineBreaks(__**LineLayoutManager.java:763) at org.apache.fop.layoutmgr.__**inline.LineLayoutManager.__** getNextKnuthElements(__**LineLayoutManager.java:592) at org.apache.fop.layoutmgr.__**BlockStackingLayoutManager.__** getNextChildElements(__**BlockStackingLayoutManager.__**java:571) at org.apache.fop.layoutmgr.__**BlockStackingLayoutManager.__** getNextChildElements(__**BlockStackingLayoutManager.__**java:552) at org.apache.fop.layoutmgr.__**BlockStackingLayoutManager.__** getNextKnuthElements(__**BlockStackingLayoutManager.__**java:280) at org.apache.fop.layoutmgr.__**BlockLayoutManager.__** getNextKnuthElements(__**BlockLayoutManager.java:123) at org.apache.fop.layoutmgr.__**BlockLayoutManager.__** getNextKnuthElements(__**BlockLayoutManager.java:115) at org.apache.fop.layoutmgr.__**BlockStackingLayoutManager.__** getNextChildElements(__**BlockStackingLayoutManager.__**java:571) at org.apache.fop.layoutmgr.__**BlockStackingLayoutManager.__** getNextChildElements(__**BlockStackingLayoutManager.__**java:552) at org.apache.fop.layoutmgr.__**BlockStackingLayoutManager.__** getNextKnuthElements(__**BlockStackingLayoutManager.__**java:280) at org.apache.fop.layoutmgr.__**BlockLayoutManager.__** getNextKnuthElements(__**BlockLayoutManager.java:123) at org.apache.fop.layoutmgr.__**BlockLayoutManager.__** getNextKnuthElements(__**BlockLayoutManager.java:115) at org.apache.fop.layoutmgr.__**FlowLayoutManager.__** getNextChildElements(__**FlowLayoutManager.java:199) at org.apache.fop.layoutmgr.__**FlowLayoutManager.__** addChildElements(__**FlowLayoutManager.java:140) at org.apache.fop.layoutmgr.__**FlowLayoutManager.__** addChildElements(__**FlowLayoutManager.java:129) at org.apache.fop.layoutmgr.__**FlowLayoutManager.__** getNextKnuthElements(__**FlowLayoutManager.java:70) at org.apache.fop.layoutmgr.__**PageBreaker.__**getNextKnuthElements(__* *PageBreaker.java:216) at org.apache.fop.layoutmgr.__**AbstractBreaker.__**getNextBlockList(__* *AbstractBreaker.java:692) at org.apache.fop.layoutmgr.__**PageBreaker.getNextBlockList(_** _PageBreaker.java:149
Re: fop and hyphenation produces NullPointerException
Hi Wilhelm, I've take a look at this issue, and it's definitely on the complex side and I don't really have the time to address this at present. Could you explain why you need that empty fo:inline element? Removing that inline construct would solve your issue in the short term (obviously not an actual fix for this bug.) Hope that helps Mehdi On 23 July 2012 12:23, Pascal Sancho psancho@gmail.com wrote: Hi, I think this is the same as another issue [1]. [1] https://issues.apache.org/bugzilla/show_bug.cgi?id=48765 2012/7/23 mehdi houshmand med1...@gmail.com: Hi Wilhelm, I've created a bug[1] to track this issue, I'll investigate and post any findings. Mehdi [1] https://issues.apache.org/bugzilla/show_bug.cgi?id=53586 On 21 July 2012 17:00, Wilhelm wilhelm.me...@fh-kl.de wrote: Am 21.07.2012 14:22, schrieb mehdi houshmand: Hi, This looks like the NPE is occurring during layout, could you please provide the FO that causes this issue? If you could, try and cut down the FO as minimal as possible, just so that whomever looks at this issue can find the problem as quickly as possible. attached you find the offending test.fo (it was generated from test.xml). Thanks Mehdi On 21 July 2012 13:16, Wilhelm wilhelm.me...@fh-kl.de mailto:wilhelm.me...@fh-kl.de wrote: Am 21.07.2012 13 tel:21.07.2012%2013:47, schrieb rsarg...@xmission.com mailto:rsarg...@xmission.com: Show the stack trace. start of the next element list is: page=112 col=0 Exception org.apache.fop.apps.__FOPException java.lang.NullPointerException at org.apache.fop.cli.__InputHandler.transformTo(__InputHandler.java:302) at org.apache.fop.cli.__InputHandler.renderTo(__InputHandler.java:130) at org.apache.fop.cli.Main.__startFOP(Main.java:174) at org.apache.fop.cli.Main.main(__Main.java:205) Caused by: java.lang.NullPointerException at org.apache.fop.layoutmgr.__inline.__InlineStackingLayoutManager.__getChangedKnuthElements(__InlineStackingLayoutManager.__java:376) at org.apache.fop.layoutmgr.__inline.InlineLayoutManager.__getChangedKnuthElements(__InlineLayoutManager.java:537) at org.apache.fop.layoutmgr.__inline.__InlineStackingLayoutManager.__getChangedKnuthElements(__InlineStackingLayoutManager.__java:368) at org.apache.fop.layoutmgr.__inline.InlineLayoutManager.__getChangedKnuthElements(__InlineLayoutManager.java:537) at org.apache.fop.layoutmgr.__inline.LineLayoutManager.__processUpdates(__LineLayoutManager.java:1349) at org.apache.fop.layoutmgr.__inline.LineLayoutManager.__findHyphenationPoints(__LineLayoutManager.java:1318) at org.apache.fop.layoutmgr.__inline.LineLayoutManager.__findOptimalBreakingPoints(__LineLayoutManager.java:797) at org.apache.fop.layoutmgr.__inline.LineLayoutManager.__createLineBreaks(__LineLayoutManager.java:763) at org.apache.fop.layoutmgr.__inline.LineLayoutManager.__getNextKnuthElements(__LineLayoutManager.java:592) at org.apache.fop.layoutmgr.__BlockStackingLayoutManager.__getNextChildElements(__BlockStackingLayoutManager.__java:571) at org.apache.fop.layoutmgr.__BlockStackingLayoutManager.__getNextChildElements(__BlockStackingLayoutManager.__java:552) at org.apache.fop.layoutmgr.__BlockStackingLayoutManager.__getNextKnuthElements(__BlockStackingLayoutManager.__java:280) at org.apache.fop.layoutmgr.__BlockLayoutManager.__getNextKnuthElements(__BlockLayoutManager.java:123) at org.apache.fop.layoutmgr.__BlockLayoutManager.__getNextKnuthElements(__BlockLayoutManager.java:115) at org.apache.fop.layoutmgr.__BlockStackingLayoutManager.__getNextChildElements(__BlockStackingLayoutManager.__java:571) at org.apache.fop.layoutmgr.__BlockStackingLayoutManager.__getNextChildElements(__BlockStackingLayoutManager.__java:552) at org.apache.fop.layoutmgr.__BlockStackingLayoutManager.__getNextKnuthElements(__BlockStackingLayoutManager.__java:280) at org.apache.fop.layoutmgr.__BlockLayoutManager.__getNextKnuthElements(__BlockLayoutManager.java:123) at org.apache.fop.layoutmgr.__BlockLayoutManager.__getNextKnuthElements(__BlockLayoutManager.java:115) at org.apache.fop.layoutmgr.__FlowLayoutManager.__getNextChildElements(__FlowLayoutManager.java:199) at org.apache.fop.layoutmgr.__FlowLayoutManager.__addChildElements(__FlowLayoutManager.java:140) at org.apache.fop.layoutmgr.__FlowLayoutManager.__addChildElements(__FlowLayoutManager.java:129) at org.apache.fop.layoutmgr
Re: fop and hyphenation produces NullPointerException
Hi, This looks like the NPE is occurring during layout, could you please provide the FO that causes this issue? If you could, try and cut down the FO as minimal as possible, just so that whomever looks at this issue can find the problem as quickly as possible. Thanks Mehdi On 21 July 2012 13:16, Wilhelm wilhelm.me...@fh-kl.de wrote: Am 21.07.2012 13:47, schrieb rsarg...@xmission.com: Show the stack trace. start of the next element list is: page=112 col=0 Exception org.apache.fop.apps.**FOPException java.lang.NullPointerException at org.apache.fop.cli.**InputHandler.transformTo(** InputHandler.java:302) at org.apache.fop.cli.**InputHandler.renderTo(** InputHandler.java:130) at org.apache.fop.cli.Main.**startFOP(Main.java:174) at org.apache.fop.cli.Main.main(**Main.java:205) Caused by: java.lang.NullPointerException at org.apache.fop.layoutmgr.**inline.** InlineStackingLayoutManager.**getChangedKnuthElements(** InlineStackingLayoutManager.**java:376) at org.apache.fop.layoutmgr.**inline.InlineLayoutManager.** getChangedKnuthElements(**InlineLayoutManager.java:537) at org.apache.fop.layoutmgr.**inline.** InlineStackingLayoutManager.**getChangedKnuthElements(** InlineStackingLayoutManager.**java:368) at org.apache.fop.layoutmgr.**inline.InlineLayoutManager.** getChangedKnuthElements(**InlineLayoutManager.java:537) at org.apache.fop.layoutmgr.**inline.LineLayoutManager.** processUpdates(**LineLayoutManager.java:1349) at org.apache.fop.layoutmgr.**inline.LineLayoutManager.** findHyphenationPoints(**LineLayoutManager.java:1318) at org.apache.fop.layoutmgr.**inline.LineLayoutManager.** findOptimalBreakingPoints(**LineLayoutManager.java:797) at org.apache.fop.layoutmgr.**inline.LineLayoutManager.** createLineBreaks(**LineLayoutManager.java:763) at org.apache.fop.layoutmgr.**inline.LineLayoutManager.** getNextKnuthElements(**LineLayoutManager.java:592) at org.apache.fop.layoutmgr.**BlockStackingLayoutManager.** getNextChildElements(**BlockStackingLayoutManager.**java:571) at org.apache.fop.layoutmgr.**BlockStackingLayoutManager.** getNextChildElements(**BlockStackingLayoutManager.**java:552) at org.apache.fop.layoutmgr.**BlockStackingLayoutManager.** getNextKnuthElements(**BlockStackingLayoutManager.**java:280) at org.apache.fop.layoutmgr.**BlockLayoutManager.** getNextKnuthElements(**BlockLayoutManager.java:123) at org.apache.fop.layoutmgr.**BlockLayoutManager.** getNextKnuthElements(**BlockLayoutManager.java:115) at org.apache.fop.layoutmgr.**BlockStackingLayoutManager.** getNextChildElements(**BlockStackingLayoutManager.**java:571) at org.apache.fop.layoutmgr.**BlockStackingLayoutManager.** getNextChildElements(**BlockStackingLayoutManager.**java:552) at org.apache.fop.layoutmgr.**BlockStackingLayoutManager.** getNextKnuthElements(**BlockStackingLayoutManager.**java:280) at org.apache.fop.layoutmgr.**BlockLayoutManager.** getNextKnuthElements(**BlockLayoutManager.java:123) at org.apache.fop.layoutmgr.**BlockLayoutManager.** getNextKnuthElements(**BlockLayoutManager.java:115) at org.apache.fop.layoutmgr.**FlowLayoutManager.** getNextChildElements(**FlowLayoutManager.java:199) at org.apache.fop.layoutmgr.**FlowLayoutManager.** addChildElements(**FlowLayoutManager.java:140) at org.apache.fop.layoutmgr.**FlowLayoutManager.** addChildElements(**FlowLayoutManager.java:129) at org.apache.fop.layoutmgr.**FlowLayoutManager.** getNextKnuthElements(**FlowLayoutManager.java:70) at org.apache.fop.layoutmgr.**PageBreaker.**getNextKnuthElements(* *PageBreaker.java:216) at org.apache.fop.layoutmgr.**AbstractBreaker.**getNextBlockList(* *AbstractBreaker.java:692) at org.apache.fop.layoutmgr.**PageBreaker.getNextBlockList(** PageBreaker.java:149) at org.apache.fop.layoutmgr.**PageBreaker.getNextBlockList(** PageBreaker.java:132) at org.apache.fop.layoutmgr.**AbstractBreaker.doLayout(** AbstractBreaker.java:337) at org.apache.fop.layoutmgr.**PageBreaker.doLayout(** PageBreaker.java:85) at org.apache.fop.layoutmgr.**PageSequenceLayoutManager.** activateLayout(**PageSequenceLayoutManager.**java:107) at org.apache.fop.area.**AreaTreeHandler.**endPageSequence(** AreaTreeHandler.java:238) at org.apache.fop.fo.pagination.**PageSequence.endOfNode(** PageSequence.java:120) at org.apache.fop.fo.**FOTreeBuilder$MainFOHandler.** endElement(FOTreeBuilder.java:**349) at org.apache.fop.fo.**FOTreeBuilder.endElement(** FOTreeBuilder.java:177) at org.apache.xalan.transformer.**TransformerIdentityImpl.** endElement(**TransformerIdentityImpl.java:**1102) at org.apache.xerces.parsers.**AbstractSAXParser.endElement(**Unknown Source)
Re: Fonts not found in Red Hat Linux
Hi Roberto, RHEL has quite expansive documentation[1] and I'd suggest looking there and Google should cover most of your questions. The synaptic manager is an Ubuntu (maybe Debian) application for managing apt (the package installation manager), RHEL's apt-equivalent is Yum, though I don't know whether it has an equivalent GUI (synaptic manager). Depending on what you're trying to do, I'd suggest (especially if you're using custom fonts) you configure those fonts manually[2] rather than using auto-detect, it'll probably save you some hassle later down the line. Configuring the fonts manually gives you much better control over the fonts/font-names and makes debugging and font related issues much easier. Mehdi [1] http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/3/html/Reference_Guide/s1-x-fonts.html might help you [2] http://xmlgraphics.apache.org/fop/trunk/fonts.html On 18 July 2012 19:37, Roberto Cahanap rcaha...@bioreference.com wrote: Hi Rob! Thanks for responding. ** ** I am a total Linux newbie. The only thing I know is the regular commands to change directory, etc. ** ** I found out online how to find the version. We are using: Red Hat Enterprise Linux Server release 6.1 (Santiago) ** ** I don’t know how to start the config manager. ** ** Let me look online to see how I can run this config manager. ** ** -Roberto * * *From:* Rob Sargent [mailto:rsarg...@xmission.com] *Sent:* Wednesday, July 18, 2012 2:31 PM *To:* fop-users@xmlgraphics.apache.org *Subject:* Re: Fonts not found in Red Hat Linux ** ** Welcome to linux. Start the config manager (synaptic maybe, you don't save which flavor) and look for msfont On 07/18/2012 12:27 PM, Roberto Cahanap wrote: Hello, We were working in a Windows Server environment but now we have to port our application to Linux. We are getting a font not found warning when we generate the PDF. We have the config for FOP to auto-detect, and this was working fine in Windows. Our Linux admin installed the fonts in the following directory: /usr/share/fonts What can we do to fix this issue? Thanks for your replies. The information transmitted in this email and any of its attachments is intended only for the person or entity to which it is addressed and may contain BioReference Laboratories proprietary information, which is privileged, confidential, or subject to copyright belonging to BioReference Laboratories. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited and may be unlawful. If you received this in error, please contact the sender immediately and delete and destroy the communication and all of the attachments you have received and all copies thereof. ** ** The information transmitted in this email and any of its attachments is intended only for the person or entity to which it is addressed and may contain BioReference Laboratories proprietary information, which is privileged, confidential, or subject to copyright belonging to BioReference Laboratories. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited and may be unlawful. If you received this in error, please contact the sender immediately and delete and destroy the communication and all of the attachments you have received and all copies thereof.
Re: Fonts not found in Red Hat Linux
Sorry, I should also point out that typing the command fc-cache -v should give you a list of where fonts exist on the system (I don't have a RHEL system to try it on, but I'm pretty sure this works across linux.) Use the man pages (type man followed by the command) and it'll give you the documentation of a command. On 19 July 2012 08:08, mehdi houshmand med1...@gmail.com wrote: Hi Roberto, RHEL has quite expansive documentation[1] and I'd suggest looking there and Google should cover most of your questions. The synaptic manager is an Ubuntu (maybe Debian) application for managing apt (the package installation manager), RHEL's apt-equivalent is Yum, though I don't know whether it has an equivalent GUI (synaptic manager). Depending on what you're trying to do, I'd suggest (especially if you're using custom fonts) you configure those fonts manually[2] rather than using auto-detect, it'll probably save you some hassle later down the line. Configuring the fonts manually gives you much better control over the fonts/font-names and makes debugging and font related issues much easier. Mehdi [1] http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/3/html/Reference_Guide/s1-x-fonts.html might help you [2] http://xmlgraphics.apache.org/fop/trunk/fonts.html On 18 July 2012 19:37, Roberto Cahanap rcaha...@bioreference.com wrote: Hi Rob! Thanks for responding. ** ** I am a total Linux newbie. The only thing I know is the regular commands to change directory, etc. ** ** I found out online how to find the version. We are using: Red Hat Enterprise Linux Server release 6.1 (Santiago) ** ** I don’t know how to start the config manager. ** ** Let me look online to see how I can run this config manager. ** ** -Roberto * * *From:* Rob Sargent [mailto:rsarg...@xmission.com] *Sent:* Wednesday, July 18, 2012 2:31 PM *To:* fop-users@xmlgraphics.apache.org *Subject:* Re: Fonts not found in Red Hat Linux ** ** Welcome to linux. Start the config manager (synaptic maybe, you don't save which flavor) and look for msfont On 07/18/2012 12:27 PM, Roberto Cahanap wrote: Hello, We were working in a Windows Server environment but now we have to port our application to Linux. We are getting a font not found warning when we generate the PDF. We have the config for FOP to auto-detect, and this was working fine in Windows. Our Linux admin installed the fonts in the following directory: /usr/share/fonts What can we do to fix this issue? Thanks for your replies. The information transmitted in this email and any of its attachments is intended only for the person or entity to which it is addressed and may contain BioReference Laboratories proprietary information, which is privileged, confidential, or subject to copyright belonging to BioReference Laboratories. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited and may be unlawful. If you received this in error, please contact the sender immediately and delete and destroy the communication and all of the attachments you have received and all copies thereof. ** ** The information transmitted in this email and any of its attachments is intended only for the person or entity to which it is addressed and may contain BioReference Laboratories proprietary information, which is privileged, confidential, or subject to copyright belonging to BioReference Laboratories. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited and may be unlawful. If you received this in error, please contact the sender immediately and delete and destroy the communication and all of the attachments you have received and all copies thereof.
Re: Setting encryption options on foUserAgent
Hi Jonathan, You can get the render options (FOUserAgent.getRenderOptions()) and set the encryption parameters by putting an instance of o.a.f.pdf.PDFEncryptionParams in there as such: userAgent.put(encryption-params, new PDFEncryptionParams()); I appreciate none of this is very obvious, but you can see how it's done when FOP is invoked via CLI in org.apache.fop.cli.CommandLineOptions (look at and around getPDFEncryptionParams()) Hope that helps Mehdi On 8 May 2012 20:53, Jonathan Levinson jonathan.levin...@intersystems.comwrote: Hi, ** ** I have written a FOP server that is multithreaded and gets it input over TCP/IP. ** ** I’m trying to figure out how to set encryption options on an instance of FOUserAgent. I believe I know how to set up a configuration file AND create a FopFactory from that configuration file but this won’t work in my multithreading configuration because there will be race conditions and it will be slow. I’m sending different encryption options over TCP/IP and I want individual FOUserAgents to reflect those encryption options. If I create a new FOP factory on every FOUserAgent it will slow the code down considerably, and because the configuration file is being changed for all users of the FOP factory, an FOUserAgent could inadvertently get the configuration of another FOUserAgent. ** ** Is there an API that allows one to set the encryption options on an instance of FOUserAgent? ** ** Thanks in advance for all your help! ** ** Kind Regards, Jonathan ** **
Re: Fop Performance degradation after upgrading from jdk 6 u18 to u19
Hi, I'll address your concerns inline: 2012/4/24 Αναστάσιος Χαρούλης tcharou...@gmail.com Hello, We are using Apache FOP 1.0 to create Postscript documents from xml files. After upgrading the Java Virtual Machine from 1.6 update 18 to 1.6 update 19, we noticed important performance degradation. The FOP execution time was increased about 25% - 35% (depends on the number of executions). After investigating this, we concluded that the code that was responsible for this delay was in the method setValue of inner class BeanSetter of class o.a.f.fonts.type1.AFPParser. This method uses reflection to set the value of a bean and our tests showed that the time to execute a reflection call like this was increased in jdk6 u19. We also noticed that for each FOP execution (instantiation of a org.apache.fop.apps.Fop object) the fonts are loaded in memory (field org.apache.fop.fonts.FontInfo in class AreaTreeHandler) . I think you mean o.a.f.fonts.type1.AFMParser (very different to an AFP parser) but yes, that mechanism could work just without the use of beans, but it's a fickle mechanism and it would have to be done with care. We are wondering if there is a plan for caching the loaded fonts in an object that is reused between successive executions (e.g. in the org.apache.fop.apps.FopFactory). This would mean that the extra cost would occur only in the first execution. Do you think this is a good idea or is there a specific reason for the fonts not to be cached ? No, as far as I know font caching isn't really on anyone's agenda. If someone wanted to do this properly it would be a significant amount of work. The fonts system would have to be externalized so that it behaved more like a font provision service rather than the tight coupling to FOPs layout system. This would mean a lot of code redesign and that's no small feat. If the fonts caching is not a good idea, do you think the use of reflection in the BeanSetter class could be avoided? Font caching is a good idea, it's just a lot of work... And I do think the BeanSetter could be avoided, but the current code is battle-hardened so you'd just have to make sure you test it thoroughly to avoid regressions. I wanted remove the BeanSetter system when working in that initially, but as always more pressing concerns took over. snip/ Hope that helps, Mehdi
Re: Chinese PDFs and non embedded fonts
Hi, Unless you know this specific font is embeddable (which I don't), that's not ubiquitously true. There is a flag in the font program which indicates whether it is embeddable or not [1]. If you open it an font viewer, it should tell you the restrictions set. [1] http://www.microsoft.com/typography/otspec/os2.htm#fst Mehdi On 24 April 2012 16:57, Glenn Adams gl...@skynav.com wrote: I notice at [1] that editable embedding is allowed. Note that FOP does not embed the entire font, but only those glyphs used in the document. I would be surprised if you were subject to redistribution licensing costs given this situation. [1] http://www.microsoft.com/typography/fonts/font.aspx?FM ID=1802http://www.microsoft.com/typography/fonts/font.aspx?FMID=1802 On Tue, Apr 24, 2012 at 9:46 AM, Jean-Philippe Courson jean-philippe.cour...@cognitran.com wrote: Hi Glenn, I don't want to embed the fonts to avoid significant font redistribution licensing costs. The produced PDFs will be distributed to people having the fonts installed on their machine. Thanks for your help Best regards, JP On 24 Apr 2012, at 16:28, Glenn Adams wrote: why do you *not* want to embed? note that only the actually used glyphs will be embedded in a subset font, so size should not be an issue On Tue, Apr 24, 2012 at 9:15 AM, Jean-Philippe Courson jean-philippe.cour...@cognitran.com wrote: Hi Glenn, Thanks for your reply. In your example, you are embedding the font: font embed-url=simsun.ttf the embed-url attribute will get the font embedded. I have no problem creating a chinese PDF when the font is embedded. The issue I am raising is when trying to reference (not embed) the font. Thanks for your help, Best regards, JP On 23 Apr 2012, at 15:26, Glenn Adams wrote: I just tried this with the font you referenced and had no problem. Attached is the configuration file and input file I used and resulting output. I'm using the current FOP 1.1dev (trunk) build. As Chris points out, you may wish to avoid auto-detect/. Also, you notice that I disabled the font cache and placed the font in a fonts subdirectory where I did the test. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Trouble with setting font base url which include space character
Hi Rob, Firstly, we are working to change how fop handles file access and I/O in general. I should note, that we're unifying all resource acquisition to resolving URIs, not URLs. The two concepts differ, and it's non-trivial. See http://wiki.apache.org/xmlgraphics-fop/URIResolution and http://wiki.apache.org/xmlgraphics-fop/FopFactoryConfiguration. Secondly, there are some misnomers in the names of these resource finders. The issue you're seeing is that /d1/rework/acres install/ac47/eclipe/plugins while it is a valid URL, it is not a valid URI. The FopFactory.setFontBaseURL(...) method delegates to the FOURIResolver to validate the String given and parses it as a URL NOT a URL. That is why you're seeing this problem. Mehdi On 17 April 2012 23:58, Rob Sargent rsarg...@xmission.com wrote: Seems to me FopFactory.setFontBaseURL(String s) is broken? Forgive the reflection calls (long story). File fontsdir = new File(bundlePath + fopHome + /fonts); URL fontsURL = fontsdir.toURI().toURL(); setFontBaseURLMethod.invoke(fopFactory, fontsURL.toExternalForm()); works fine when the directory is, shall we say, normal, but if the directory has a space the method appears to eat the %20. Caused by: java.net.MalformedURLException: Illegal character in path at index 23: file:///d1/rework/acresinstall/ac47/eclipse/plugins/com.amirsys.console_4.6.0/fop/fop100/fop/fonts/ bundlePath=/d1/rework/acres install/ac47/eclipe/plugins fopHome=com.amirsys.console_4.6.0/fop/fop100/fop I've written a test jig to see what File.toURI().toURL() does: import java.net.URL; import java.io.File; public class FileURL { public static void main(String[] args) { try { File f = new File(args[0]); URL furl = f.toURI().toURL(); System.out.println(furl.toString()); System.out.println(furl.toExternalForm()); } catch (java.net.MalformedURLException mue) { mue.printStackTrace(); } } } And that reports what I expected, an encoded path: java -cp . FileURL /d1/rework/acres\ install/ac47 file:/d1/rework/acres%20install/ac47/ file:/d1/rework/acres%20install/ac47/ I hope someone has a better plan. I do think that the FOP api should be changed to take a URL rather than a string, but that's for another day.
Re: Trouble with setting font base url which include space character
Hi Rob, Ooohh, my bad. I must have misunderstood your concern. This is an interesting little problem, the only thing I can think if is that the FopFactory overrides the FontManager.setFontBaseURL(...) method: this.fontManager = new FontManager() { /** {@inheritDoc} */ @Override public void setFontBaseURL(String fontBase) throws MalformedURLException { super.setFontBaseURL(getFOURIResolver().checkBaseURL(fontBase)); } }; But then, you're calling the setFontBaseURL(...) method on FopFactory and not FontManager, so I don't know, maybe someone else may have an idea. But could you give us all the usuals, what version of FOP you're using? Have you tried seeing if trunk has the same issue etc... Mehdi On 18 April 2012 15:39, Rob Sargent rsarg...@xmission.com wrote: Thanks Mehdi, looking forward to the API change. But I'm not sending .../acres install/..., rather (I believe) I'm sending .../acres%20install/... as the string URL. Is that not the correct format? rjs On 04/18/2012 01:43 AM, mehdi houshmand wrote: Hi Rob, Firstly, we are working to change how fop handles file access and I/O in general. I should note, that we're unifying all resource acquisition to resolving URIs, not URLs. The two concepts differ, and it's non-trivial. See http://wiki.apache.org/xmlgraphics-fop/URIResolution and http://wiki.apache.org/xmlgraphics-fop/FopFactoryConfiguration. Secondly, there are some misnomers in the names of these resource finders. The issue you're seeing is that /d1/rework/acres install/ac47/eclipe/plugins while it is a valid URL, it is not a valid URI. The FopFactory.setFontBaseURL(...) method delegates to the FOURIResolver to validate the String given and parses it as a URL NOT a URL. That is why you're seeing this problem. Mehdi On 17 April 2012 23:58, Rob Sargent rsarg...@xmission.com wrote: Seems to me FopFactory.setFontBaseURL(String s) is broken? Forgive the reflection calls (long story). File fontsdir = new File(bundlePath + fopHome + /fonts); URL fontsURL = fontsdir.toURI().toURL(); setFontBaseURLMethod.invoke(fopFactory, fontsURL.toExternalForm()); works fine when the directory is, shall we say, normal, but if the directory has a space the method appears to eat the %20. Caused by: java.net.MalformedURLException: Illegal character in path at index 23: file:///d1/rework/acresinstall/ac47/eclipse/plugins/com.amirsys.console_4.6.0/fop/fop100/fop/fonts/ bundlePath=/d1/rework/acres install/ac47/eclipe/plugins fopHome=com.amirsys.console_4.6.0/fop/fop100/fop I've written a test jig to see what File.toURI().toURL() does: import java.net.URL; import java.io.File; public class FileURL { public static void main(String[] args) { try { File f = new File(args[0]); URL furl = f.toURI().toURL(); System.out.println(furl.toString()); System.out.println(furl.toExternalForm()); } catch (java.net.MalformedURLException mue) { mue.printStackTrace(); } } } And that reports what I expected, an encoded path: java -cp . FileURL /d1/rework/acres\ install/ac47 file:/d1/rework/acres%20install/ac47/ file:/d1/rework/acres%20install/ac47/ I hope someone has a better plan. I do think that the FOP api should be changed to take a URL rather than a string, but that's for another day.
Re: Trouble with setting font base url which include space character
Oh no, I wasn't suggesting you change to the FontManager.setFontBaseURL(), I was just noting that the method is overridden. Could you provide a full stack trace, it might be interesting to note where that exception is coming from? Also, just to expedite the process, try the same thing with trunk, see what happens. From testing the method call, it should accept spaces in the String, the FOURIResolver does a lot of URI correction. Mehdi On 18 April 2012 16:50, Rob Sargent rsarg...@xmission.com wrote: And my bad too: FOP-1.0 compiled from source of official release circa 2012-03-01. You are correct in that I'm working off of FopFactory, but my debugger takes me to the same setFontBaseURL(String) you list so I'm not sure switching to FontManager would change anything. (It will take a moderate effort to switch this: the long story is that we still use older versions of fop (including to 0.20-5 I'm sorry to say) so that's why I'm using reflection (and classloader shenanigans to boot). I have not looked at recent releases for any fixes in this area. I actually expected a flood of your doing it wrong, do this instead rjs On 04/18/2012 09:19 AM, mehdi houshmand wrote: Hi Rob, Ooohh, my bad. I must have misunderstood your concern. This is an interesting little problem, the only thing I can think if is that the FopFactory overrides the FontManager.setFontBaseURL(...) method: this.fontManager = new FontManager() { /** {@inheritDoc} */ @Override public void setFontBaseURL(String fontBase) throws MalformedURLException { super.setFontBaseURL(getFOURIResolver().checkBaseURL(fontBase)); } }; But then, you're calling the setFontBaseURL(...) method on FopFactory and not FontManager, so I don't know, maybe someone else may have an idea. But could you give us all the usuals, what version of FOP you're using? Have you tried seeing if trunk has the same issue etc... Mehdi On 18 April 2012 15:39, Rob Sargent rsarg...@xmission.com wrote: Thanks Mehdi, looking forward to the API change. But I'm not sending .../acres install/..., rather (I believe) I'm sending .../acres%20install/... as the string URL. Is that not the correct format? rjs On 04/18/2012 01:43 AM, mehdi houshmand wrote: Hi Rob, Firstly, we are working to change how fop handles file access and I/O in general. I should note, that we're unifying all resource acquisition to resolving URIs, not URLs. The two concepts differ, and it's non-trivial. See http://wiki.apache.org/xmlgraphics-fop/URIResolution and http://wiki.apache.org/xmlgraphics-fop/FopFactoryConfiguration. Secondly, there are some misnomers in the names of these resource finders. The issue you're seeing is that /d1/rework/acres install/ac47/eclipe/plugins while it is a valid URL, it is not a valid URI. The FopFactory.setFontBaseURL(...) method delegates to the FOURIResolver to validate the String given and parses it as a URL NOT a URL. That is why you're seeing this problem. Mehdi On 17 April 2012 23:58, Rob Sargent rsarg...@xmission.com wrote: Seems to me FopFactory.setFontBaseURL(String s) is broken? Forgive the reflection calls (long story). File fontsdir = new File(bundlePath + fopHome + /fonts); URL fontsURL = fontsdir.toURI().toURL(); setFontBaseURLMethod.invoke(fopFactory, fontsURL.toExternalForm()); works fine when the directory is, shall we say, normal, but if the directory has a space the method appears to eat the %20. Caused by: java.net.MalformedURLException: Illegal character in path at index 23: file:///d1/rework/acresinstall/ac47/eclipse/plugins/com.amirsys.console_4.6.0/fop/fop100/fop/fonts/ bundlePath=/d1/rework/acres install/ac47/eclipe/plugins fopHome=com.amirsys.console_4.6.0/fop/fop100/fop I've written a test jig to see what File.toURI().toURL() does: import java.net.URL; import java.io.File; public class FileURL { public static void main(String[] args) { try { File f = new File(args[0]); URL furl = f.toURI().toURL(); System.out.println(furl.toString()); System.out.println(furl.toExternalForm()); } catch (java.net.MalformedURLException mue) { mue.printStackTrace(); } } } And that reports what I expected, an encoded path: java -cp . FileURL /d1/rework/acres\ install/ac47 file:/d1/rework/acres%20install/ac47/ file:/d1/rework/acres%20install/ac47/ I hope someone has a better plan. I do think that the FOP api should be changed to take a URL rather than a string, but that's for another day.
Re: FOP 0.95 font problem
Hi Khar, Firstly, the metrics XML file is deprecated in FOP 0.95 so it's not necessary, secondly, take a look at the font embedding documentation ( http://xmlgraphics.apache.org/fop/trunk/fonts.html) and it might give you a better idea of how to configure FOP. Normal issues are users are forgetting to add the font-base tag to their fop.xconf. Hope that helps, Mehdi On 20 March 2012 08:12, Khar k...@o2.pl wrote: Hi all. We are using fop 0.95 and tomcat 5.5. We are getting an exception: Failed to resolve font with embed-url 'times.ttf'|org.apache.fop.apps.FOPException: Failed to resolve font with embed-url 'times.ttf' at org.apache.fop.util.LogUtil.handleError(LogUtil.java:38) at org.apache.fop.fonts.FontInfoConfigurator.getFontInfo(FontInfoConfigurator.java:212) at org.apache.fop.fonts.FontInfoConfigurator.addFonts(FontInfoConfigurator.java:168) at org.apache.fop.fonts.FontInfoConfigurator.configure(FontInfoConfigurator.java:100) at org.apache.fop.render.PrintRendererConfigurator.buildFontList(PrintRendererConfigurator.java:106) at org.apache.fop.render.PrintRendererConfigurator.setupFontInfo(PrintRendererConfigurator.java:129) at org.apache.fop.render.intermediate.IFUtil.setupFonts(IFUtil.java:165) at org.apache.fop.render.intermediate.IFRenderer.setupFontInfo(IFRenderer.java:181) at org.apache.fop.area.RenderPagesModel.init(RenderPagesModel.java:73) at org.apache.fop.area.AreaTreeHandler.setupModel(AreaTreeHandler.java:130) at org.apache.fop.area.AreaTreeHandler.init(AreaTreeHandler.java:102) at org.apache.fop.render.RendererFactory.createFOEventHandler(RendererFactory.java:359) at org.apache.fop.fo.FOTreeBuilder.init(FOTreeBuilder.java:105) at org.apache.fop.apps.Fop.createDefaultHandler(Fop.java:101) at org.apache.fop.apps.Fop.init(Fop.java:79) at org.apache.fop.apps.FopFactory.newFop(FopFactory.java:271) Restarting tomcat with clearing work directory helps, but problem comes back after some time. This is how we declare this font in our fop.xconf: font metrics-url=times.xml kerning=yes embed-url=times.ttf ... /font Font files and fop.xconf are in the same directory. Did anybody has similar problem? -- View this message in context: http://old.nabble.com/FOP-0.95-font-problem-tp33537033p33537033.html Sent from the FOP - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: AFP FOP Font Problem
Hi Sam, For future notice, could you avoid adding a new problem to someone else's thread? It just makes it confusing for those trying to help you. As for AFP fonts, you shouldn't need to install them, but you will need to configure them as per the documentation (http://xmlgraphics.apache.org/fop/trunk/configuration.html ). If you configure FOP correctly, what you're asking for should work fine. If you do have further difficulties, could you create a new thread. Thanks Mehdi On 28 February 2012 14:26, Samuel Hunter samuel.hun...@cgi.com wrote: We are trying to setup a process to convert PDF documents to an AFP print stream and provide the ability to inject TLEs as well. Do we have to have AFP fonts installed and how do we obtain AFP fonts for a Windows envrionment? We have used the sample programs that come with FOP and are able to produce output in oher formats, but not AFP. We get a message informing us that no AFP fonts are defined and default fonts will be used. The AFP document is produced, but there is no content on any of the pages. We are new to AFP and are trying to determine the feasibilty of performing the conversion ourselves or if we need to purchase additional tools. Any help or direction would be greatly appreciated. Sam Gregoire Meier wrote: YESSS ! (one week lost for that stupid mistake !) Thank you 1 times Gregoire - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org -- View this message in context: http://old.nabble.com/AFP---FOP-Font-Problem-tp32413390p33406994.html Sent from the FOP - Users mailing list archive at Nabble.com. - 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: Producing archiving FOP intermediate format
Hi Alex, I'm not 100% what you're asking here, I must say. If it's more of a general question of backward compatibility, then I think we get back to a topic of discussion we've been having lately about FOPs API. I'd argue that IF itself is part of FOPs API (though I wouldn't make the same argument for the Area-Tree), since it's so widely used and we need to maintain some semblance of compatibility. However, and this is a big caveat, at what cost? At what cost do we want to maintain compatibility? I think if there's a compelling reason it's OK to break compatibility, which obviously affects users like yourself. As a user, you have to mitigate that risk, by either locking down the FOP version or holding onto the XSL-FO (obviously not valid if you're creating custom IF). As a more general argument, it really isn't in the interest of broader user-base that FOP 1.0 and 2.0 create identical output be that IF or PDF/AFP/whatever; FOP is evolving, there will be new features added, bugs fixed etc, all of which change the output. If I'm not mistaken, the new TaggedPDF branch merge, will create IF that's incompatible with previous versions (breaking both backward and forward compatibility). However this was well justified, since the previous accessibility architecture was limited in design an we were really pushing against the glass ceiling in terms of features. Apologies if that hasn't been a particularly helpful answer, but if you're wanting some reassurance that there won't be gratuitous changes to IF, or some transparency on plans to rip apart IF structure, then I can tell we don't plan either. However, we don't have the regression tests to guarantee backwards compatibility, and I don't think having them is a good idea. As a side note, I do think if anyone changes IF in a way that breaks compatibility, that will be made publicly clear, and it will be discussed on fop-dev (if you haven't subscribed to that, I'd advise you do). The community will decide whether said change is acceptable, and discuss the cost/reward of such a change. Mehdi On 13 February 2012 23:24, Alexios Giotis alex.gio...@gmail.com wrote: Any thoughts or comments on this ? Of course, I don't expect anybody to make a commitment that it will change in backwards compatible ways. Alexios On Feb 8, 2012, at 5:30 PM, Alexios Giotis wrote: Hi, I am already storing some millions per month of files containing FOP intermediate format (FOP_IF) using a private patched branch based on FOP 1.0. The current use case is performance. If a document is found in the store containing FOP_IF, then use it and create the final output format (typically PDF). If not, then start from XML. The retention period of the FOP_IF files is 6 months to 1 year. The XML files are kept for at least 10 years. In my tests, 85% of the time is spent on the layout and the rest for rendering. This has worked well, especially for big documents (with thousands of pages). I have no worries about the FOP_IF format and how it will evolve as I know that they will be gone after 6 months or one year max. And for sure, I can keep an older version for that long. I am now planing to use FOP in different ways and use cases such as: 1. Bypassing FOP's layout engine and it's quirks in XSL:FO input, cpu-time and memory. This means directly creating FOP_IF. With the same effort, I could use PDFBox (or iText 2.x) to create PDF files. But having FOP_IF, I also produce AFP, PS and PCL which I need and I know no other open sources renderers. 2. Longer storage of FOP_IF. Compared to storing XML, it's faster, less components are involved until the final output and it allows for easier versioning. For example, given the same XSL:FO input, FOP 2.0 will not produce the *identical* content as FOP 1.0 (I hope somebody will disagree to this :) Compared to storing PDF, the required space is much less as I have big volumes on expensive EMC storage. Secondly I retain the flexibility on selecting parts to render. Not all users have the permissions to see all parts of the documents. Also, some users see masked values (e.g. stars in place of a card number). For both cases, I really need to know your thoughts and plans for FOP_IF. Watching the lists the last 2 years, I have not noticed anything related to it. Greetings, Alexios Giotis - 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: Apache FOP extension to embed SVG QRCode
Hi Dmitriy, I'm not sure whether you're aware of this, but QR Codes are now available with Barcode4j trunk (http://barcode4j.sourceforge.net/) which also uses Zxing. I haven't taken a look at your code, but I'd suggest taking a look at what Barcode4j does, we have tested it here and it works pretty well in AFP, PostScript and PDF. If you want a few of the tests we ran, I'd be happy to make them publicly available. Mehdi On 12 February 2012 08:54, Dmitriy Yakovlev hob...@gmail.com wrote: Hi! I made simple FOP extension to embed scalable QRCodes. QRCode generation based on ZXing library. More info: http://code.google.com/p/fop-qrcode-zxing/ Sources: https://github.com/hobbut/fop-qrcode-zxing Usage: fo:instream-foreign-object qr:qr-code xmlns:qr=http://hobbut.ru/fop/qr-code/; width=5cm message=Hello, Zxing! correction=l/ /fo:instream-foreign-object -- WBR. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: [FOP 1.0] metrics font, glyph and unicode
Hi, Note: FOP 1.0 deprecates the font metrics file, it's no longer necessary. However, as for bf, gi is the glyph start index, us = unicode start index and ue is unicode end index. See http://www.microsoft.com/typography/otspec/cmap.htm for a description of the meaning of these values. Hope that helps Mehdi On 27 January 2012 13:24, polymorphisme webmas...@polymorphisme.org wrote: Ok thanks, I want obtain this file http://old.nabble.com/file/p33214044/Arial.pdf Arial.pdf with FOP 1.0. Pascal Sancho wrote: Hi, I don't understand what you want to do. What is fntsample? Where is the uploaded file? Note that with FOP 1.0, metric files are required only when you don't want to embed font in PDF. In addition, note also that metrics are the same for both Arial and Helvetica (witch is part of the 14 PDF font base), so they are interchangeable when not embedded (this is done by host system). Le 27/01/2012 12:27, polymorphisme a écrit : Hello, I want build with FOP a similar file to the upload file (build with fntsample). In a first time, I obtain the file metrics Arial.ttf.xml for the fonte Arial.ttf with the classe org.apache.fop.fonts.apps.TTFReader. But after, I don't know the link between tag bf and Unicode. bfranges bf gi=3 ue=126 us=32/bf gi=3 ue=160 us=160/bf gi=98 ue=172 us=161/ ... /bfranges Thanks. -- Pascal - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org -- View this message in context: http://old.nabble.com/-FOP-1.0--metrics-font%2C-glyph-and-unicode-tp33213482p33214044.html Sent from the FOP - Users mailing list archive at Nabble.com. - 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 1.0] metrics font, glyph and unicode
Have you tried with FOP trunk? It could be a bug that's already been fixed. If not, could you fill out a bugzilla entry please? Thanks Mehdi On 27 January 2012 13:45, Theresa Jayne Forster ther...@inbrand.co.uk wrote: I have found a problem with some fonts without metrics files I have a FRUTIGER Bold and when I just import it without metrics file, its returning the characters all on top of each other. Add the fop 1.0 metrics file and suddenly its working correctly. Kindest regards Theresa Forster Senior Software Developer -Original Message- From: polymorphisme [mailto:webmas...@polymorphisme.org] Sent: 27 January 2012 13:24 To: fop-users@xmlgraphics.apache.org Subject: Re: [FOP 1.0] metrics font, glyph and unicode Ok thanks, I want obtain this file http://old.nabble.com/file/p33214044/Arial.pdf Arial.pdf with FOP 1.0. Pascal Sancho wrote: Hi, I don't understand what you want to do. What is fntsample? Where is the uploaded file? Note that with FOP 1.0, metric files are required only when you don't want to embed font in PDF. In addition, note also that metrics are the same for both Arial and Helvetica (witch is part of the 14 PDF font base), so they are interchangeable when not embedded (this is done by host system). Le 27/01/2012 12:27, polymorphisme a écrit : Hello, I want build with FOP a similar file to the upload file (build with fntsample). In a first time, I obtain the file metrics Arial.ttf.xml for the fonte Arial.ttf with the classe org.apache.fop.fonts.apps.TTFReader. But after, I don't know the link between tag bf and Unicode. bfranges bf gi=3 ue=126 us=32/bf gi=3 ue=160 us=160/bf gi=98 ue=172 us=161/ ... /bfranges Thanks. -- Pascal - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org -- View this message in context: http://old.nabble.com/-FOP-1.0--metrics-font%2C-glyph-and-unicode-tp33213482p33214044.html Sent from the FOP - Users mailing list archive at Nabble.com. - 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: POstScrit Fonts
Hi Craig, We've sent a patch fixing this problem to Jeremias, but we've forked both FOP and Jeremias' plugin from the open versions so the code bases are a little different. If you really want, we can send a copy of the patch and you can make the necessary adjustments to the source, however I can't guarantee compatibility. There maybe some pipe work to do to make it compatible with trunk. Undoubtedly Jeremias will at some point apply a patch, with any amendments he sees fit and it will be available via his repository. Mehdi On 20 January 2012 09:05, Martin Edge martin.e...@intellimail.com.au wrote: I know I've come into this discussion very late - and the topic has moved on. That said - I've had a lot of success in the interim with converting open type and true type fonts to type 1 using trans type pro by font labs and then repairing font tables using font doctor. I've only dealt with English fonts - but they work in postscript fine. Happy to provide further info if needed Thanks Martin --- Martin Edge --- On 20/01/2012, at 7:51 PM, Chris Bowditch bowditch_ch...@hotmail.com wrote: On 20/01/2012 01:59, Craig Ringer wrote: Hi Craig, On 19/01/12 19:54, Chris Bowditch wrote: That's true of FOP trunk, but we have developed advanced font support for Postscript in a branch named TTFinPostscript, which we've successfully used to generate Chinese and Thai output. If you checkout and compile the branch you can use the feature too. Although I believe there are a few bugs which are fixed by a (as yet unapplied) patch in Bugzilla. So if you run into a bug using the branch you will need to apply the patch. Ooh, that's promising. I'll check it out. (On a side note, I wonder if fop'll move to git at any point? Bugzilla-patch - svn branch isn't the most fun workflow for non-committer contributors). I know there's a lot of folks in favour of GIT. There's been a lot of discussion on infra@ about moving Apache projects to GIT. Personally I don't understand why GIT helps with applying patches. It's easy to switch your SVN sandbox to the branch or create a new checkout from the branch. Applying the patch is just a question of right clicking on the patch file and choosing Apply Patch then running through the file list and clicking save if there are no conflicts. There shouldn't be any conflicts, Mehdi prepared the patch against the TTFinPS branch. To me GIT seems overly complicated for the day to day tasks of developing against a handful of branches. Thanks, Chris I'm working on implementing font subset merging in fop-pdf-image, or at least font re-embedding, but it's quite complicated to do and will take time, esp as I have to get this project out the door and working ASAP so I can't put too much time into that right now. I seem to be hitting another limitation whenever I find a workaround for one, though. We've discussed this before. Mehdi sent Jeremias a patch offlist to partially resolve this, but its only for fonts within the same input PDF. If you have lots of smaller PDFs then the fonts won't be de-duplicated. If you do get round to developing a more advanced de-duplication then we'd love to see a patch :-) If you need Mehdi's patch then feel free to yell and I'm sure Mehdi will happily post it here. I'd love a copy, yeah. I'm not sure how much it'll help, as font merging across PDFs requires more information to be shared between image plugin invocations than is currently possible and requires image plugins to be notified just before the trailer and resource dict are written out, too. The biggest problem will be the logic of actually merging subsets, though. I'm finding it astonishingly hard to find good information on how fonts are actually subset for PDF - the PDF ref doesn't say much at all about how the actual embedded font file is altered for subsetting. -- Craig Ringer - 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: POstScrit Fonts
Hi Craig, I don't know if you've already looked at this, but these are specs you need to look at: http://www.adobe.com/devnet/font.html The 5014 CIDFont files spec is particularly important. Hope that helps Mehdi On 20 January 2012 01:59, Craig Ringer ring...@ringerc.id.au wrote: On 19/01/12 19:54, Chris Bowditch wrote: That's true of FOP trunk, but we have developed advanced font support for Postscript in a branch named TTFinPostscript, which we've successfully used to generate Chinese and Thai output. If you checkout and compile the branch you can use the feature too. Although I believe there are a few bugs which are fixed by a (as yet unapplied) patch in Bugzilla. So if you run into a bug using the branch you will need to apply the patch. Ooh, that's promising. I'll check it out. (On a side note, I wonder if fop'll move to git at any point? Bugzilla-patch - svn branch isn't the most fun workflow for non-committer contributors). I'm working on implementing font subset merging in fop-pdf-image, or at least font re-embedding, but it's quite complicated to do and will take time, esp as I have to get this project out the door and working ASAP so I can't put too much time into that right now. I seem to be hitting another limitation whenever I find a workaround for one, though. We've discussed this before. Mehdi sent Jeremias a patch offlist to partially resolve this, but its only for fonts within the same input PDF. If you have lots of smaller PDFs then the fonts won't be de-duplicated. If you do get round to developing a more advanced de-duplication then we'd love to see a patch :-) If you need Mehdi's patch then feel free to yell and I'm sure Mehdi will happily post it here. I'd love a copy, yeah. I'm not sure how much it'll help, as font merging across PDFs requires more information to be shared between image plugin invocations than is currently possible and requires image plugins to be notified just before the trailer and resource dict are written out, too. The biggest problem will be the logic of actually merging subsets, though. I'm finding it astonishingly hard to find good information on how fonts are actually subset for PDF - the PDF ref doesn't say much at all about how the actual embedded font file is altered for subsetting. -- Craig Ringer - 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: SVG to AFP conversion
Hi Alex, My apologies for the slow response, however, because SVG goes through Batik there are issues with fonts, as you already know. We are currently looking into the issue of AFP fonts within embedded SVG. I'll post back when we have some more information. Mehdi On 6 December 2011 15:32, Alexios Giotis alex.gio...@gmail.com wrote: Just an update, I am abandoning this idea. It seems that the text inside the SVG is converted to GOCA (Vector Graphics), the quality is bad (at least for 3 viewers I tested), image rotation or transformation is not supported, it is an usual path and I have no feedback ... Alexis On Dec 5, 2011, at 2:31 PM, Alexios Giotis wrote: Hi, I was thinking of using Apache FOP 1.0 or trunk to convert SVG files to AFP. Each page will contain a single SVG, declared as fo:external-graphic src=url('page1.svg') content-height=100% content-width=100% / This works good when converting to PDF but I have some issues with AFP fonts. Before going further, I would like some advise. Do you see any problems converting a series of SVG files to AFP ? For example, the SVG contains text. Batik uses the java AWT font system while FOP has it's own. Obviously, in the output AFP, I need FOP to use and embed AFP outline fonts. Thanks, Alexios Giotis - 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: Configuring fonts for an embeded FOP 1.0
Hi Heiko, May I suggest, because working with System fonts isn't always intuitive, that you load fonts explicitly, that way, if something doesn't work. You always know it's a config issue not some System magic. Mehdi On 26 October 2011 15:54, Pascal Sancho pascal.san...@takoma.fr wrote: Hi, see below... Le 26/10/2011 15:16, Heiko a écrit : Hi, I use FOP 1.0 inside an Eclipse RCP client to generate different pdf reports. Inside my xslt file, I have lines like: fo:block font-family=Arial Narrow font-size=14pt font-style=normal font-weight=bolder padding-bottom=18pt margin=0pt space-before=6pt space-after=6pt While debugging the report generation process I looked inside the FopFactory - FontManager - FontCache -FontFileMap and found the following line: null=metrics-url=ARIALN.xml, embed-url=ARIALN.ttf, kerning=true, enc-mode=EncodingMode:auto, font-triplet=[Arial Narrow,normal,400, Arial Narrow MT,normal,400] This should be the correct font(file) for the above defined font But while proccessing the data I get the following errors: 26.10.2011 14:16:15 org.apache.fop.events.LoggingEventListener processEvent WARNUNG: Font Arial Narrow,normal,500 not found. Substituting with any,normal,400. 26.10.2011 14:16:16 org.apache.fop.events.LoggingEventListener processEvent WARNUNG: Font Arial Narrow,normal,400 not found. Substituting with any,normal,400. 26.10.2011 14:16:17 org.apache.fop.events.LoggingEventListener processEvent WARNUNG: Font Arial Narrow,normal,700 not found. Substituting with any,normal,700. If I understand it right, when I don't define a base font URL, FOP looks for at the system font path for all fonts or? No: font-base defaults to FOP base (witch defaults to current dir), see [1]. See also [2]: as Glenn said, you can either load *all* system fonts (with auto-detect feature), or load fonts from specified directory (witch can be lighter). [1] http://xmlgraphics.apache.org/fop/1.0/configuration.html#general-elements [2] http://xmlgraphics.apache.org/fop/1.0/fonts.html#basics What di I have to do (programaticlly) that FOP knows my wished font? Thanks in advance Heiko -- Pascal - 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: Default XSL Stylesheet for PDF?
Hi Jeff, FOP is an FO processor, as such it takes FO as input, not XML (even though FO is XML, XML isn't FO). You need to make sure your input is valid FO, then either use the -fo parameter or no parameter since it's the FOPs primary input. If you were curious the -xml input is used in conjunction with an XSLT (thus the -xsl parameter) to transform said XML file to FO. There is no default PDF stylesheet, this mechanism is merely a helper since a lot of users create FO using a transform. So assuming your book.xml is valid FO, the command would look like: $oreilly-handbook$ fop book.xml -pdf book.pdf Hope that helps Mehdi On 25 October 2011 08:37, Jeffrey Walton noloa...@gmail.com wrote: Hi All, I'm working on Ubuntu 10.04 (x64). I installed the FOP package, and now trying to create a PDF from O'Reilly's DocBook sample at https://prod.oreilly.com/external/tools/docbook/docs/authoring/docbook_source/. $oreilly-handbook$ fop -xml book.xml -pdf book.pdf results in an exception: Oct 25, 2011 3:34:41 AM org.apache.fop.cli.Main startFOP SEVERE: Exception org.apache.fop.apps.FOPException: XSLT file must be specified for the transform mode I believe i need to add `-xsl stylesheet`. But I don't know what the default stylesheet is. Would anyone be able to point out the default PDF stylesheet? Thanks in advance, Jeff - 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 crashes when encountering character 00AD (soft hyphen)
Hi Paul, You're getting a class not found exception for some reason, maybe there was an error when you downloaded the source? Or have you changed the source at all? Someone else may have an idea, but if you just want the JAR, you can get it from the nightly builds http://ci.apache.org/projects/xmlgraphics/fop/snapshots/. Mehdi On 21 October 2011 17:33, Paul Tremblay paulhtremb...@gmail.com wrote: Hi Mehdi, Here are the errors, as an attached file. On 10/21/11 11:16 AM, mehdi houshmand wrote: Hi Paul, Try running the JUnit task ant junit and share any errors. Mehdi On 21 October 2011 15:47, Paul Tremblaypaulhtremb...@gmail.com wrote: Hi Mehdi, I already have JUnit4 (junit-4.10.jar). That's the jar I put in my /usr/share/ant/lib Paul On 10/21/11 10:44 AM, mehdi houshmand wrote: Hi Paul, The latest trunk relies on JUnit4, so you'll have to get that JAR not the JUnit3 one, the url (https://github.com/KentBeck/junit/downloads) should help. Mehdi On 21 October 2011 15:39, Paul Tremblaypaulhtremb...@gmail.com wrote: On 10/21/11 6:04 AM, J.Pietschmann wrote: Am 21.10.2011 09:44, schrieb mehdi houshmand: however, FOP trunk doesn't produce this issue, Jeremias fixed this some time ago on trunk. J.Pietschmann Thanks. I downloaded the trunk. I followed the directions and set JAVA_HOME to /Library/Java/Home and ANT_HOME to usr/share/ant. I typed ant and got an error message that junit.jar had to be on the classpath of ant. So I copied junit from /usr/share/junit/junit.jar to /usr/share/ant/lib, and typed ant again. This time the build generated at lot of tests, and ended with this message: BUILD FAILED /Library/Java/trunk/build.xml:875: NOTE: ** * One or more of the Junit tests had Failures or Errors or were skipped! * * Please check the output above for relevant messages. * * Or use the junit-reports target to generate HTML test reports. * ** However, running a few tests: fop -fofile.fo -pdf out.pdf works fine, rendering correct PDF. Do I have an incomplete build? I can send along more detailed reports if I need to. Thanks again Paul - 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 crashes when encountering character 00AD (soft hyphen)
Hi Paul, I just ran the FO you attached and I am getting the same error message as you are with FOP 1.0, however, FOP trunk doesn't produce this issue, it might be worth trying that. Hope that helps Mehdi On 21 October 2011 03:49, Paul Tremblay paulhtremb...@gmail.com wrote: Fop crashes when processing a file with a SOFT HYPHEN character, 00AD. I am running FOP 1.0. My java is: java version 1.6.0_26 Java(TM) SE Runtime Environment (build 1.6.0_26-b03-383-11A511) Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02-383, mixed mode) The fo file is: ?xml version=1.0 encoding=UTF-8? fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format; fo:layout-master-set fo:simple-page-master master-name=simple-page margin-left=1.0in margin-right=1.0in margin-top=1.0in margin-bottom=1.0in page-width=8.5in page-height=11in fo:region-body / /fo:simple-page-master /fo:layout-master-set fo:page-sequence master-reference=simple-page format=1 initial-page-number=1 fo:flow flow-name=xsl-region-body fo:blockBelow is the block that contains the character (00AD) (soft-hyphen) causes the crash/fo:block fo:block #x00AD;/fo:block /fo:flow /fo:page-sequence /fo:root The error message is: Oct 20, 2011 9:38:01 PM org.apache.fop.cli.Main startFOP SEVERE: Exception java.lang.IllegalArgumentException: factor 0; was: -1 at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:302) at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:130) at org.apache.fop.cli.Main.startFOP(Main.java:174) at org.apache.fop.cli.Main.main(Main.java:205) Caused by: java.lang.IllegalArgumentException: factor 0; was: -1 at org.apache.fop.traits.MinOptMax.mult(MinOptMax.java:251) at org.apache.fop.layoutmgr.inline.TextLayoutManager.processWord(TextLayoutManager.java:825) at org.apache.fop.layoutmgr.inline.TextLayoutManager.getNextKnuthElements(TextLayoutManager.java:710) at org.apache.fop.layoutmgr.inline.LineLayoutManager.collectInlineKnuthElements(LineLayoutManager.java:639) at org.apache.fop.layoutmgr.inline.LineLayoutManager.getNextKnuthElements(LineLayoutManager.java:579) at org.apache.fop.layoutmgr.BlockStackingLayoutManager.getNextChildElements(BlockStackingLayoutManager.java:571) at org.apache.fop.layoutmgr.BlockStackingLayoutManager.getNextChildElements(BlockStackingLayoutManager.java:552) at org.apache.fop.layoutmgr.BlockStackingLayoutManager.getNextKnuthElements(BlockStackingLayoutManager.java:280) at org.apache.fop.layoutmgr.BlockLayoutManager.getNextKnuthElements(BlockLayoutManager.java:123) at org.apache.fop.layoutmgr.BlockLayoutManager.getNextKnuthElements(BlockLayoutManager.java:115) at org.apache.fop.layoutmgr.FlowLayoutManager.getNextChildElements(FlowLayoutManager.java:199) at org.apache.fop.layoutmgr.FlowLayoutManager.addChildElements(FlowLayoutManager.java:140) at org.apache.fop.layoutmgr.FlowLayoutManager.addChildElements(FlowLayoutManager.java:129) at org.apache.fop.layoutmgr.FlowLayoutManager.getNextKnuthElements(FlowLayoutManager.java:70) at org.apache.fop.layoutmgr.PageBreaker.getNextKnuthElements(PageBreaker.java:216) at org.apache.fop.layoutmgr.AbstractBreaker.getNextBlockList(AbstractBreaker.java:692) at org.apache.fop.layoutmgr.PageBreaker.getNextBlockList(PageBreaker.java:149) at org.apache.fop.layoutmgr.PageBreaker.getNextBlockList(PageBreaker.java:132) at org.apache.fop.layoutmgr.AbstractBreaker.doLayout(AbstractBreaker.java:337) at org.apache.fop.layoutmgr.PageBreaker.doLayout(PageBreaker.java:85) at org.apache.fop.layoutmgr.PageSequenceLayoutManager.activateLayout(PageSequenceLayoutManager.java:107) at org.apache.fop.area.AreaTreeHandler.endPageSequence(AreaTreeHandler.java:238) at org.apache.fop.fo.pagination.PageSequence.endOfNode(PageSequence.java:120) at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.endElement(FOTreeBuilder.java:349) at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:177) at org.apache.xalan.transformer.TransformerIdentityImpl.endElement(TransformerIdentityImpl.java:1101) at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source) at org.apache.xerces.xinclude.XIncludeHandler.endElement(Unknown Source) at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) at
Re: FOP crashes when encountering character 00AD (soft hyphen)
Curiously however, the soft-hyphen doesn't appear in the output document. I'll try and investigate further, someone else may already know the reason why. Mehdi On 21 October 2011 08:44, mehdi houshmand med1...@gmail.com wrote: Hi Paul, I just ran the FO you attached and I am getting the same error message as you are with FOP 1.0, however, FOP trunk doesn't produce this issue, it might be worth trying that. Hope that helps Mehdi On 21 October 2011 03:49, Paul Tremblay paulhtremb...@gmail.com wrote: Fop crashes when processing a file with a SOFT HYPHEN character, 00AD. I am running FOP 1.0. My java is: java version 1.6.0_26 Java(TM) SE Runtime Environment (build 1.6.0_26-b03-383-11A511) Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02-383, mixed mode) The fo file is: ?xml version=1.0 encoding=UTF-8? fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format; fo:layout-master-set fo:simple-page-master master-name=simple-page margin-left=1.0in margin-right=1.0in margin-top=1.0in margin-bottom=1.0in page-width=8.5in page-height=11in fo:region-body / /fo:simple-page-master /fo:layout-master-set fo:page-sequence master-reference=simple-page format=1 initial-page-number=1 fo:flow flow-name=xsl-region-body fo:blockBelow is the block that contains the character (00AD) (soft-hyphen) causes the crash/fo:block fo:block #x00AD;/fo:block /fo:flow /fo:page-sequence /fo:root The error message is: Oct 20, 2011 9:38:01 PM org.apache.fop.cli.Main startFOP SEVERE: Exception java.lang.IllegalArgumentException: factor 0; was: -1 at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:302) at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:130) at org.apache.fop.cli.Main.startFOP(Main.java:174) at org.apache.fop.cli.Main.main(Main.java:205) Caused by: java.lang.IllegalArgumentException: factor 0; was: -1 at org.apache.fop.traits.MinOptMax.mult(MinOptMax.java:251) at org.apache.fop.layoutmgr.inline.TextLayoutManager.processWord(TextLayoutManager.java:825) at org.apache.fop.layoutmgr.inline.TextLayoutManager.getNextKnuthElements(TextLayoutManager.java:710) at org.apache.fop.layoutmgr.inline.LineLayoutManager.collectInlineKnuthElements(LineLayoutManager.java:639) at org.apache.fop.layoutmgr.inline.LineLayoutManager.getNextKnuthElements(LineLayoutManager.java:579) at org.apache.fop.layoutmgr.BlockStackingLayoutManager.getNextChildElements(BlockStackingLayoutManager.java:571) at org.apache.fop.layoutmgr.BlockStackingLayoutManager.getNextChildElements(BlockStackingLayoutManager.java:552) at org.apache.fop.layoutmgr.BlockStackingLayoutManager.getNextKnuthElements(BlockStackingLayoutManager.java:280) at org.apache.fop.layoutmgr.BlockLayoutManager.getNextKnuthElements(BlockLayoutManager.java:123) at org.apache.fop.layoutmgr.BlockLayoutManager.getNextKnuthElements(BlockLayoutManager.java:115) at org.apache.fop.layoutmgr.FlowLayoutManager.getNextChildElements(FlowLayoutManager.java:199) at org.apache.fop.layoutmgr.FlowLayoutManager.addChildElements(FlowLayoutManager.java:140) at org.apache.fop.layoutmgr.FlowLayoutManager.addChildElements(FlowLayoutManager.java:129) at org.apache.fop.layoutmgr.FlowLayoutManager.getNextKnuthElements(FlowLayoutManager.java:70) at org.apache.fop.layoutmgr.PageBreaker.getNextKnuthElements(PageBreaker.java:216) at org.apache.fop.layoutmgr.AbstractBreaker.getNextBlockList(AbstractBreaker.java:692) at org.apache.fop.layoutmgr.PageBreaker.getNextBlockList(PageBreaker.java:149) at org.apache.fop.layoutmgr.PageBreaker.getNextBlockList(PageBreaker.java:132) at org.apache.fop.layoutmgr.AbstractBreaker.doLayout(AbstractBreaker.java:337) at org.apache.fop.layoutmgr.PageBreaker.doLayout(PageBreaker.java:85) at org.apache.fop.layoutmgr.PageSequenceLayoutManager.activateLayout(PageSequenceLayoutManager.java:107) at org.apache.fop.area.AreaTreeHandler.endPageSequence(AreaTreeHandler.java:238) at org.apache.fop.fo.pagination.PageSequence.endOfNode(PageSequence.java:120) at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.endElement(FOTreeBuilder.java:349) at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:177) at org.apache.xalan.transformer.TransformerIdentityImpl.endElement(TransformerIdentityImpl.java:1101) at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source) at org.apache.xerces.xinclude.XIncludeHandler.endElement(Unknown Source) at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source
Re: FOP crashes when encountering character 00AD (soft hyphen)
Hi Paul, The latest trunk relies on JUnit4, so you'll have to get that JAR not the JUnit3 one, the url (https://github.com/KentBeck/junit/downloads) should help. Mehdi On 21 October 2011 15:39, Paul Tremblay paulhtremb...@gmail.com wrote: On 10/21/11 6:04 AM, J.Pietschmann wrote: Am 21.10.2011 09:44, schrieb mehdi houshmand: however, FOP trunk doesn't produce this issue, Jeremias fixed this some time ago on trunk. J.Pietschmann Thanks. I downloaded the trunk. I followed the directions and set JAVA_HOME to /Library/Java/Home and ANT_HOME to usr/share/ant. I typed ant and got an error message that junit.jar had to be on the classpath of ant. So I copied junit from /usr/share/junit/junit.jar to /usr/share/ant/lib, and typed ant again. This time the build generated at lot of tests, and ended with this message: BUILD FAILED /Library/Java/trunk/build.xml:875: NOTE: ** * One or more of the Junit tests had Failures or Errors or were skipped! * * Please check the output above for relevant messages. * * Or use the junit-reports target to generate HTML test reports. * ** However, running a few tests: fop -fo file.fo -pdf out.pdf works fine, rendering correct PDF. Do I have an incomplete build? I can send along more detailed reports if I need to. Thanks again Paul - 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 crashes when encountering character 00AD (soft hyphen)
Hi Paul, Try running the JUnit task ant junit and share any errors. Mehdi On 21 October 2011 15:47, Paul Tremblay paulhtremb...@gmail.com wrote: Hi Mehdi, I already have JUnit4 (junit-4.10.jar). That's the jar I put in my /usr/share/ant/lib Paul On 10/21/11 10:44 AM, mehdi houshmand wrote: Hi Paul, The latest trunk relies on JUnit4, so you'll have to get that JAR not the JUnit3 one, the url (https://github.com/KentBeck/junit/downloads) should help. Mehdi On 21 October 2011 15:39, Paul Tremblaypaulhtremb...@gmail.com wrote: On 10/21/11 6:04 AM, J.Pietschmann wrote: Am 21.10.2011 09:44, schrieb mehdi houshmand: however, FOP trunk doesn't produce this issue, Jeremias fixed this some time ago on trunk. J.Pietschmann Thanks. I downloaded the trunk. I followed the directions and set JAVA_HOME to /Library/Java/Home and ANT_HOME to usr/share/ant. I typed ant and got an error message that junit.jar had to be on the classpath of ant. So I copied junit from /usr/share/junit/junit.jar to /usr/share/ant/lib, and typed ant again. This time the build generated at lot of tests, and ended with this message: BUILD FAILED /Library/Java/trunk/build.xml:875: NOTE: ** * One or more of the Junit tests had Failures or Errors or were skipped! * * Please check the output above for relevant messages. * * Or use the junit-reports target to generate HTML test reports. * ** However, running a few tests: fop -fofile.fo -pdf out.pdf works fine, rendering correct PDF. Do I have an incomplete build? I can send along more detailed reports if I need to. Thanks again Paul - 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: Where's the class?
Hi Eric, The renderers of old were removed quite a while ago in commit#989178. Hope that helps Mehdi On 19 October 2011 14:33, Eric Douglas edoug...@blockhouse.com wrote: I downloaded fop as the latest trunk snapshot and it says you took away a class? What happened to org.apache.fop.render.pdf.PDFRenderer? - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Where's the class?
Sorry Eric, I meant to say, this is a developer question, could you post questions concerning the code on fop-dev in future. Thanks Mehdi On 19 October 2011 14:47, mehdi houshmand med1...@gmail.com wrote: Hi Eric, The renderers of old were removed quite a while ago in commit#989178. Hope that helps Mehdi On 19 October 2011 14:33, Eric Douglas edoug...@blockhouse.com wrote: I downloaded fop as the latest trunk snapshot and it says you took away a class? What happened to org.apache.fop.render.pdf.PDFRenderer? - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Problem with fo:external-graphic element in processing output from either Saxon or Xalan
Hi Mike, I can't help you with the DocBook query as I've never used DocBook myself, however, it is important to understand that XSL-FO and XML in generally is strongly typed. As for your XML all on one line, there is a way to output a more readable format, I think you have to set indent=yes on the xsl:output object (http://www.w3schools.com/xsl/el_output.asp), but again, I don't use XSLT very often so I'm not 100% on this. Also, in future, if you have XSLT questions, could you ask them on the XLST mailing list (http://www.mulberrytech.com/xsl/xsl-list/), this mailing list is specifically for FOP questions. Hope that helps Mehdi On 7 October 2011 10:05, Mike Chambers m...@watchfront.co.uk wrote: Hi Mehdi, Ah OK thanks that makes sense, and now I understand the spec. that little bit better :) It would seem then that the block vs. inline concept is similar to that in HTML/CSS, but that in HTML you don't /have/ to explicitly wrap inline content with e.g. a block-level DIV, as you get something along the lines of an 'anonymous block box' (I think that is the terminology, and is what happens AIUI if you have e.g. bodyHello world/body, with no p / wrapping the text.). I manually added the wrapper fo:block object to the XSL-FO generated by Saxon and FOP processed it OK. OOI is it normal for an XSLT processor to output an XSL-FO (or indeed any other format) document that is a single (very long) line? It makes it harder to examine and then edit the structure of the document in a standard text editor. I'm puzzled as to why the processor output couldn't be multiline with suitable indentation. I know these are essentially machine processed files, but AIUI one of the points of XML is that a human can read it if they really want to. So now to find out why /both/ Saxon and Xalan generated XSL-FO output that omitted the same necessary wrapper object. Maybe because they were both using the same DocBook XSLT stylesheet(s) ? Would it be the case that the DocBook XSL stylesheet for generating FO output controls things such as when/where to put an fo:block? My logic limited understanding of XSLT suggests it would, and thus maybe there is a bug in the XSLT stylesheet I have obtained via a Ubuntu repository package. Many Thanks, Mike - 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: Problem with fo:external-graphic element in processing output from either Saxon or Xalan
Hi Mike, An external-graphic an %inline entity, and the only valid child of an fo:flow (http://www.w3.org/TR/xsl/#fo_flow) is a %block. So basically you need to wrap the external-graphic object in a fo:block object i.e.: Your XSL-FO code: ... fo:flow fo:external-graphic.../ Correct XSL-FO: ... fo:flow fo:block fo:exteral-graphic/fo:external-graphic /fo:block ... Hope that helps. Mehdi On 6 October 2011 14:30, Mike Chambers m...@watchfront.co.uk wrote: Hi, I am getting this runtime error: org.apache.fop.fo.ValidationException: file:/home/mike/source/docbook/sample_doc2_xalan.fo:1:66363: Error(1/66363): fo:external-graphic is not a valid child element of fo:flow. after I added imagedata fileref=Screenshot1.png/ to a very simple DocBook XML sourcefile I am new to DocBook, XSLT, XSL-FO etc. but looking at the XSL 1.0 specification at http://www.w3.org/TR/2001/REC-xsl-20011015/ i see fo:flow formatting object is a sequence of flow objects and The fo:external-graphic flow object is used for a graphic where the graphics data resides outside of the XML result tree in the fo namespace., implying fo:external-graphic /is/ a valid child element of fo:flow ? I am running FOP on a Ubuntu 10.04 Linux box, using the 'fop' package from the Ubuntu repositories. Maybe it is a Ubuntu package bug, so if anyone can point me at what I should look at to work out whether this is the case, or indeed suggest any other reason for this run-time error I would appreciate it. OOI, without the imagedata/ element in the DocBook source, FOP runs OK and generates a usable PDF. It looks like I have FOP v0.95, judging from the content of the /usr/share/java directory. Thanks, Mike - 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: Glyph ? (0x107, cacute) not in PDF
Hi Mark, What version of FOP are you using? In FOP 1.0+ the metrics XML files are deprecated. Mehdi On 6 October 2011 20:39, Mark Craig mark.cr...@gmail.com wrote: Hello, I've read http://xmlgraphics.apache.org/fop/faq.html#pdf-characters and http://xmlgraphics.apache.org/fop/1.0/fonts.html#missing-glyphs. They seem to suggest that if the font contains a glyph it ought to be picked up. I'm using the DejaVu fonts. A ć (c with acute accent, lower case) is missing in the PDF, following this warning during generation: Oct 6, 2011 8:23:59 PM org.apache.fop.events.LoggingEventListener processEvent WARNING: Glyph ? (0x107, cacute) not available in font DejaVuSansCondensed-Bold. The ć does show up in the UTF-8 encoded .fo. It comes out fine in the RTF, which is generated from an identical .fo. I do see ć in DejaVuSansCondensed-Bold in my font viewer. (The glyph appears in SansMono on their home page, http://dejavu-fonts.org/wiki/Main_Page.) The DejaVuSansCondensed-Bold-metrics.xml file seemed to be generated without incident: INFO: Reading /Users/mark/Documents/workspace/opendj3/src/fonts/DejaVuSansCondensed-Bold.ttf... Oct 6, 2011 8:22:57 PM org.apache.fop.fonts.apps.TTFReader loadTTF INFO: Font Family: [DejaVu Sans Condensed, DejaVu Sans] Oct 6, 2011 8:22:57 PM org.apache.fop.fonts.apps.TTFReader constructFontXML INFO: Creating xml font file... Oct 6, 2011 8:22:57 PM org.apache.fop.fonts.apps.AbstractFontReader writeFontXML INFO: Writing xml font file /Users/mark/Documents/workspace/opendj3/target/fonts/DejaVuSansCondensed-Bold-metrics.xml... Why is the ć missing from the PDF output? Thanks for your time and your help. Regards, Mark - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Can FOP work backwards?
On 14 September 2011 18:31, Eric Douglas edoug...@blockhouse.com wrote: I know the intention of FOP is to create PDF, but since FOP did create the PDF the code should be there to read the PDF. No, FOP doesn't parse PDF. I want to take a PDF (generated by FOP) and read it back in, to be able to print it, or to display it in a Swing component. I already have a Swing component, if FOP can tell me enough information about what it put in the PDF and where. Check out PDFBox, it has PDF displaying functionality. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: FOP font warning invalid
Hi Eric, This URL might help you better understand the error message: http://www.w3.org/TR/xsl/#font-weight Just out of curiousity, what FOP version are you using? There was a fix recently touching on that area of code which might solve your problem. Hope that helps Mehdi On 13 September 2011 16:40, Eric Douglas edoug...@blockhouse.com wrote: FOP spits out warning messages on the transform. Sep 13, 2011 11:32:54 AM org.apache.fop.events.LoggingEventListener processEvent WARNING: Font Lucida Sans Typewriter,normal,700 not found. Substituting with Lucida Sans Typewriter,normal,600. I never told it to use 700. My FO file just has font-weight=bold. Is there a simple fix for this or do I just have to save the font's actual weight where I'm loading in my custom fonts and replace the word bold? - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Problem with arial font access
Hi, That's one way to do it, but if you want to see which fonts are available to your JVM then you can use the following command: import java.awt.GraphicsEnvironment; ... // For font family names GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames() // For font details, from here you can get more information about the fonts GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts() Hope that helps Mehdi On 5 September 2011 22:04, J.Pietschmann j3322...@yahoo.de wrote: Am 05.09.2011 13:09, schrieb Theresa Jayne Forster: How do you determine the font-family name for a font loaded by autodetect? ... File names are not always the same Most Font file viewers (or file managers) can display the real font name. On Windows (Vista or later), go to the directory containing the fonts (usually C:\Windows\Fonts or such), and you'll see the real font names. Right click and select properties from the context menu, and you'll get the file name and other info. Double click, and the windows font viewer opens, again displaying the font name. There's similar functionality on Unix/Linux and Mac. If all else fails, grab a font editor for your plattform, open the font, and view the font properties, or meta data. J.Pietschmann - 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: Problem with arial font access
Hi Philippe, You can try and get that working, but there are several considerations you must take if you're wanting to use the auto-detect. feature, the most significant of which is that the name you set in font-family must match the system font name. IMO configuring the fonts explicitly minimizes problems in the long run, obviously there's an initial overhead. Hope that helps Mehdi On 5 September 2011 10:42, Philippe Juhel philippe.ju...@icam.fr wrote: Hi, I run the 1.0 FOP version on a XP windows system. If I don’t specify a configuration file (fop –fo test.xsl –pdf res.pdf), I get the following warnings : 5 sept. 2011 11:19:51 org.apache.fop.events.LoggingEventListener processEvent ATTENTION: Font arial,normal,400 not found. Substituting with any,normal,400. 5 sept. 2011 11:19:51 org.apache.fop.events.LoggingEventListener processEvent ATTENTION: Font arial,normal,700 not found. Substituting with any,normal,700. Now, I use the template for the configuration file and I add the following lines : font kerning=yes embed-url=file:///C:/windows/fonts/arial.ttf font-triplet name=arial style=normal weight=normal/ /font font kerning=yes embed-url=file:///C:/windows/fonts/arialbd.ttf font-triplet name=arial style=normal weight=bold/ /font And with fop –c fop.xconf –fo test.xsl –pdf res.pdf it works (no more warning about arial not found). But it’s not really practical, easy to use a configuration file and add ALL the fonts I want to use. Is it possible to just specify a folder with a lot of fonts (like C:\windows\fonts) and have all the fonts automatically available? I try : auto-detect/ Or directoryC:\windows\fonts/directory But it doesn’t work. Any idea? Regards, Philippe Juhel Assistant au pôle GEI (Génie Electronique et Informatique) ICAM 75, av de Grande Bretagne 31300 Toulouse Tél : 05-34-50-50-45 Mail : philippe.ju...@icam.fr - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Configure fonts for FOP
Hi Fernando, Yes, if you've got the fonts configured correctly, then FOP does embed a subset of the font within the PDF. If the fonts aren't configured properly, FOP outputs error messages indicating as such. Hope that helps Mehdi On 30 July 2011 01:00, Fernando Israel fernando.isr...@kognoz.com wrote: Hi Mehdi, I have followed your instructions and it works like a charm. Thank you ! I have taken the auto-detect out of the configuration and it picks the fonts from the directory specified so I guess it is doing what I expect which is only to include the fonts in the configured directory. Regarding the embedding of the fonts with the PDF, I've checked and the fonts are there with the target. Since I haven't told FOP anything about embedding the fonts, all it has is a directory with TTF files, I assume that the default behaviour is to embbed the fonts - it has the TTF files so it can do that I believe. Can you confirm this is the case ?. Thank you very much for your help !!! Regards, Fernando On Fri, Jul 29, 2011 at 7:59 AM, mehdi houshmand med1...@gmail.com wrote: Hi Fernando, If you open the example in conf/fop.xconf, you'll see an example has been created (but commented out) for Arial. That is where you need to declare the font. I personally don't use the auto-detect feature, so I won't be able to help you there. But I'd suggest that you create a definition in the config file for each font individually, like the example for arial, the embed-url property let's FOP know the URL of the font file. That way if a specific font doesn't work, you can easily analyse why. As for taking TTF files from a Windows box to a Linux box, that should work fine. I don't know if that's breaking any licensing issues or the legality, but TTFs are platform independent. You may however have issues if there are any spaces in the directory or file names. Hope that helps Mehdi On 28 July 2011 12:40, Fernando Israel fernando.isr...@kognoz.com wrote: Hi Mehdi, Thank you very much for your response. It is helping me a lot. I've seen the document on fonts you suggest but your input helps me to interpret it better. So what you suggest is that I just stick all the necessary font files TTF or TTC in a directory and direct FOP to use these fonts via the configuration file using the directory element to specify that directory. Good !. Since I am only using the PDF renderer I will have an entry in the config file for it only. I will stick there the directory element with the name of the directory where I put all the necessary fonts. 1. What should I do with the auto-detect element ?. I would like to force FOP to use only the fonts in the specified directory so shall I remove the auto-detect ? 2. Using this approach will the fonts be embbeded automatically in the target (a PDF) ? 3. For testing purposes, can I take the TTF files from a Windows OS and stick them on directory on a Linux box where the server (with FOP) runs ?. Will that work ?. Thanks again for your help ! Regards, Fernando On Thu, Jul 28, 2011 at 3:45 AM, mehdi houshmand med1...@gmail.com wrote: Hi Fernando, I'll address each question individually: On 27 July 2011 23:29, Fernando Israel fernando.isr...@kognoz.com wrote: Hi All, I know this is a recurring issue but going through the documentation and forum listings I am still no clear but I hope I know what to ask. /snip The questions I have (and pardon my ignorance but fonts is not my subject) are: 1. What type of font files do I have to package ? TTF, TTC .. ?. If you're producing PDF you can use either TTF or TTC. 2. Once I create the jar file if I put it in the same directory as fop.jar I guess FOP will find it, right ?. http://xmlgraphics.apache.org/fop/1.0/fonts.html should help you configure the fonts appropriately. The font metrics files are deprecated, so no need for that, but you will have to configure the fop.xconf to let FOP know the directory of the font file. 3. If I go this route, do I have to tell FOP anything else (for instance in the configuration file) ? See the link above. 4. Does FOP always looks first in the classpath for fonts ? No, if FOP isn't explicitly given the font configuration, it looks in the System fonts, which are, as the name suggests, OS dependent. I don't think putting the font in the classpath makes the slightest bit of difference, FOP still won't have a font-name and so no way to link the font to a font-family in the FO. Hope that helps, there is also an example config file in fop directory/conf/fop.xconf, which should help you get started Mehdi - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h
Re: Configure fonts for FOP
Hi Fernando, If you open the example in conf/fop.xconf, you'll see an example has been created (but commented out) for Arial. That is where you need to declare the font. I personally don't use the auto-detect feature, so I won't be able to help you there. But I'd suggest that you create a definition in the config file for each font individually, like the example for arial, the embed-url property let's FOP know the URL of the font file. That way if a specific font doesn't work, you can easily analyse why. As for taking TTF files from a Windows box to a Linux box, that should work fine. I don't know if that's breaking any licensing issues or the legality, but TTFs are platform independent. You may however have issues if there are any spaces in the directory or file names. Hope that helps Mehdi On 28 July 2011 12:40, Fernando Israel fernando.isr...@kognoz.com wrote: Hi Mehdi, Thank you very much for your response. It is helping me a lot. I've seen the document on fonts you suggest but your input helps me to interpret it better. So what you suggest is that I just stick all the necessary font files TTF or TTC in a directory and direct FOP to use these fonts via the configuration file using the directory element to specify that directory. Good !. Since I am only using the PDF renderer I will have an entry in the config file for it only. I will stick there the directory element with the name of the directory where I put all the necessary fonts. 1. What should I do with the auto-detect element ?. I would like to force FOP to use only the fonts in the specified directory so shall I remove the auto-detect ? 2. Using this approach will the fonts be embbeded automatically in the target (a PDF) ? 3. For testing purposes, can I take the TTF files from a Windows OS and stick them on directory on a Linux box where the server (with FOP) runs ?. Will that work ?. Thanks again for your help ! Regards, Fernando On Thu, Jul 28, 2011 at 3:45 AM, mehdi houshmand med1...@gmail.com wrote: Hi Fernando, I'll address each question individually: On 27 July 2011 23:29, Fernando Israel fernando.isr...@kognoz.com wrote: Hi All, I know this is a recurring issue but going through the documentation and forum listings I am still no clear but I hope I know what to ask. /snip The questions I have (and pardon my ignorance but fonts is not my subject) are: 1. What type of font files do I have to package ? TTF, TTC .. ?. If you're producing PDF you can use either TTF or TTC. 2. Once I create the jar file if I put it in the same directory as fop.jar I guess FOP will find it, right ?. http://xmlgraphics.apache.org/fop/1.0/fonts.html should help you configure the fonts appropriately. The font metrics files are deprecated, so no need for that, but you will have to configure the fop.xconf to let FOP know the directory of the font file. 3. If I go this route, do I have to tell FOP anything else (for instance in the configuration file) ? See the link above. 4. Does FOP always looks first in the classpath for fonts ? No, if FOP isn't explicitly given the font configuration, it looks in the System fonts, which are, as the name suggests, OS dependent. I don't think putting the font in the classpath makes the slightest bit of difference, FOP still won't have a font-name and so no way to link the font to a font-family in the FO. Hope that helps, there is also an example config file in fop directory/conf/fop.xconf, which should help you get started Mehdi - 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: Configure fonts for FOP
Hi Fernando, I'll address each question individually: On 27 July 2011 23:29, Fernando Israel fernando.isr...@kognoz.com wrote: Hi All, I know this is a recurring issue but going through the documentation and forum listings I am still no clear but I hope I know what to ask. /snip The questions I have (and pardon my ignorance but fonts is not my subject) are: 1. What type of font files do I have to package ? TTF, TTC .. ?. If you're producing PDF you can use either TTF or TTC. 2. Once I create the jar file if I put it in the same directory as fop.jar I guess FOP will find it, right ?. http://xmlgraphics.apache.org/fop/1.0/fonts.html should help you configure the fonts appropriately. The font metrics files are deprecated, so no need for that, but you will have to configure the fop.xconf to let FOP know the directory of the font file. 3. If I go this route, do I have to tell FOP anything else (for instance in the configuration file) ? See the link above. 4. Does FOP always looks first in the classpath for fonts ? No, if FOP isn't explicitly given the font configuration, it looks in the System fonts, which are, as the name suggests, OS dependent. I don't think putting the font in the classpath makes the slightest bit of difference, FOP still won't have a font-name and so no way to link the font to a font-family in the FO. Hope that helps, there is also an example config file in fop directory/conf/fop.xconf, which should help you get started Mehdi - 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
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
Re: fop not handling svn rotated text on linux
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 - To unsubscribe, e-mail: fop-users
Re: fop not handling svn rotated text on linux
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
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
Re: Central European characters in PDF with Base14 fonts
Hi Tomasz, I could be wrong here, since I haven't tested this myself, but I'm pretty sure that currently there's no way to do what you're wanting without embedding the font. The Base14Fonts only look like they support WinAnsi encoding (with the obvious exception of ZapfDingbats and Symbol). Hope that helps, Mehdi On 23 June 2011 13:45, Tomasz Judycki tjudy...@tv.com.pl wrote: Hi! People say that it's not possible to generate a PDF file with Central European characters using only Base14 fonts and that embedding true type fonts is necessary to achieve that. However I managed to do so, using another technology, several years ago. Look at the example http://old.nabble.com/file/p31910912/pdf_pl.pdf pdf_pl.pdf (it should looks like http://old.nabble.com/file/p31910912/pdf_pl.jpg pdf_pl.jpg ). This PDF file contains: 4 0 obj /Type /Encoding /BaseEncoding /WinAnsiEncoding /Differences [ 143 /Zacute 159 /zacute 140 /Sacute 156 /sacute 202 /Eogonek 234 /eogonek 198 /Cacute 230 /cacute 209 /Nacute 241 /nacute 211 /Oacute 243 /oacute 163 /Lslash 179 /lslash 165 /Aogonek 185 /aogonek 175 /Zdotaccent 191 /zdotaccent ] endobj The problem was described several times, e.g.: http://old.nabble.com/Using-Central-European-characters-td3739791.html https://issues.apache.org/bugzilla/show_bug.cgi?id=17828 It seems that FOP 1.0 implements Central European encoding, for example in src/codegen/fonts/encodings.xml there is definition of CE_ENCODING. The question is: how could I generate PDF from http://old.nabble.com/file/p31910912/pltext.fo pltext.fo (effect should looks like http://old.nabble.com/file/p31910912/pltext.jpg pltext.jpg ) using just Base14 fonts? I would like to avoid embedding true type fonts to simplify the solution and to keep PDF small. Embedded font means +300kb. Regards, Tomasz Judycki -- View this message in context: http://old.nabble.com/Central-European-characters-in-PDF-with-Base14-fonts-tp31910912p31910912.html Sent from the FOP - Users mailing list archive at Nabble.com. - 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: Central European characters in PDF with Base14 fonts
Hi Tomasz, Sorry, maybe I didn't communicate what I meant properly. I wasn't saying there's no way to do that in PDF, or that the PDF spec doesn't allow that. I only meant that in FOP the base 14 fonts are encoded using WinAnsi. This means that FOP doesn't do what you're asking for. It is possible to get FOP to support more encodings, but the feature would have to be implemented. Mehdi On 23 June 2011 18:36, Tomasz Judycki tjudy...@tv.com.pl wrote: Hi Mehdi, Have you looked at pdf_pl.pdf attached to my first post? This is proof that it's possible to do what I want. The size of this file is 12kb, definitely no embedded fonts but all Polish characters are properly printed. I guess you can't read Polish but compare PDF with JPG and if they look the same you can't say that there's no way to do that. I just don't know how to use the same method using FOP. Regards, Tomasz mehdi houshmand wrote: Hi Tomasz, I could be wrong here, since I haven't tested this myself, but I'm pretty sure that currently there's no way to do what you're wanting without embedding the font. The Base14Fonts only look like they support WinAnsi encoding (with the obvious exception of ZapfDingbats and Symbol). Hope that helps, Mehdi On 23 June 2011 13:45, Tomasz Judycki tjudy...@tv.com.pl wrote: Hi! People say that it's not possible to generate a PDF file with Central European characters using only Base14 fonts and that embedding true type fonts is necessary to achieve that. However I managed to do so, using another technology, several years ago. Look at the example http://old.nabble.com/file/p31910912/pdf_pl.pdf pdf_pl.pdf (it should looks like http://old.nabble.com/file/p31910912/pdf_pl.jpg pdf_pl.jpg ). This PDF file contains: 4 0 obj /Type /Encoding /BaseEncoding /WinAnsiEncoding /Differences [ 143 /Zacute 159 /zacute 140 /Sacute 156 /sacute 202 /Eogonek 234 /eogonek 198 /Cacute 230 /cacute 209 /Nacute 241 /nacute 211 /Oacute 243 /oacute 163 /Lslash 179 /lslash 165 /Aogonek 185 /aogonek 175 /Zdotaccent 191 /zdotaccent ] endobj The problem was described several times, e.g.: http://old.nabble.com/Using-Central-European-characters-td3739791.html https://issues.apache.org/bugzilla/show_bug.cgi?id=17828 It seems that FOP 1.0 implements Central European encoding, for example in src/codegen/fonts/encodings.xml there is definition of CE_ENCODING. The question is: how could I generate PDF from http://old.nabble.com/file/p31910912/pltext.fo pltext.fo (effect should looks like http://old.nabble.com/file/p31910912/pltext.jpg pltext.jpg ) using just Base14 fonts? I would like to avoid embedding true type fonts to simplify the solution and to keep PDF small. Embedded font means +300kb. Regards, Tomasz Judycki -- View this message in context: http://old.nabble.com/Central-European-characters-in-PDF-with-Base14-fonts-tp31910912p31910912.html Sent from the FOP - Users mailing list archive at Nabble.com. - 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 -- View this message in context: http://old.nabble.com/Central-European-characters-in-PDF-with-Base14-fonts-tp31910912p31911981.html Sent from the FOP - Users mailing list archive at Nabble.com. - 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: Complex Script Support
Hi Rajat, That error message means that FOP can't find the font you're referencing. You can either put the font into your systems font directory (which depends on which OS you're using), or you can check http://xmlgraphics.apache.org/fop/trunk/fonts.html which will describe how to manually configure fonts. Also, check the archives, there have been plenty of people struggling with this issue, you'll probably find answers to many of your questions there. Hope that helps Mehdi On 20 June 2011 06:53, Rajat Narain narain.ra...@gmail.com wrote: I have just downloaded the latest binary dt. 15.06.2011 and performed a small test for indic fonts, namely Bengali and find that there has been no change from the fop 1.0 stable build. I enclose a samle pdf to explain my finding. Indic fonts require combination of 2 or more characters to produce the complex character. In the stable build as well as this, this combination is not occurring and the characters are printed as individual entities. I am not sure if this additional information will be of any help, but as a flash developer I face a similar problem in flash whenever I try to embed the font. The problem in flash does not occur if I use the system device fonts. The TTF font I am testing with is called 'Shonar Bangla'. I tried to test if the font would show correctly without embedding by referencing the font in the configuration file as fonts referenced-fonts match font-family=Shonar Bangla/ /referenced-fonts /fonts However, this somehow is failing with a message Warning: Font Shonar Bangla, normal, 400 not found. Substituting with any,normal,400 and then it tries to find the glyphs using Times-Roman The text in the pdf should have looked like this. প্রথম পাতা| দিব্যি ঘুমাচ্ছিলাম আমি আর ইচ্ছামতী। Thank you, Kind Regards Rajat Narain India - 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: Error including a PDF inside another PDF
Hi Jose, The ERROR message is the key here, it's indicative of an absence of an image loader for PDFs. You need to have the FOP-pdf-images JAR to your class path, you can get the JAR from this link http://www.jeremias-maerki.ch/download/fop/pdf-images/ and to put it in your class path, the easiest way would be to drop the jar in your lib/ folder. Hope that helps Mehdi On 17 June 2011 04:16, JOSE L MARTINEZ-AVIAL jlm...@gmail.com wrote: Hi, I'm using FOP 0.95 to add an address cover to a PDF I receive. I'm doign this: fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format; xsl:call-template name=letter-layout-portrait/ xsl:call-template name=address/ fox:external-document content-type=pdf src=prueba.pdf/ /fo:root The document is composed, but the external file is not added, and I see the following lines in the log 2011-06-16 23:11:16,099 DEBUG org.apache.xmlgraphics.image.loader.impl.AbstractImageSessionContext - Creating new Source for prueba.pdf 2011-06-16 23:11:16,115 DEBUG org.apache.fop.image.loader.batik.PreloaderSVG - Error while trying to load stream as an SVG file: Content is not allowed in prolog. 2011-06-16 23:11:16,115 DEBUG org.apache.fop.image.loader.batik.PreloaderSVG - Error while trying to load stream as an SVG file: Content is not allowed in prolog. 2011-06-16 23:11:16,193 ERROR org.apache.fop.apps.FOUserAgent - Image not available. URI: prueba.pdf. Reason: org.apache.xmlgraphics.image.loader.ImageException: The file format is not supported. No ImagePreloader found for prueba.pdf (No context info available) The contentype is set to pdf, so I don't why FOP is trying to read it as a SVG. Any ideas? Thanks Jose - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Error including a PDF inside another PDF
Hi Theresa, To put it simply, no. As far as I'm aware and I've done some testing of this, FOP-pdf-images doesn't resize/rescale PDFs it only crops. Hope that helps Mehdi On 17 June 2011 11:06, Theresa Jayne Forster ther...@inbrand.co.uk wrote: On a slightly different note can you use the FOP-pdf-images.jar to extract thumbnails of PDFs? Kindest regards Theresa Forster Senior Software Developer -Original Message- From: mehdi houshmand [mailto:med1...@gmail.com] Sent: 17 June 2011 08:00 To: fop-users@xmlgraphics.apache.org Subject: Re: Error including a PDF inside another PDF Hi Jose, The ERROR message is the key here, it's indicative of an absence of an image loader for PDFs. You need to have the FOP-pdf-images JAR to your class path, you can get the JAR from this link http://www.jeremias-maerki.ch/download/fop/pdf-images/ and to put it in your class path, the easiest way would be to drop the jar in your lib/ folder. Hope that helps Mehdi - 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: Error including a PDF inside another PDF
Hi Theresa, Yes, it can place the font page of one document and place it in another, this may help you http://old.nabble.com/-ANN--PDF-image-plug-in-for-Apache-FOP-version-2.0-released-td30077148.html/. Hope that helps Mehdi On 17 June 2011 11:49, Theresa Jayne Forster ther...@inbrand.co.uk wrote: But can it be used to extract the front page as an image? We can rescale later... Kindest regards Theresa Forster Senior Software Developer -Original Message- From: mehdi houshmand [mailto:med1...@gmail.com] Sent: 17 June 2011 11:17 To: fop-users@xmlgraphics.apache.org Subject: Re: Error including a PDF inside another PDF Hi Theresa, To put it simply, no. As far as I'm aware and I've done some testing of this, FOP-pdf-images doesn't resize/rescale PDFs it only crops. Hope that helps Mehdi - 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
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 -if insert 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 Sargent rsarg...@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: Reading Fonts with XMLGraphics or FOP?
Sorry to be late on this, but what Glenn said is true for the most part. FOP does delegate SVG font handling to Batik, which does use AWT classes for processing fonts. The disparity here is something I am hoping we will address. Mehdi On 21 May 2011 21:28, Glenn Adams gl...@skynav.com wrote: FOP reads native fonts directly, but does not create java.awt.Font as a result; rather, it creates instances of org.apache.fop.fonts.Font, an instance of which internally holds a reference to an object implementing org.apache.fop.fonts.FontMetrics, the latter holding most of the information parsed from the native font file. On Fri, May 20, 2011 at 9:22 AM, Dieter die...@chartle.net wrote: Hi, Java AWT has the Font class and a couple of native ties to load fonts and generate a Font object. I wonder if XMLGraphics or FOP has its own infrastructure for reading Fonts (maybe without those native ties) that results in the same Font object. Cheers, Dieter - 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: Problem with kerning on a font
Hi Theresa, I don't know if you're aware of this, but font metrics files are deprecated as of FOP1.0. So the first question would be what FOP version are you using? Presumably the font you're using does have the correct kerning values? Have you checked that? Mehdi On 27 May 2011 15:24, Theresa Jayne Forster ther...@inbrand.co.uk wrote: I am having problems with fixing the kerning xml file generated with TTFReader, It has not got the right values for me or ti I need to therefore find the correct codes in the font.xml file. But the numbering doesn’t make sense? Ie what character is 3? Ie kerning kxp1=”3” Or is there another way to get the correct kerning file? Kindest regards Theresa Forster Senior Software Developer - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Tripping over something converting from IF to PS
Hi Martin, What version of FOP are you using? Try using FOP 1.0 and see if this problem persists. If you send the IF file responsible, it'd give us a little more information. Thanks Mehdi On 23 May 2011 03:18, Martin Edge martin.e...@intellimail.com.au wrote: Hi Guys, Currently getting this dump when I try to convert from IF to PS. Can you confirm it’s NOT FOP I should be looking in (based on the stack trace). C:\dev\workspace_java\FOPc:\dev\workspace_java\fop\fop.cmd -c c:\dev\workspace_ java\fop\conf\fop.xconf -ifin c:\dev\intellimail_testing\X 009\0-EditedIntermediateFile.if -ps c:\dev\intellimail_testing\\0-EditedIntermediateFile.ps 23/05/2011 12:15:01 PM org.apache.fop.apps.FopFactoryConfigurator configure INFO: Default page-height set to: 11in 23/05/2011 12:15:01 PM org.apache.fop.apps.FopFactoryConfigurator configure INFO: Default page-width set to: 8.26in 23/05/2011 12:15:02 PM org.apache.fop.cli.Main startFOP SEVERE: Exception java.lang.NullPointerException at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:303) at org.apache.fop.cli.IFInputHandler.renderTo(IFInputHandler.java:77) at org.apache.fop.cli.Main.startFOP(Main.java:177) at org.apache.fop.cli.Main.main(Main.java:208) Caused by: java.lang.NullPointerException at org.apache.xmlgraphics.ps.PSGenerator.establishColorFromColor(PSGener ator.java:687) at org.apache.xmlgraphics.ps.PSGenerator.convertColorToPS(PSGenerator.ja va:676) at org.apache.xmlgraphics.ps.PSGenerator.useColor(PSGenerator.java:644) at org.apache.fop.render.ps.PSPainter.drawText(PSPainter.java:350) at org.apache.fop.render.intermediate.IFParser$Handler$TextHandler.endEl ement(IFParser.java:582) at org.apache.fop.render.intermediate.IFParser$Handler.endElement(IFPars er.java:354) at org.apache.xalan.transformer.TransformerIdentityImpl.endElement(Trans formerIdentityImpl.java:1101) at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source ) at org.apache.xerces.xinclude.XIncludeHandler.endElement(Unknown Source) at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknow n Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContent Dispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Un known Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Sour ce) at org.apache.xalan.transformer.TransformerIdentityImpl.transform(Transf ormerIdentityImpl.java:484) at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:300) ... 3 more - java.lang.NullPointerException at org.apache.xmlgraphics.ps.PSGenerator.establishColorFromColor(PSGener ator.java:687) at org.apache.xmlgraphics.ps.PSGenerator.convertColorToPS(PSGenerator.ja va:676) at org.apache.xmlgraphics.ps.PSGenerator.useColor(PSGenerator.java:644) at org.apache.fop.render.ps.PSPainter.drawText(PSPainter.java:350) at org.apache.fop.render.intermediate.IFParser$Handler$TextHandler.endEl ement(IFParser.java:582) at org.apache.fop.render.intermediate.IFParser$Handler.endElement(IFPars er.java:354) at org.apache.xalan.transformer.TransformerIdentityImpl.endElement(Trans formerIdentityImpl.java:1101) at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source ) at org.apache.xerces.xinclude.XIncludeHandler.endElement(Unknown Source) at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknow n Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContent Dispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Un known Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Sour ce) at org.apache.xalan.transformer.TransformerIdentityImpl.transform(Transf ormerIdentityImpl.java:484) at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:300) at
Re: Tripping over something converting from IF to PS
Hi Martin, Two things, firstly, just a small point, try and keep posts in the public domain. It helps you, since more people will look at your problem with the full information available. If your IF file is a reasonable size, could you create a bugzilla entry (https://issues.apache.org/bugzilla/). An NPE is never really what you want to see... Mehdi On 23 May 2011 07:57, Martin Edge martin.e...@asmorphic.net.au wrote: Hi Mehdi, It's trunk, I'll give 1.0 a go Cheers Martin --- Martin Edge --- On 23/05/2011, at 4:54 PM, mehdi houshmand med1...@gmail.com wrote: Hi Martin, What version of FOP are you using? Try using FOP 1.0 and see if this problem persists. If you send the IF file responsible, it'd give us a little more information. Thanks Mehdi On 23 May 2011 03:18, Martin Edge martin.e...@intellimail.com.au wrote: Hi Guys, Currently getting this dump when I try to convert from IF to PS. Can you confirm it’s NOT FOP I should be looking in (based on the stack trace). C:\dev\workspace_java\FOPc:\dev\workspace_java\fop\fop.cmd -c c:\dev\workspace_ java\fop\conf\fop.xconf -ifin c:\dev\intellimail_testing\X 009\0-EditedIntermediateFile.if -ps c:\dev\intellimail_testing\\0-EditedIntermediateFile.ps 23/05/2011 12:15:01 PM org.apache.fop.apps.FopFactoryConfigurator configure INFO: Default page-height set to: 11in 23/05/2011 12:15:01 PM org.apache.fop.apps.FopFactoryConfigurator configure INFO: Default page-width set to: 8.26in 23/05/2011 12:15:02 PM org.apache.fop.cli.Main startFOP SEVERE: Exception java.lang.NullPointerException at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:303) at org.apache.fop.cli.IFInputHandler.renderTo(IFInputHandler.java:77) at org.apache.fop.cli.Main.startFOP(Main.java:177) at org.apache.fop.cli.Main.main(Main.java:208) Caused by: java.lang.NullPointerException at org.apache.xmlgraphics.ps.PSGenerator.establishColorFromColor(PSGener ator.java:687) at org.apache.xmlgraphics.ps.PSGenerator.convertColorToPS(PSGenerator.ja va:676) at org.apache.xmlgraphics.ps.PSGenerator.useColor(PSGenerator.java:644) at org.apache.fop.render.ps.PSPainter.drawText(PSPainter.java:350) at org.apache.fop.render.intermediate.IFParser$Handler$TextHandler.endEl ement(IFParser.java:582) at org.apache.fop.render.intermediate.IFParser$Handler.endElement(IFPars er.java:354) at org.apache.xalan.transformer.TransformerIdentityImpl.endElement(Trans formerIdentityImpl.java:1101) at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source ) at org.apache.xerces.xinclude.XIncludeHandler.endElement(Unknown Source) at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknow n Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContent Dispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Un known Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Sour ce) at org.apache.xalan.transformer.TransformerIdentityImpl.transform(Transf ormerIdentityImpl.java:484) at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:300) ... 3 more - java.lang.NullPointerException at org.apache.xmlgraphics.ps.PSGenerator.establishColorFromColor(PSGener ator.java:687) at org.apache.xmlgraphics.ps.PSGenerator.convertColorToPS(PSGenerator.ja va:676) at org.apache.xmlgraphics.ps.PSGenerator.useColor(PSGenerator.java:644) at org.apache.fop.render.ps.PSPainter.drawText(PSPainter.java:350) at org.apache.fop.render.intermediate.IFParser$Handler$TextHandler.endEl ement(IFParser.java:582) at org.apache.fop.render.intermediate.IFParser$Handler.endElement(IFPars er.java:354) at org.apache.xalan.transformer.TransformerIdentityImpl.endElement(Trans formerIdentityImpl.java:1101) at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source ) at org.apache.xerces.xinclude.XIncludeHandler.endElement(Unknown Source) at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknow n Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContent Dispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Un known Source
Re: How to get fonts loaded programatically?
Hi Theresa, What version of FOP are you using? That config file doesn't look like the FOP 1.0 fop.xconf. Mehdi On 10 May 2011 11:36, Theresa Jayne Forster ther...@inbrand.co.uk wrote: Sorry about that, ok moved to the right Thread. I first Tried with the original font metrics details from before. Its almost as if its not loading the fopconfig.xml. How can I see if it is or not? I followed the example on the site and its not seemingly to work. No matter how I try it doesn’t seem to be loading the config file. And not showing an error. The fopconfig.xml file can be seen here http://pastebin.com/W9pbrVT1 Theresa Hi Theresa, Firstly, can you try not to mix queries in threads, if people refer back to this thread, it makes it difficult to follow. Also, you already have a thread concerning this issue so anyone that wants to help you, doesn't have all the information. That said, I think it might be worth you configuring the fonts individually rather than depending on the automated method. What output format are you using? Do you want to reference fonts or embed them? Take a look at http://xmlgraphics.apache.org/fop/trunk/fonts.html#register, it explains how to reference fonts individually and it's not clear, please feel free to ask more questions. Mehdi 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 *From:* Theresa Jayne Forster [mailto:ther...@inbrand.co.uk] *Sent:* 10 May 2011 09:49 *To:* fop-users@xmlgraphics.apache.org *Subject:* RE: How to get fonts loaded programatically? I guess, I was also wanting to check I was implementing it in the right way? Or to make it use the fonts do I need to create an FOUserAgent rather than just a Fop instance from the factory? As there are not really any proper examples of embedding that explain the difference between making a Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF,out); Or FOUserAgent userAgent = fopFactory.newFOUserAgent(); Fop fop = fopFactory.newFop(MimeConstants.MIME_POSTSCRIPT, userAgent, out); What is the difference between the two and what are the benefits of using a user agent rather than just a fop? Theresa * * *From:* mehdi houshmand [mailto:med1...@gmail.com] *Sent:* 10 May 2011 09:40 *To:* fop-users@xmlgraphics.apache.org *Subject:* Re: How to get fonts loaded programatically? Hi Theresa, There're two ways you can find out what you're looking for, some information is on the FOP website http://xmlgraphics.apache.org/fop/trunk/fonts.html, but if that fails to answer your questions I'd suggest you look through the mailing list archives. There have been quite a few of questions regarding fonts fairly recently, so that'll probably help you find the answers you're looking for. Hope that helps Mehdi On 10 May 2011 09:29, Theresa Jayne Forster ther...@inbrand.co.uk wrote: I have been trying to get fonts to load programmatically using the latest FOP To instantiate the factory I do the following private static final FopFactory fopFactory = FopFactory.newInstance(); fopFactory.setUserConfig(new File(C:/myfiles/fopconfig.xml)); fopFactory.setTargetResolution(300); then I make the Fop and use it… The config file has 2 separate sections, 1. Fonts section as per the old system (I copied it from our old setup) 2. A renderer section for PDF telling it to use autodetect. But I am not seeing anything in the logs except the standard 14… and these errors. 2011-05-09 16:28:06,551 [http-8080-1] WARN org.apache.fop.apps.FOUserAgent - Font HelveticaNeue,normal,400 not found. Substituting with any,normal,400. 2011-05-09 16:28:06,822 [http-8080-1] WARN org.apache.fop.apps.FOUserAgent - Font AGaramond,normal,700 not found.. Substituting with any,normal,700. 2011-05-09 16:28:06,824 [http-8080-1] WARN org.apache.fop.apps.FOUserAgent - Font HelveticaNeue,normal,700 not found. Substituting with any,normal,700. Any advise would be helpful. Kindest regards Theresa Forster Senior Software Developer ther
Re: How to get fonts loaded programatically?
Hi Theresa, There're two ways you can find out what you're looking for, some information is on the FOP website http://xmlgraphics.apache.org/fop/trunk/fonts.html, but if that fails to answer your questions I'd suggest you look through the mailing list archives. There have been quite a few of questions regarding fonts fairly recently, so that'll probably help you find the answers you're looking for. Hope that helps Mehdi On 10 May 2011 09:29, Theresa Jayne Forster ther...@inbrand.co.uk wrote: I have been trying to get fonts to load programmatically using the latest FOP To instantiate the factory I do the following private static final FopFactory fopFactory = FopFactory.newInstance(); fopFactory.setUserConfig(new File(C:/myfiles/fopconfig.xml)); fopFactory.setTargetResolution(300); then I make the Fop and use it… The config file has 2 separate sections, 1. Fonts section as per the old system (I copied it from our old setup) 2. A renderer section for PDF telling it to use autodetect. But I am not seeing anything in the logs except the standard 14… and these errors. 2011-05-09 16:28:06,551 [http-8080-1] WARN org.apache.fop.apps.FOUserAgent - Font HelveticaNeue,normal,400 not found. Substituting with any,normal,400. 2011-05-09 16:28:06,822 [http-8080-1] WARN org.apache.fop.apps.FOUserAgent - Font AGaramond,normal,700 not found. Substituting with any,normal,700. 2011-05-09 16:28:06,824 [http-8080-1] WARN org.apache.fop.apps.FOUserAgent - Font HelveticaNeue,normal,700 not found. Substituting with any,normal,700. Any advise would be helpful. 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 image001.png
Re: Strange problem with no error being generated
Hi Theresa, Firstly, can you try not to mix queries in threads, if people refer back to this thread, it makes it difficult to follow. Also, you already have a thread concerning this issue so anyone that wants to help you, doesn't have all the information. That said, I think it might be worth you configuring the fonts individually rather than depending on the automated method. What output format are you using? Do you want to reference fonts or embed them? Take a look at http://xmlgraphics.apache.org/fop/trunk/fonts.html#register, it explains how to reference fonts individually and it's not clear, please feel free to ask more questions. Mehdi On 10 May 2011 10:44, Theresa Jayne Forster ther...@inbrand.co.uk wrote: As an update on the fonts I am getting the following 2011-05-10 10:40:51,698 [main] WARN org.apache.fop.apps.FOUserAgent - Font AkzidenzGroteskBEExt,normal,400 not found. Substituting with any,normal,400. 2011-05-10 10:40:51,735 [main] WARN org.apache.fop.apps.FOUserAgent - Font HelveticaNeueBlack,normal,400 not found. Substituting with any,normal,400. 2011-05-10 10:40:51,737 [main] WARN org.apache.fop.apps.FOUserAgent - Font Kozuka Gothic Pr6N,normal,400 not found. Substituting with any,normal,400. 2011-05-10 10:40:51,739 [main] WARN org.apache.fop.apps.FOUserAgent - Font Brush Script,normal,400 not found. Substituting with any,normal,400. 2011-05-10 10:40:51,740 [main] WARN org.apache.fop.apps.FOUserAgent - Font Webdings,normal,400 not found. Substituting with any,normal,400. When all the fonts are installed in my windows fonts folder and the fopconfig.xml I am using has the following setup fonts directory recursive=trueC:/Runtime/Fonts/directory auto-detect/ /fonts Can anyone suggest what is not working? 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 - 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: ToUnicode table in subset font not correct?
Hi Chris, No not quite. The patch attached to bugzilla 51144, works in trunk as it should and has no dependence on TrueTypeInPostScript. However, when I initially created the patch, I also made quite a few changes, code improvements etc, that do depend on changes made within the TrueTypeInPostScript branch. I had said that I'd fixed this in the patch in bugzilla 50483, (I have in my local branch) but I haven't attached the most recent patch to the bugzilla entry since it isn't complete. The reason I sent that last note, was to clear up my misunderstanding, since I'd posted misleading information. Hopefully that clears it up!? Mehdi On 3 May 2011 17:31, Chris Bowditch bowditch_ch...@hotmail.com wrote: On 03/05/2011 13:44, mehdi houshmand wrote: Hi Medhi, Just for future reference, the change hasn't been made in the patch to bug 50483. I made the change while implementing full CIDMap embedding as a feature for the TrueTypeInPostScript branch and have yet to finish implementation of this feature. Hopefully I will get the chance to finish it, but it's not high priority at the moment. I'm sorry but I don't understand what bugzilla 50483 has to do with this issue. 51144 was raised to address this and you've attached what appears to be a fairly small self contained patch there. Are you saying it depends on the truetypeInPostscript branch and bugzilla 50483? Thanks, Chris Just wanted to clear that up. On 3 May 2011 12:23, ruud grosmannr.grosm...@gmail.com wrote: On 03/05/2011, mehdi houshmandmed1...@gmail.com wrote: Hi Ruud, Yes this is a bug, which has been fixed in my patch, but since I... Hi Mehdi, I'm very glad to hear the problem is known. I have filed a bug report. https://issues.apache.org/bugzilla/show_bug.cgi?id=51144 I hope the description is not too brief. If I have to attach the files from my mails, or expand the description, let me know... thanks, Ruud - 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: ToUnicode table in subset font not correct?
Hi Ruud, Sorry for the confusion, I seem to have really miscommunicated on this one. The problem that wasn't high priority was the full CID-map embedding in PostScript, I have attached a patch for this bug to your bug entry. If you want the fix, apply the patch locally, or hopefully a committer will apply it to trunk. We've done a fair bit of testing on it and it seems to work fairly well. Mehdi On 4 May 2011 09:13, ruud grosmann r.grosm...@gmail.com wrote: On 03/05/2011, mehdi houshmand med1...@gmail.com wrote: Just for future reference, the change hasn't been made in the patch to bug 50483. I made the change while implementing full CIDMap embedding as a feature for the TrueTypeInPostScript branch and have yet to finish implementation of this feature. Hopefully I will get the chance to finish it, but it's not high priority at the moment. Hi Mehdi, you say it is not high priority, this bug. I only want to make clear this bug is visible to a lot of people. Earlier in this thread I have attached HAN8728A01.pdf. When you open this file, and copy and paste the text into for example wordpad, you will see that all spaces disappear (see attached screenshot). To this mail I have attached the same file, but which I have edited to replace the ToUnicode table that comes with the bold font (object 78). In that table, I have replaced the unicode to which character 2 is mapped with 0020 (space). If you copy and paste the bold text, the result is as expected. I suspect a lot of users have seen this cp behaviour. Your patch will be more than welcome. Moreover, when translating PDF to postscript, this table is fairly important too. For myself, I would be more than happy when this will be fixed. best regards, Ruud - 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: ToUnicode table in subset font not correct?
Hi Ruud, Yes this is a bug, which has been fixed in my patch, but since I didn't think anyone else had bumped into it I didn't want to put it into trunk since I also made some code improvements to the class and was weary that it could cause merge issues when/if the branches are merged. The issue is that in most fonts the first 3 glyphs are set to .notdef, and this was implemented in FOP. However, the spec says only the first glyph is reserved for .notdef, and what happens in MOST fonts doesn't happen in ALL fonts. If you create a bug report, I'll attach a patch and hopefully it'll be fixed fairly promptly. Hope that helps Mehdi On 2 May 2011 10:12, ruud grosmann r.grosm...@gmail.com wrote: On 02/05/2011, ruud grosmann r.grosm...@gmail.com wrote: It appears that in the ToUnicode table that goes with the fonts, the space character maps to unicode . maybe I should say that I mean the ToUnicode table that accompanies the subset font in the PDF that is generated by fop. I have attached the original PDF where the other attachments are extracted from. More specially, PDF objects 73 and 78. These contain the fontfile of (a subset from) the bold font that is used in the document and the ToUnicode table. best regards, Ruud - 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: ttf fonts for SVG in debian
Hi Vincent gave a fairly concise answer here, which may also help in finding out which fonts Java has registered: http://markmail.org/search/?q=Missing+Font+SVG+list%3Aorg.apache.xmlgraphics.fop-users#query:Missing%20Font%20SVG%20list%3Aorg.apache.xmlgraphics.fop-users+page:1+mid:obiwsaqa32ocd7qc+state:results Also, you don't need the metrics file, they're deprecated, and depending on which Linux flavour you've chosen, you can install Arial (mscorefonts in Ubuntu) from the standard repositories. Hope that helps Mehdi On 20 April 2011 13:18, Pascal Sancho pascal.san...@takoma.fr wrote: Hi, SVG uses sytem font (because rendered via AWT), while FOP uses explicitely specified fonts (in conf file) for PDF rendering. To ensure that text in SVG uses a specific font, this font must be declared both in system font system and in FOP conf file (with the same name, of course). Le 20/04/2011 13:19, Bogusław Fries a écrit : Hi all, I need some help for svg fonts configuration in debian. fo:block fo:instream-foreign-object svg:svg width=4.0mm height=28mm svg:text x=3 y=0 font-family=Arial” font-size=6px writing-mode=tb glyph-orientation-vertical=90deg l:textAdres doręczenia/xsl:text /svg:text /svg:svg /fo:instream-foreign-object /fo:block In the configuration file there is: font metrics-file=fonts95-v3/arial.xml kerning=yes embed-url=fonts95-v3/arial.ttf font-triplet name=Arial style=normal weight=normal/ /font There is the polish national character “ę”. On the PDF is Adres dor#czenia printed. Acrobat reader shows the Helvetica is embedded instead of Arial. I am using fop 1.0, batik-all-1.7, xmlgraphics-commons-1.4 I found only one solution but it is not acceptable for our system administrator: I put Arial.ttf file in /usr/share/fonts and run fc-chache When I am using fop 0.95 all is correct without any modification in the operating system. Thanks Regards *Bogusław Fries* Senior programmer DPD Poland -- Pascal - 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: Embedding font on Solaris
Hi Michal, Check the archives, there are plenty examples of people doing this, however, you'll need to set the font-base parameter in the fop.xconf. The website has some information on this (http://xmlgraphics.apache.org/fop/0.95/configuration.html), in your case it would be: font-basefile:///opt/szablony_wydrukow/fonts//font-base and have the embed-url=Office.ttf, this would tell FOP that the font file was in /opt/szablony_wydrukow/fonts/Office.ttf. I only explain this because there are others that have run into this problem so it might help to be more explicit. But that should fix your problem, also, just as a side point, metrics files are deprecated and so are no longer necessary. Hope that helps Mehdi 2011/4/15 Michał Bartnicki mbartni...@gmail.com: Hi, I'm trying to deploy my solution on Solaris server. It is a webservice which uses FOP to generate pdf, pcl from xml and xsltfo. The problem is that no matter what I do with config file FOP always uses Helvetica instead of defined font (i've got my company font, and tried calibri just for test). What I've did: - put fonts to /opt/szablony_wydrukow/fonts - genereted metrics for all fonts - tried smth like this in config: renderer mime=application/pdf filterList valueflate/value /filterList directory recursive=true/opt/szablony_wydrukow/fonts/directory /renderer - then tried this: renderer mime=application/pdf filterList valueflate/value /filterList fonts font metrics-url=Office.ttf.xml kerning=yes embed-url=Office.ttf font-triplet name=Office style=normal weight=normal/ /font font metrics-url=Office_Bold.ttf.xml kerning=yes embed-url=Office_Bold.ttf font-triplet name=Office style=normal weight=bold/ /font /fonts /renderer I've tried this on local winxp and it did fine. The font was embedded as it shoud. What I'm doing wrong? - 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 1.0: resolving relative Font URLs
Hi Ulrich, Sorry for the late reply, but /my/font/path isn't a reference to a relative path. That's an absolute path. If the absolute path of your font were /my/font/path/myfont.ttf, then your config is correct, and you are right in issuing a bug. But if your font is located at directory of fop.xconf/my/font/path/myfont.ttf, then you need to remove the prefixed /. I think this may be the issue here, I remember a commit about changing the relative directory to be relative to the fop.xconf rather than the fop.jar. Also, strictly speaking the proper format of a file URI in Unix based systems is file:/// not file:/, though IIRC FOP treats them both the same anyway. I may have completely got the wrong end of the stick here, if so, my apologies. Mehdi On 14 April 2011 08:39, Ulrich Mayring u...@denic.de wrote: Terence M. Bandoian wrote: Hi, Ulrich- That matches my experience with 1.0. Setting font-base works with metric-url but I've used absolute paths for embed-url. So then it appears to be a bug. I'll report it. Ulrich -- View this message in context: http://old.nabble.com/Fop-1.0%3A-resolving-relative-Font-URLs-tp31386824p31394545.html Sent from the FOP - Users mailing list archive at Nabble.com. - 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 1.0: resolving relative Font URLs
Hi Ulrich, Have you tried setting the font-base in your fop.xconf? I must admit I haven't used the API much but you can set the font-base by inserting following in the fop.xconf: font-base ** the base directory ** /font-base The configuration page on the fop website may help you, http://xmlgraphics.apache.org/fop/0.95/configuration.html, if you have more questions, if that doesn't help, don't hesitate to ask. Mehdi On 13 April 2011 12:12, u u...@denic.de wrote: Hi all, this is a new problem with fop 1.0, it does not occur in fop 0.95. In my application I am setting the base font directory programmatically like so: fopFactory.setFontBaseURL(/my/font/dir); And then I have entries like this in my fop.xconf: lt;font kerning=yes embed-url=myfont.ttf ... lt;/font This works perfectly in Fop 0.95 and earlier versions, but in Fop 1.0 it throws an exception: org.apache.fop.apps.FOPException: Failed to resolve font with embed-url 'myfont.ttf' at org.apache.fop.util.LogUtil.handleError(LogUtil.java:38) at org.apache.fop.fonts.FontInfoConfigurator.getFontInfo(FontInfoConfigurator.java:212) at org.apache.fop.fonts.FontInfoConfigurator.addFonts(FontInfoConfigurator.java:168) at org.apache.fop.fonts.FontInfoConfigurator.configure(FontInfoConfigurator.java:100) at org.apache.fop.render.PrintRendererConfigurator.buildFontList(PrintRendererConfigurator.java:106) The release notes do say that changes with respect to font substitution have taken place, but I believe an incompatibility like this should explicitly be mentioned. Any ideas for a workaround? Ulrich -- View this message in context: http://old.nabble.com/Fop-1.0%3A-resolving-relative-Font-URLs-tp31386824p31386824.html Sent from the FOP - Users mailing list archive at Nabble.com. - 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 1.0: resolving relative Font URLs
Hi Ulrich, Have you tried using file URIs for the font-base? This would be in the format file:///path/to/font (for unix), for windows based ones, google will help you, I don't use Windows regularly so I wouldn't want to speculate Mehdi On 13 April 2011 13:58, Ulrich Mayring u...@denic.de wrote: mehdi houshmand wrote: Hi Ulrich, Have you tried setting the font-base in your fop.xconf? I must admit I haven't used the API much but you can set the font-base by inserting following in the fop.xconf: font-base ** the base directory ** /font-base Hi Mehdi, we have set the font-base to a non-existing directory and overwrite that programmatically when the application starts. That being said, I just tried your suggestion and it didn't work either. Ulrich -- View this message in context: http://old.nabble.com/Fop-1.0%3A-resolving-relative-Font-URLs-tp31386824p31387759.html Sent from the FOP - Users mailing list archive at Nabble.com. - 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?
Hi Zac If you have further questions regarding how to reference fonts in the fop.xconf you may find the answers in the wiki (http://xmlgraphics.apache.org/fop/trunk/fonts.html), if that doesn't help, feel free to ask. mehdi On 23 March 2011 15:46, Rob Sargent rsarg...@xmission.com wrote: 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 - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Creating PDF file with HTML attributes in data
Hi Ashish, The intelligence for what you're trying to do should be in the XSLT that you're using. FOP can't read HTML, and it wouldn't make sense for it to do so, it already has it's own input format. Basically you need to transform the HTML into FO. Mehdi On 21 March 2011 17:52, Ashish Kulkarni ashish.kulkarn...@gmail.com wrote: Hello I have a designed a style sheet which i use to create PDF file using FOP, i would like to know if it is possible to create this PDF file and retain HTML attributes For example, If i have data stored as below This is data stored in database, and some is bbold/b When i create PDF file, bold is actually bold, but what i see is PDF file prints it as it is, does not bold the text bold -- Ashish www.ayurwellness.com www.mysoftwareneeds.com - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Fonts fail to print after successive print runs that work
Hi Peter, You say that it can happen anywhere from the 30th document to the 150th? Does that suppose each document is different, or does the number vary if you print the same document over and over? I.e. is the number at which it fails the same over several attempts when printing a single document? Mehdi On 15 March 2011 02:12, Peter Yandell peter.yand...@truenorth3dview.com wrote: Hi All, Background: I've recently inherited an enterprise level web application that uses FOP for generating PDF and PNG documents. These documents are printed using custom fonts. The output size is A0 (or ~ 4770 x 3370 pixels). Problem: After a variable amount of time some of the fonts 'stop working'. By this I mean that the glyph appearing is a letter 'A' in a box, with the same glyph used for all characters. Please see the two attached images; 'PrintJob-200a-47.png' rendered correctly while 'PrintJob-200a-48.png' stop working. The problem goes away after Tomcat has been restarted. Sometimes the error starts happening after 30 documents have been printed, other times it can be upwards of 150. Once it starts happening then it keeps happening until Tomcat is restarted. Resolutions Attempted: As I couldn't see any errors in our application logs I turned the FOP logging all the way up to 'ALL'. At no time were there any entries, for a 'failed' print job, that differed from a successful one. There are no WARN, ERROR or FATAL messages appearing in any log file. Searching for font issues seems to only turn up misconfigurations of fonts. All our fonts are configured correctly as the documents do print. It is simply that they are forgotten, lost, etc after some period of time with no errors or warnings recording in the logs Version numbers: JDK: 1.6.0_20 1.6.0_24 OS: Mac OSX 10.6.4 10.6.6 FOP: 0.95 1.0 Tomcat: 6.0.24 I can extract out the relevant FOP log entries for both a successful and failed run if requested. I haven't attached them as they are quite large. My request for help comes in several parts: 1. Has anyone else experienced this, and if so what did you do to resolve it? 2. Does anyone have any thoughts where else to look? I don't know where else to look right now. The web application is a commercial so I may be limited in what I can share. If anything else is required please ask and I will do my best to comply. Many thanks in advance, 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: PDF version specification
Hi Markus, Unfortunately looking at the code, the PDF version (1.4) is hard-coded. This is presumably because FOP doesn't support any of the features of subsequent versions, though I'm sure someone in the community will be able to tell you the exact reasons for this. You may be able to change this to 1.6, but either someone else in the community will be able to help you out there, or I'd suggest looking at the PDF spec, if PDF is backward compatible you can change the version with impunity. The PDF version is set in o.a.f.pdf.PDFDocument line 103. You'll probably have to do something to PDFProfile and add an extra case in PDFDocument.getPDFVersionString(). But that shouldn't be too difficult, that is of-course if there aren't any calamitous affects to do with the PDF spec, which I sadly lack knowledge in. Hope that helps, Mehdi On 14 March 2011 13:46, Markus Ruggiero mailingli...@kataputt.com wrote: When I generate a simple PDF from within my Java app the resulting PDF file says PDF Version 1.4. My customer talks about going to PDF version 1.6 or higher. Is this something I have to explicitly set? Where would I do this? My tests are based on FOP 1.0 and the simple embedding examples from the xmlgraphics website. Thanks for any enlightening ---markus--- - 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: Font Weight
Hi Guys, Sorry to jump onto this so late in the game, but if you're trying to using TTF fonts with PostScript there is a branch called Temp_TrueTypeInPostScript which may help you. It allows you to embed TTFs in the PostScript which will mean you won't have to have the font installed on your printer and you can reference the font-file from your fop.xconf. If you have any issues I'd be more than happy to help. Mehdi On 9 March 2011 21:24, Marquart, Joshua D joshua.marqu...@firstdata.com wrote: The process that we have to take user-generated input and end up with a G4 TIFF file. The current process is like this: 1 - We’ve got a front-end system that generates HTML from XSLT with a flag for input purposes (input form fields are generated), or output style. 2 - Generated html is passed through a transformer with html_to_fo.xsl applied to create XSL-FO data. 3a - Today, we take the resulting XSL-FO data and use FOP to generate a PostScript file, which is sent to a legacy third party library that transforms the PostScript into a beautiful near-identical G4 TIFF. For technical reasons, we have to stop using the third party library which is both EOL and creates issues (the library does not ignore a console shutdown signal and kills the service). 3b - Tomorrow, I’d like to just take the resulting XSL-FO data and generate the G4 TIFF files using FOP (hence my TIFF-focused Buzilla contributions 49695, 49696 and 50657) . At the moment, I’m just straight generating the TIFF from the XSL-FO data. It mostly looks like the source, but for some reason the lesser fonts are a lot lighter. It’s my understating that Fop is output-only when it comes to PostScript, correct? For comparison purposes, I’m generating the PostScript and Tiff files as flat files. Then I 1 - compare them side-by-side on the screen 2 - throw them both at a printer (and make sure the Tiff is sent through PhotoShop and not shrunk to fit). The printouts line up physically, but the font for any 10pt in the Tiff is much lighter (likely due to aliasing) than that produced with the PostScript, or even that produced by a Tiff that has undergone the process described in 3a above. With the “Oddly” comment quoted below, apparently the PostScript deferred to “any,normal,400” and “any,normal,700” when confronted with “Arial,normal,400”, which is not a big deal because my eventual goal is removing the PostScript. -Josh From: Eric Douglas [mailto:edoug...@blockhouse.com] Sent: Wednesday, March 09, 2011 2:18 PM To: fop-users@xmlgraphics.apache.org Subject: RE: Font Weight 1. If it's actually printing the wrong font that's a different issue. We'd have to see your font code for that. That would be everything in the font tags in the xconf file if you're using one, or your font loading method if you're using embedded code, plus the text in the fo which references the font triplet values. 2. What do you mean by lightness? Are you using the PSRenderer and/or TIFFRenderer to send output directly to a printer, to the same printer, back to back? Are you somehow using both renderers to generate image files to compare, or comparing something printed to something on the screen? Did you use the PSRenderer to send output directly to a printer and the TIFFRenderer to create an image file then send that image file to the printer? It sounds like we need more details on what you're trying to do. It sounds like you may be comparing apples to oranges. From: Marquart, Joshua D [mailto:joshua.marqu...@firstdata.com] Sent: Wednesday, March 09, 2011 2:07 PM To: Glenn Adams Cc: fop-users@xmlgraphics.apache.org Subject: RE: Font Weight I was just doing research on this topic, came back here to supplement my message with info, and saw you already beat me to it. Helpful method: getFontInfo().dumpAllTripletsToSystemOut() So… yes, I do not have fonts installed for font weights of 300, 500, etc. and that would account for resolving to 400/700. The problem I’m seeing is when generating a PostScript and a Tiff from the same xsl-fo file. The text generated in the Tiff (for the 400 weight) appears much lighter than identical text in the PostScript and is likely due to using the Java2DRenderer vs. the PsRenderer. Oddly, when I set the font to Arial in the xsl-fo: - the font in the resulting PostScript appears Times Roman - the font in the resulting Tiff is identical to the font used in the Tiff when Helvetica was specified. Other than hunting down, installing and registering a weight 500 or so font for Helvetica or Arial (where might I find one? No idea.), are there other options that might I employ to lessen the lightness of the 400-weight ? Thanks, -Josh From: Glenn Adams [mailto:gl...@skynav.com] Sent: Wednesday, March 09, 2011 12:02 PM To: Marquart, Joshua D Cc: fop-users@xmlgraphics.apache.org
Re: Font Weight
My apologies for the confusion, I saw that you were suggesting as such in your last email but thought you might not have known about that branch. I'm not that familiar with the Java2D rendering, sorry I couldn't be of more help. Mehdi On 10 March 2011 15:17, Marquart, Joshua D joshua.marqu...@firstdata.com wrote: Thanks Medhi, but as I've explained we're trying to move away from producing PostScript files and instead produce TIFF files. Our old practice: produce a PostScript via FOP and use a third-party software to convert to TIFF. Our future practice: just produce the TIFF via FOP. My goal is to get the font to render a bit darker in the TIFF than it is being produced at this time in order to come closer to the quality of the image produced by PostScript then converting to TIFF. -Josh -Original Message- From: mehdi houshmand [mailto:med1...@gmail.com] Sent: Thursday, March 10, 2011 3:10 AM To: fop-users@xmlgraphics.apache.org Subject: Re: Font Weight Hi Guys, Sorry to jump onto this so late in the game, but if you're trying to using TTF fonts with PostScript there is a branch called Temp_TrueTypeInPostScript which may help you. It allows you to embed TTFs in the PostScript which will mean you won't have to have the font installed on your printer and you can reference the font-file from your fop.xconf. If you have any issues I'd be more than happy to help. Mehdi On 9 March 2011 21:24, Marquart, Joshua D joshua.marqu...@firstdata.com wrote: The process that we have to take user-generated input and end up with a G4 TIFF file. The current process is like this: 1 - We've got a front-end system that generates HTML from XSLT with a flag for input purposes (input form fields are generated), or output style. 2 - Generated html is passed through a transformer with html_to_fo.xsl applied to create XSL-FO data. 3a - Today, we take the resulting XSL-FO data and use FOP to generate a PostScript file, which is sent to a legacy third party library that transforms the PostScript into a beautiful near-identical G4 TIFF. For technical reasons, we have to stop using the third party library which is both EOL and creates issues (the library does not ignore a console shutdown signal and kills the service). 3b - Tomorrow, I'd like to just take the resulting XSL-FO data and generate the G4 TIFF files using FOP (hence my TIFF-focused Buzilla contributions 49695, 49696 and 50657) . At the moment, I'm just straight generating the TIFF from the XSL-FO data. It mostly looks like the source, but for some reason the lesser fonts are a lot lighter. It's my understating that Fop is output-only when it comes to PostScript, correct? For comparison purposes, I'm generating the PostScript and Tiff files as flat files. Then I 1 - compare them side-by-side on the screen 2 - throw them both at a printer (and make sure the Tiff is sent through PhotoShop and not shrunk to fit). The printouts line up physically, but the font for any 10pt in the Tiff is much lighter (likely due to aliasing) than that produced with the PostScript, or even that produced by a Tiff that has undergone the process described in 3a above. With the Oddly comment quoted below, apparently the PostScript deferred to any,normal,400 and any,normal,700 when confronted with Arial,normal,400, which is not a big deal because my eventual goal is removing the PostScript. -Josh From: Eric Douglas [mailto:edoug...@blockhouse.com] Sent: Wednesday, March 09, 2011 2:18 PM To: fop-users@xmlgraphics.apache.org Subject: RE: Font Weight 1. If it's actually printing the wrong font that's a different issue. We'd have to see your font code for that. That would be everything in the font tags in the xconf file if you're using one, or your font loading method if you're using embedded code, plus the text in the fo which references the font triplet values. 2. What do you mean by lightness? Are you using the PSRenderer and/or TIFFRenderer to send output directly to a printer, to the same printer, back to back? Are you somehow using both renderers to generate image files to compare, or comparing something printed to something on the screen? Did you use the PSRenderer to send output directly to a printer and the TIFFRenderer to create an image file then send that image file to the printer? It sounds like we need more details on what you're trying to do. It sounds like you may be comparing apples to oranges. From: Marquart, Joshua D [mailto:joshua.marqu...@firstdata.com] Sent: Wednesday, March 09, 2011 2:07 PM To: Glenn Adams Cc: fop-users@xmlgraphics.apache.org Subject: RE: Font Weight I was just doing research on this topic, came back here to supplement my message with info, and saw you already beat me to it. Helpful method: getFontInfo().dumpAllTripletsToSystemOut() So... yes, I do not have fonts
Re: manipulate fop configuration file via java
Hi, Correct me if I'm wrong but I think you're trying to serialize the data that you configure progammatically. If so, but I don't think that feature currently exists in FOP (or if it does, I haven't come across it). If you wish to set and save config settings, you could use the various XML DOM libraries out there to create a custom fop.xconf. That will allow you to serialize any changes you make and you can make changes at run-time. There maybe another way of doing this, but short of creating your own serialization format (which in fairness wouldn't be very difficult), that's the only way I can think of. I may however have the wrong end of the stick here, if so, my apologies. Mehdi On 10 March 2011 15:34, Eric Douglas edoug...@blockhouse.com wrote: What are you trying to save? What you're talking about here is an either or. You can load font information using the configuration file or you can load them straight from the ttf with embedded code. If you're using the embedded code you don't need the configuration file for fonts. You also don't need a metrics file anymore. From: ingo peter [mailto:ingo.pe...@ip-software.de] Sent: Thursday, March 10, 2011 8:13 AM To: fop-users@xmlgraphics.apache.org Subject: manipulate fop configuration file via java hi, i can embed fonts via command-line to the file fop.xml and render a pdf with special fonts. fop.xml fop version=1.0 renderers renderer mime=application/pdf filterList valuenull/value /filterList filterList type=image valueflate/value valueascii-85/value /filterList font-base/tmp//font-base fonts font metrics-url=testfont.xml kerning=yes embed-url=testfont.ttf font-triplet name=testfont style=normal weight=normal/ /font /fonts /renderer /renderers target-resolution300/target-resolution /fop is it also via java possible to safe the font-information to fop.xml for later use? i tried this, but i don't know to save my changes back to a xml-file! ... String fontname = test1; String filename = test1.ttf;i // set own configuation file: try { FontTriplet fontTriplet = new FontTriplet(fontname,Font.STYLE_NORMAL, Font.WEIGHT_NORMAL); ListFontTriplet fontTriplets = new ArrayListFontTriplet(); fontTriplets.add(fontTriplet); EmbedFontInfo nfont = new EmbedFontInfo(filename.substring(0,datei.length()-3)+xml, true, fontTriplets, filename, fontname); DefaultConfigurationBuilder cfgBuilder = new DefaultConfigurationBuilder(); Configuration cfg = cfgBuilder.buildFromFile(new File(/tmp/fop.xml)); FopFactory fopFactory = FopFactory.newInstance(); fopFactory.setUserConfig(cfg); fopFactory.getFontManager().setFontBaseURL/tmp/); fopFactory.getFontManager().getFontCache().addFont(nfont); fopFactory.getFontManager().getFontCache().save(); } catch (Exception ex) { ex.printStackTrace(); } } } ... how can i save my configuration? - 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
Superb, I was just about to delve into this but I'm glad you got to the bottom of it. Mehdi On 2 March 2011 03:19, Graeme Kidd coolki...@hotmail.com wrote: I had some spare time today so I thought I would offer a helping hand and look into it as well. It looks like you weren't far off as the AMFParser class was throwing away the character based on the fact it could not find the Unicode sequence. When reading a line from the AFM file it creates an instance of the NamedCharacter class by using the Simple constructor. This constructor only takes the character name and uses it to also create the Unicode Sequence (See line 48 in NamedCharacter class). Since the character name for the character was a custom one i.e Zbb it failed to create the Unicode sequence. To get round this issue I ensured the Force glyphs names to was set to Adobe Glyph List when I exported the font. This meant Zbb was converted to uni2124 which allowed it to be correctly picked up - problem solved. I have attached the newly exported fonts file in case you want to test it at your end. Thanks again for your help, I don't think I would have gotten this far without you. Graeme Date: Tue, 1 Mar 2011 10:19:59 + Subject: Re: FreeSerif Font not working From: med1...@gmail.com To: fop-users@xmlgraphics.apache.org Hi, Ok the issue isn't with xmlgraphics commons, that was a red herring. I chased this down the rabbit hole to find the issue is in AFMParser.java. The characters that are missing aren't being mapped to the correct unicode index i.e. ℤ -- 0x2124. Which is wierd, because everything else about the glyph is being parsed correctly. That's as far as I've gotten today, at this stage, I'll have to look at the spec to see how glyphs map to unicode indices, then find out if FOP is behaving properly for this glyph. At this point we don't know whether it's a FOP bug or a font bug. I'll take another look at it tomorrow. Mehdi - 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