Re: Relative URL for embedding graphics in FOP
What you're using is not a relative URL! It's actually an absolute filename which FOP internally converts to an absolute file URL. The leading slash makes it an absolute filename/URL. A relative URL is this, for example: fo:external-graphic src=images/myimage.png/ Any relative URI/URL for images is then resolved against the base URI/URL specified in the configuration. See base in: http://xmlgraphics.apache.org/fop/stable/configuration.html#general-elements Or FOUserAgent.setBaseURL(String): http://xmlgraphics.apache.org/fop/stable/embedding.html#user-agent On 26.03.2008 03:35:16 meghnas wrote: HI All, I have been generating a PDF file using FOP, I want to put a gif onto the PDF. I can do this but only when the .gif file is on the C:/ drive of the machine. I want to use relative path, so that it works for all users. When I put the logo.gif in my c:/ drive and have the code as below it works: fo:table-row fo:table-cell number-columns-spanned=5 fo:block text-align=left fo:external-graphic content-width=2.08in content-height=0.72in src='url(/logo.gif)' / /fo:block /fo:table-cell /fo:table-row I am looking for the syntax to use for src='url(/logo.gif)' Notice the single outer quotes and the double inner quotes - it only works this way for me. My xsl:stylesheet version=1.0 and also xml version is 1.0. The .gif file is actually in my Eclipse project workspace under WebContent, I am just not sure how I can refer to it using relative path. I have tried various different syntax combinations, but have been unsuccessful. Would really appreciate it, if someone could give me an example of using relative path, particularly specifying where they put the actual .gif file. I am interested specifically in where the .xsl file is located and where the .gif is located, and the syntax of the src property. Any help, will be much much appreciated! Thanks. -- View this message in context: http://www.nabble.com/Relative-URL-for-embedding-graphics-in-FOP-tp16294358p16294358.html Sent from the FOP - Users mailing list archive at Nabble.com. Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Metrics Format
Yes. FOP 0.95beta which should be available for download by now supports AFM files. Since FOP 0.94 it isn't necessary anymore in most cases to produce the XML font metrics files. See the updated page on font configuration for details: http://xmlgraphics.apache.org/fop/0.95/fonts.html On 26.03.2008 06:35:22 xsltuser wrote: Can FOP be configured to take a different metrics format e.g. Adobe AFM? -- View this message in context: http://www.nabble.com/Metrics-Format-tp16295993p16295993.html Sent from the FOP - Users mailing list archive at Nabble.com. Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Metrics Format
There is a note at the link http://xmlgraphics.apache.org/fop/0.95/fonts.html saying 'The PFMReader tool does not yet interpret PFB or AFM files, so if you want to be correct, you may have to adjust the values in the XML file manually.' Can you please give some more insight into this? There are only two readers available in fop.jar namely PFMReader and TTFReader respectively for pfm and ttf font files. Can PFMReader be used for AFM files as well? Please clarify. Jeremias Maerki-2 wrote: Yes. FOP 0.95beta which should be available for download by now supports AFM files. Since FOP 0.94 it isn't necessary anymore in most cases to produce the XML font metrics files. See the updated page on font configuration for details: http://xmlgraphics.apache.org/fop/0.95/fonts.html On 26.03.2008 06:35:22 xsltuser wrote: Can FOP be configured to take a different metrics format e.g. Adobe AFM? -- View this message in context: http://www.nabble.com/Metrics-Format-tp16295993p16295993.html Sent from the FOP - Users mailing list archive at Nabble.com. Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Metrics-Format-tp16295993p16297919.html Sent from the FOP - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Metrics Format
Forget PFMReader! It's not needed anymore in most cases and is just kept for backwards compatibilities and emergencies. You also won't need an AFMReader. Since FOP 0.94 the XML font metrics files are not needed anymore in 99% of the cases. Just ignore everything on the fonts page below the section header Advanced font configuration. On 26.03.2008 10:23:00 xsltuser wrote: There is a note at the link http://xmlgraphics.apache.org/fop/0.95/fonts.html saying 'The PFMReader tool does not yet interpret PFB or AFM files, so if you want to be correct, you may have to adjust the values in the XML file manually.' Can you please give some more insight into this? There are only two readers available in fop.jar namely PFMReader and TTFReader respectively for pfm and ttf font files. Can PFMReader be used for AFM files as well? Please clarify. Jeremias Maerki-2 wrote: Yes. FOP 0.95beta which should be available for download by now supports AFM files. Since FOP 0.94 it isn't necessary anymore in most cases to produce the XML font metrics files. See the updated page on font configuration for details: http://xmlgraphics.apache.org/fop/0.95/fonts.html On 26.03.2008 06:35:22 xsltuser wrote: Can FOP be configured to take a different metrics format e.g. Adobe AFM? -- View this message in context: http://www.nabble.com/Metrics-Format-tp16295993p16295993.html Sent from the FOP - Users mailing list archive at Nabble.com. Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Metrics-Format-tp16295993p16297919.html Sent from the FOP - Users mailing list archive at Nabble.com. Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: FOP 0.94 bin - RTF Conversion on Solaris Box
Hello Matt, Thank you so much for your support! I am successfully able to convert XML into PDF files. I have cross checked several times and on each occasion I got the correct input. Now, I have to convert the XML into RTF by creating FO file. All( FO and RTF) files are getting created without an issue using fop.sh but when I open the newly created RTF file, the content of the pages are getting compressed. I can only see the heading in that document. Please advice. For your convenience, I have enclosed the created file with this reply. Once again, thank you all for your valuable time and support. With Thanks! Newkid http://www.nabble.com/file/p16297931/abc.rtf abc.rtf Matt Healy wrote: On Thu, 20 Mar 2008, J.Pietschmann wrote: Matt Healy wrote: I went back and checked the script, and found that IFS is being set just to the newline character, and does not include spaces. This is intentional: it avoids splitting directorie names which contain spaces, which is rather common now especially on Windows. How about this as an alternative, then: simply move the assignment to (and export of) IFS to a point immediately *after* the evaluation of the command-line arguments. In this way, the loop will appropriately differentiate between the arguments, rather than failing to break the evaluation of '$@' on the spaces between quoted values. In other words, rewrite: export IFS= for arg in $@ ; do . . . . done as: for arg in $@ ; do . . . . done export IFS= The content within the for loop appears to be space-friendly, since it's using escaped double-quotes to build up the content of the fop_exec_args variable from the values of $arg, and no other potential file names are being used in the loop. I think this should maintain the space-friendly nature of all of the subsquent code, while letting the for loop parse the data in a way that is compliant with Bourne shell under Solaris (and possibly other platforms) where the current code does not. (Hopefully I haven't missed anything ;-) -mjh -- Matthew J. Healy Computer Science Information Technology Departments Golisano College of Computing and Information Sciences, RIT mailto:[EMAIL PROTECTED] http://www.cs.rit.edu/~mjh Voice: (585) 248-3425 J.Pietschmann - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/FOP-0.94-bin---Severe-Exceptions-on-Solaris-Box-tp16175972p16297931.html Sent from the FOP - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: FOP 0.94 bin - RTF Conversion on Solaris Box
I assume you're talking about the table columns being too narrow. Without knowing how you specified them XSL-FO I'd guess that you need to specify the column-widths using explicit lengths instead of the proportional-columns-widths() function. This function is currently not supported for RTF output. Please see also the notes here: http://xmlgraphics.apache.org/fop/stable/output.html#rtf On 26.03.2008 10:32:08 Newkid wrote: Hello Matt, Thank you so much for your support! I am successfully able to convert XML into PDF files. I have cross checked several times and on each occasion I got the correct input. Now, I have to convert the XML into RTF by creating FO file. All( FO and RTF) files are getting created without an issue using fop.sh but when I open the newly created RTF file, the content of the pages are getting compressed. I can only see the heading in that document. Please advice. For your convenience, I have enclosed the created file with this reply. Once again, thank you all for your valuable time and support. With Thanks! Newkid http://www.nabble.com/file/p16297931/abc.rtf abc.rtf snip/ Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: FOP 0.94 bin - RTF Conversion on Solaris Box
Hello Jeremias, Thank you for the prompt response! You are correct on your stand about the column width. Without knowing how you specified them XSL-FO I'd guess that you need to specify the column-widths using explicit lengths instead of the proportional-columns-widths() function. I have created the .fo file and passing the .fo file to fop to create an RTF file. Please advice what to do to get rid of this issue. Are you saying that I have to manually modified the .fo file and specify the column widths instead of proportional-columns-widths. Please correct me if am wrong! With Thanks! Newkid Jeremias Maerki-2 wrote: I assume you're talking about the table columns being too narrow. Without knowing how you specified them XSL-FO I'd guess that you need to specify the column-widths using explicit lengths instead of the proportional-columns-widths() function. This function is currently not supported for RTF output. Please see also the notes here: http://xmlgraphics.apache.org/fop/stable/output.html#rtf On 26.03.2008 10:32:08 Newkid wrote: Hello Matt, Thank you so much for your support! I am successfully able to convert XML into PDF files. I have cross checked several times and on each occasion I got the correct input. Now, I have to convert the XML into RTF by creating FO file. All( FO and RTF) files are getting created without an issue using fop.sh but when I open the newly created RTF file, the content of the pages are getting compressed. I can only see the heading in that document. Please advice. For your convenience, I have enclosed the created file with this reply. Once again, thank you all for your valuable time and support. With Thanks! Newkid http://www.nabble.com/file/p16297931/abc.rtf abc.rtf snip/ Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/FOP-0.94-bin---Severe-Exceptions-on-Solaris-Box-tp16175972p16299634.html Sent from the FOP - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: FOP 0.94 bin - RTF Conversion on Solaris Box
On 26.03.2008 11:27:47 Newkid wrote: Hello Jeremias, Thank you for the prompt response! You are correct on your stand about the column width. Without knowing how you specified them XSL-FO I'd guess that you need to specify the column-widths using explicit lengths instead of the proportional-columns-widths() function. I have created the .fo file and passing the .fo file to fop to create an RTF file. Please advice what to do to get rid of this issue. Are you saying that I have to manually modified the .fo file and specify the column widths instead of proportional-columns-widths. Yes and no. Yes, you have to use column-width=2cm instead of column-width=proportional-column-width(1), for examples. And no, you don't manually modify your .fo file, you should change your XSLT stylesheet to use absolute lengths (cm, inches...). Please correct me if am wrong! With Thanks! Newkid Jeremias Maerki-2 wrote: I assume you're talking about the table columns being too narrow. Without knowing how you specified them XSL-FO I'd guess that you need to specify the column-widths using explicit lengths instead of the proportional-columns-widths() function. This function is currently not supported for RTF output. Please see also the notes here: http://xmlgraphics.apache.org/fop/stable/output.html#rtf On 26.03.2008 10:32:08 Newkid wrote: Hello Matt, Thank you so much for your support! I am successfully able to convert XML into PDF files. I have cross checked several times and on each occasion I got the correct input. Now, I have to convert the XML into RTF by creating FO file. All( FO and RTF) files are getting created without an issue using fop.sh but when I open the newly created RTF file, the content of the pages are getting compressed. I can only see the heading in that document. Please advice. For your convenience, I have enclosed the created file with this reply. Once again, thank you all for your valuable time and support. With Thanks! Newkid http://www.nabble.com/file/p16297931/abc.rtf abc.rtf snip/ Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/FOP-0.94-bin---Severe-Exceptions-on-Solaris-Box-tp16175972p16299634.html Sent from the FOP - Users mailing list archive at Nabble.com. Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Metrics Format
0.94 still has a few issues with detecting the right font names. FOP 0.95beta should behave correctly. On 26.03.2008 11:35:14 xsltuser wrote: Thanks for the info. I've now configured my FOP configuration file as fonts !-- automatically detect operating system installed fonts -- auto-detect/ /fonts In my xsl, I'm setting font-family='LeHei Pro' where 'LeHei Pro' is the System Font in Chinese collection. When I run this through FOP processor (0.94), resulting PDF file contains sequences of # where I'm expecting chinese characters. Is this because FOP is not able to locate this font? Any help in this regard is appreciated. snip/ Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: FOP 0.94 bin - Severe Exceptions on Solaris Box
Hi, Sorry to wake up a bit late, but I’d like to bring some precisions. First, there’s no particular differences between the .tar.gz and the .zip distribution files. In both, the fop shell script is in unix format (lines ending with LF), while the fop.bat, fop.cmd and fop.js script files are in dos format (lines ending with CRLF). No need to convert them with dos2unix, no need to privilege one distribution file over the other one. The reason of providing both .tar.gz and .zip files is that Windows users will naturally choose the .zip file because they are more used to this extension; while Unix users will tend to choose the .tar.gz file. But both platforms can handle both formats (I think), and while the .tar.gz format is smaller this does no longer make much difference with nowadays’ download rates. It’s mainly historical now. As to the shell script problem on Solaris: Matt Healy wrote: On Thu, 20 Mar 2008, J.Pietschmann wrote: Matt Healy wrote: I went back and checked the script, and found that IFS is being set just to the newline character, and does not include spaces. This is intentional: it avoids splitting directorie names which contain spaces, which is rather common now especially on Windows. How about this as an alternative, then: simply move the assignment to (and export of) IFS to a point immediately *after* the evaluation of the command-line arguments. In this way, the loop will appropriately differentiate between the arguments, rather than failing to break the evaluation of '$@' on the spaces between quoted values. In other words, rewrite: export IFS= for arg in $@ ; do . . . . done as: for arg in $@ ; do . . . . done export IFS= This export statement does no longer appear in the 0.95beta release. It seems that it was not needed anyway and it has been moved further down in the script. Can you please try with the latest version and report back on this list? That said, this script looks quite complicated to me. It may make sense to streamline it a bit. For example, I’m not sure the JAVACMD and JAVA_HOME variables are still needed on modern Unix distribution. Also, maybe we can expect bash to be installed by default on every platform now? Perhaps even Python. If there are any volunteers... snip/ HTH, Vincent -- Vincent HennebertAnyware Technologies http://people.apache.org/~vhennebert http://www.anyware-tech.com Apache FOP Committer FOP Development/Consulting - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Italic font not working in fop 0.94
Hello all, I want to generate a PDF displaying the Verdana font. That is going well, except for the bold and italic variants of the font. Can you help out? 1. The .fo I'm using as a source is correct. I know this because if I remove the Verdana font references from my fopconfig.xml file, it does generate, say, italic text where I want it to. 2. AFAIK I've created proper .xml files and refer to the right location from my fopconfig.xml file. I know this because I do see the normal Verdana font. 3. Here's the config fragment I added: font-triplet name=Verdana style=normal weight=normal/ font-triplet name=Verdana Italic style=italic weight=normal/ font-triplet name=Verdana Bold style=normal weight=bold/ font-triplet name=Verdana Bold Italic style=italic weight=bold/ All the .ttf and .xml files are where they should be, but only regular Verdana appears. Any help with this would be greatly appreciated. Thanks in advance, Mathijs SDL Tridion -- View this message in context: http://www.nabble.com/Italic-font-not-working-in-fop-0.94-tp16300421p16300421.html Sent from the FOP - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: FOP 0.94 bin - RTF Conversion on Solaris Box
Hello Jeremias, I can't change the stylesheet as it standard and secondly I am using the same to convert XML to PDF. Can we do anything else? Is there any alternative? Yes and no. Yes, you have to use column-width=2cm instead of column-width=proportional-column-width(1), for examples. And no, you don't manually modify your .fo file, you should change your XSLT stylesheet to use absolute lengths (cm, inches...). I assume you're talking about the table columns being too narrow. With Thanks! NewKid -- View this message in context: http://www.nabble.com/FOP-0.94-bin---Severe-Exceptions-on-Solaris-Box-tp16175972p16300786.html Sent from the FOP - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AFP output. Testing tool winafp
This is not a question but information for those working on modifications to the AFP output from FOP. I noticed that some people were looking for tools to debug and examine the internal structure of AFP. My friend and colleague, Marc G, has a tool that is available from his web site, WinAFP.com. He knows more about AFP than is healthy for anyone, but he does no his stuff. Im sure he may help with any technical questions about AFP, structured fields, formdef, etc . Tom -- View this message in context: http://www.nabble.com/AFP-output.-Testing-tool-winafp-tp16300789p16300789.html Sent from the FOP - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[ANN] Apache FOP 0.95beta Released
The Apache XML Graphics team is pleased to announce the immediate availability of Apache FOP version 0.95beta. FOP (Formatting Objects Processor) is a print formatter driven by XSL Formatting Objects [1] and an output independent formatter. It is a Java application that reads a formatting object tree and renders the resulting pages to a specified output. Output formats currently supported include PDF, PS, PCL, AFP, Print and PNG. This beta release will be available for testing for some time, before a stable release is made. Feedback is welcome, and we would like to encourage as many people as possible to try it out and report bugs and issues on the fop-users mailing list [2]. The most important changes introduced by this release are: - many bug fixes and improvements in tables, better support for keeps and breaks, new features: conditional borders and background on columns and header/footer/body; - better image handling thanks to the new image loading framework provided by the Apache XML Graphics Commons dependency; - improvements and bugfixes for font handling and font auto-detection/-registration; - performance improvements and memory optimizations for the property handling in the FO tree. Please note that support for Java 1.3 has been dropped. Only one type of binaries is provided now, that will run on 1.4+ JREs. Other important release notes are available at http://xmlgraphics.apache.org/fop/0.95/releaseNotes_0.95beta.html For a more complete list of changes, please visit http://xmlgraphics.apache.org/fop/0.95/changes_0.95beta.html For download information, see the following page: http://xmlgraphics.apache.org/fop/download.html [1] http://www.w3.org/TR/xsl11/ [2] http://xmlgraphics.apache.org/fop/maillist.html#fop-user On behalf of the XML Graphics team, Vincent Hennebert - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: FOP 0.94 bin - RTF Conversion on Solaris Box
You can try to write an additional stylesheet that converts the column-width properties as necessary. Or you can try to implement the missing functionality in RTFHandler.java in FOP though that may not be the easiest thing to do. On 26.03.2008 13:32:29 Newkid wrote: Hello Jeremias, I can't change the stylesheet as it standard and secondly I am using the same to convert XML to PDF. Can we do anything else? Is there any alternative? Yes and no. Yes, you have to use column-width=2cm instead of column-width=proportional-column-width(1), for examples. And no, you don't manually modify your .fo file, you should change your XSLT stylesheet to use absolute lengths (cm, inches...). I assume you're talking about the table columns being too narrow. With Thanks! NewKid -- View this message in context: http://www.nabble.com/FOP-0.94-bin---Severe-Exceptions-on-Solaris-Box-tp16175972p16300786.html Sent from the FOP - Users mailing list archive at Nabble.com. Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Metrics Format
I'm not able to get this work with FOP 0.95beta as well. Is there a way I can convert TTF to AFM file format and set the same in FOP configuration to get the Chinese Fonts working? Jeremias Maerki-2 wrote: 0.94 still has a few issues with detecting the right font names. FOP 0.95beta should behave correctly. On 26.03.2008 11:35:14 xsltuser wrote: Thanks for the info. I've now configured my FOP configuration file as fonts !-- automatically detect operating system installed fonts -- auto-detect/ /fonts In my xsl, I'm setting font-family='LeHei Pro' where 'LeHei Pro' is the System Font in Chinese collection. When I run this through FOP processor (0.94), resulting PDF file contains sequences of # where I'm expecting chinese characters. Is this because FOP is not able to locate this font? Any help in this regard is appreciated. snip/ Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Metrics-Format-tp16295993p16300803.html Sent from the FOP - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: AFP output. Testing tool winafp
Many thanks for the information Tom, I'll try out his application - although I use three for testing already! Any tips, advice that the FOP community are able to offer would be much appreciated as AFP is not the easiest format to test/debug/develop due to its extensive nature, mammoth documentation, poor testing tools and binary format. Adrian. Tommo_doc_partner wrote: This is not a question but information for those working on modifications to the AFP output from FOP. I noticed that some people were looking for tools to debug and examine the internal structure of AFP. My friend and colleague, Marc G, has a tool that is available from his web site, WinAFP.com. He knows more about AFP than is healthy for anyone, but he does no his stuff. Im sure he may help with any technical questions about AFP, structured fields, formdef, etc . Tom - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Relative URL for embedding graphics in FOP
Hi Jeremias , I found your response very useful. I have rewritten my code to use UserAgent we were using some old methods of FOP which are now deprecated. I am now back to getting the PDF generated correctly, after code restructuring. I am setting the base URL as follows: FOUserAgent userAgent = fopFactory.newFOUserAgent(); userAgent.setBaseURL(./); I want the base URL to be where the .xsl file is currently located in the Eclipse project, not a hardcoded absolute path like the one in the example in the links provided below, which suggest: userAgent.setBaseURL(file:///C:/Temp/); If I did this only the machine running the application with this folder structure will be able to set the base URL all other machines will not. so I set the base URL as userAgent.setBaseURL(./); However when trying to generate PDF I get in the console: [ INFO] 03/26/08 10:10:31 : FOP base url is ./ [ERROR] 03/26/08 10:10:32 : Error with base URL ./): no protocol: ./ I have placed the logo.gif in the same directory in Eclipse as the .xsl file, but it doesnt seem to like the base URL. Anybody know how to set baseURL to current location of .xsl. I really appreciate any help. Regards. Jeremias Maerki-2 wrote: What you're using is not a relative URL! It's actually an absolute filename which FOP internally converts to an absolute file URL. The leading slash makes it an absolute filename/URL. A relative URL is this, for example: fo:external-graphic src=images/myimage.png/ Any relative URI/URL for images is then resolved against the base URI/URL specified in the configuration. See base in: http://xmlgraphics.apache.org/fop/stable/configuration.html#general-elements Or FOUserAgent.setBaseURL(String): http://xmlgraphics.apache.org/fop/stable/embedding.html#user-agent On 26.03.2008 03:35:16 meghnas wrote: HI All, I have been generating a PDF file using FOP, I want to put a gif onto the PDF. I can do this but only when the .gif file is on the C:/ drive of the machine. I want to use relative path, so that it works for all users. When I put the logo.gif in my c:/ drive and have the code as below it works: fo:table-row fo:table-cell number-columns-spanned=5 fo:block text-align=left fo:external-graphic content-width=2.08in content-height=0.72in src='url(/logo.gif)' / /fo:block /fo:table-cell /fo:table-row I am looking for the syntax to use for src='url(/logo.gif)' Notice the single outer quotes and the double inner quotes - it only works this way for me. My xsl:stylesheet version=1.0 and also xml version is 1.0. The .gif file is actually in my Eclipse project workspace under WebContent, I am just not sure how I can refer to it using relative path. I have tried various different syntax combinations, but have been unsuccessful. Would really appreciate it, if someone could give me an example of using relative path, particularly specifying where they put the actual .gif file. I am interested specifically in where the .xsl file is located and where the .gif is located, and the syntax of the src property. Any help, will be much much appreciated! Thanks. -- View this message in context: http://www.nabble.com/Relative-URL-for-embedding-graphics-in-FOP-tp16294358p16294358.html Sent from the FOP - Users mailing list archive at Nabble.com. Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Relative-URL-for-embedding-graphics-in-FOP-tp16294358p16302994.html Sent from the FOP - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Italic font not working in fop 0.94
Actually, the question you refer to is not the same. Contrary to that user, I did in fact register the various font variants as well. However, I fixed the problem: as of FOP 0.94, you can simply use a lt;directorygt; element to refer to a directory with .TTF files in it (as in c:\windows\fonts\). You can also use the empty lt;auto-detectgt; element so that FOP autodetects all system fonts. I did both, removed the stuff I had inserted before, and suddenly bold and italic variants showed up automatically. M Jeremias Maerki-2 wrote: The same question has been asked only recently. See here: http://markmail.org/message/da7jo7g2wjlnvuzh On 26.03.2008 12:37:43 mpanhuijsen wrote: Hello all, I want to generate a PDF displaying the Verdana font. That is going well, except for the bold and italic variants of the font. Can you help out? 1. The .fo I'm using as a source is correct. I know this because if I remove the Verdana font references from my fopconfig.xml file, it does generate, say, italic text where I want it to. 2. AFAIK I've created proper .xml files and refer to the right location from my fopconfig.xml file. I know this because I do see the normal Verdana font. 3. Here's the config fragment I added: font-triplet name=Verdana style=normal weight=normal/ font-triplet name=Verdana Italic style=italic weight=normal/ font-triplet name=Verdana Bold style=normal weight=bold/ font-triplet name=Verdana Bold Italic style=italic weight=bold/ All the .ttf and .xml files are where they should be, but only regular Verdana appears. Any help with this would be greatly appreciated. Thanks in advance, Mathijs SDL Tridion -- View this message in context: http://www.nabble.com/Italic-font-not-working-in-fop-0.94-tp16300421p16300421.html Sent from the FOP - Users mailing list archive at Nabble.com. Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Italic-font-not-working-in-fop-0.94-tp16300421p16305389.html Sent from the FOP - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Relative URL for embedding graphics in FOP
There's no need to send your question twice. It takes a short while until a post shows up in Nabble. If you use ./ as base URL, you're selecting the current directory of your application as base URL and not the location of the stylesheet. If you want to do this relative to the stylesheet, it's you who has to provide the info where that stylesheet is. There are various possibilities how this could be done in your code (obviously we don't know your code, so we can only guess). If it looks like this: File xsltFile = new File(C:/Temp/mystylesheet.xsl); Transformer transformer = factory.newTransformer(new StreamSource(xsltFile)); then you can use: userAgent.setBaseURL(xsltFile.getParentFile().toURL().toExternalForm()); It really depends how you set up your stylesheet. On 26.03.2008 16:23:49 meghnas wrote: Hi Jeremias , I found your response very useful. I have rewritten my code to use UserAgent we were using some old methods of FOP which are now deprecated. I am now back to getting the PDF generated correctly, after code restructuring. I am setting the base URL as follows: FOUserAgent userAgent = fopFactory.newFOUserAgent(); userAgent.setBaseURL(./); I want the base URL to be where the .xsl file is currently located in the Eclipse project, not a hardcoded absolute path like the one in the example in the links provided below, which suggest: userAgent.setBaseURL(file:///C:/Temp/); If I did this only the machine running the application with this folder structure will be able to set the base URL all other machines will not. so I set the base URL as userAgent.setBaseURL(./); However when trying to generate PDF I get in the console: [ INFO] 03/26/08 10:10:31 : FOP base url is ./ [ERROR] 03/26/08 10:10:32 : Error with base URL ./): no protocol: ./ I have placed the logo.gif in the same directory in Eclipse as the .xsl file, but it doesnt seem to like the base URL. Anybody know how to set baseURL to current location of .xsl. I really appreciate any help. Regards. Jeremias Maerki-2 wrote: What you're using is not a relative URL! It's actually an absolute filename which FOP internally converts to an absolute file URL. The leading slash makes it an absolute filename/URL. A relative URL is this, for example: fo:external-graphic src=images/myimage.png/ Any relative URI/URL for images is then resolved against the base URI/URL specified in the configuration. See base in: http://xmlgraphics.apache.org/fop/stable/configuration.html#general-elements Or FOUserAgent.setBaseURL(String): http://xmlgraphics.apache.org/fop/stable/embedding.html#user-agent On 26.03.2008 03:35:16 meghnas wrote: HI All, I have been generating a PDF file using FOP, I want to put a gif onto the PDF. I can do this but only when the .gif file is on the C:/ drive of the machine. I want to use relative path, so that it works for all users. When I put the logo.gif in my c:/ drive and have the code as below it works: fo:table-row fo:table-cell number-columns-spanned=5 fo:block text-align=left fo:external-graphic content-width=2.08in content-height=0.72in src='url(/logo.gif)' / /fo:block /fo:table-cell /fo:table-row I am looking for the syntax to use for src='url(/logo.gif)' Notice the single outer quotes and the double inner quotes - it only works this way for me. My xsl:stylesheet version=1.0 and also xml version is 1.0. The .gif file is actually in my Eclipse project workspace under WebContent, I am just not sure how I can refer to it using relative path. I have tried various different syntax combinations, but have been unsuccessful. Would really appreciate it, if someone could give me an example of using relative path, particularly specifying where they put the actual .gif file. I am interested specifically in where the .xsl file is located and where the .gif is located, and the syntax of the src property. Any help, will be much much appreciated! Thanks. -- View this message in context: http://www.nabble.com/Relative-URL-for-embedding-graphics-in-FOP-tp16294358p16294358.html Sent from the FOP - Users mailing list archive at Nabble.com. Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Relative-URL-for-embedding-graphics-in-FOP-tp16294358p16302994.html Sent from the FOP - Users mailing list archive at Nabble.com. Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Font problems when using FOP 0.95 Beta
Hi, I have both FOP 0.94 and 0.95beta on my machine. When I process a file with 0.94, there are no warnings. When I process a file with 0.95 I get the following warnings: 26-Mar-2008 17:37:39 org.apache.fop.fonts.FontInfo notifyFontReplacement WARNING: Font 'Symbol,normal,700' not found. Substituting with 'Symbol,normal,400'. 26-Mar-2008 17:37:39 org.apache.fop.fonts.FontInfo notifyFontReplacement WARNING: Font 'ZapfDingbats,normal,700' not found. Substituting with 'ZapfDingbats,normal,400'. Is there a quick fix for this, or do you need to know more about my environment? -- You did not read the manual Our tech writer is sad Locked in the toilet, he is crying - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Font problems when using FOP 0.95 Beta
Well, you seem to be switching to font-family=Symbol while font-weight is bold. FOP just informs you that it hasn't found a bold Symbol font and is instead using a normal Symbol font. To get rid of the warning, just specify font-weight=normal when you switch to Symbol or ZapfDingbats in your stylesheets. On 26.03.2008 18:46:00 Andrew McFarland wrote: Hi, I have both FOP 0.94 and 0.95beta on my machine. When I process a file with 0.94, there are no warnings. When I process a file with 0.95 I get the following warnings: 26-Mar-2008 17:37:39 org.apache.fop.fonts.FontInfo notifyFontReplacement WARNING: Font 'Symbol,normal,700' not found. Substituting with 'Symbol,normal,400'. 26-Mar-2008 17:37:39 org.apache.fop.fonts.FontInfo notifyFontReplacement WARNING: Font 'ZapfDingbats,normal,700' not found. Substituting with 'ZapfDingbats,normal,400'. Is there a quick fix for this, or do you need to know more about my environment? -- You did not read the manual Our tech writer is sad Locked in the toilet, he is crying Poor guy. ;-) Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Font problems when using FOP 0.95 Beta
On 26/03/2008, Jeremias Maerki [EMAIL PROTECTED] wrote: Well, you seem to be switching to font-family=Symbol while font-weight is bold. FOP just informs you that it hasn't found a bold Symbol font and is instead using a normal Symbol font. To get rid of the warning, just specify font-weight=normal when you switch to Symbol or ZapfDingbats in your stylesheets. *nods* But why am I only getting this warning with 0.95beta, not 0.94? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Font problems when using FOP 0.95 Beta
On 26.03.2008 19:01:07 Andrew McFarland wrote: On 26/03/2008, Jeremias Maerki [EMAIL PROTECTED] wrote: Well, you seem to be switching to font-family=Symbol while font-weight is bold. FOP just informs you that it hasn't found a bold Symbol font and is instead using a normal Symbol font. To get rid of the warning, just specify font-weight=normal when you switch to Symbol or ZapfDingbats in your stylesheets. *nods* But why am I only getting this warning with 0.95beta, not 0.94? I'm not sure. There was no explicit change in beahviour but we had various changes in the font area. At any rate, I consider the current behaviour to be correct and expected as I would want to know if a given font is not available and a different one was chosen instead. Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Metrics Format
We are open to using either AFM or TrueType fonts whichever gets the Chinese fonts working for us. Fortunately, I have been able to identify the root cause of the issue. FOP processor fails to parse any ttf file which does not have the corresponding cmap table. Heres the sample output: TTF Reader for Apache FOP 0.94 Parsing font... Reading fonts/Helvetica.ttf... Unicode cmap table not present Unsupported format: Aborting I have been able to successfully use auto-detect/ for the fonts with CMAP table but not the ones without it. Is this a bug with TTFReader? We are sure the characters we want to show are really available in this font as they show up when rendered with alternate APIs avaliable like iText. Jeremias Maerki-2 wrote: AFM is for Type 1 fonts. You're talking about TrueType fonts. That's two different pairs of shoes. - What's FOP's log output for your document? - You specified auto-detect/. Is this font properly installed in your operating system? If not, FOP cannot find it and you might have to use the directory element instead. - Are you sure the characters you want to show are really available in this font? On 26.03.2008 14:05:04 xsltuser wrote: I'm not able to get this work with FOP 0.95beta as well. Is there a way I can convert TTF to AFM file format and set the same in FOP configuration to get the Chinese Fonts working? Jeremias Maerki-2 wrote: 0.94 still has a few issues with detecting the right font names. FOP 0.95beta should behave correctly. On 26.03.2008 11:35:14 xsltuser wrote: Thanks for the info. I've now configured my FOP configuration file as fonts !-- automatically detect operating system installed fonts -- auto-detect/ /fonts In my xsl, I'm setting font-family='LeHei Pro' where 'LeHei Pro' is the System Font in Chinese collection. When I run this through FOP processor (0.94), resulting PDF file contains sequences of # where I'm expecting chinese characters. Is this because FOP is not able to locate this font? Any help in this regard is appreciated. snip/ Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Metrics-Format-tp16295993p16321428.html Sent from the FOP - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]