Re: Performance improvement suggestions
Pascal Sancho-2 wrote Probably, fop[58] is for fop shell script, line 58; you should have a look into that part. The reference to line 58 points to the fop script where at said line it executes the configuration file: if [ -f $BMS/cus/scripts/.fop/fop.xconf ] ; then . $BMS/cus/scripts/.fop/fop.xconf fi It looks innocent enough until I noticed the leading period (.) on the second line which is line 58. In fact the other configuration file references in the downloaded fop script, before and after this one, have the same error: # Source/default fop configuration if $no_config ; then rpm_mode=false else # load system-wide fop configuration if [ -f /etc/fop.conf ] ; then . /etc/fop.conf fi # load user fop configuration if [ -f $HOME/.fop/fop.conf ] ; then . $HOME/.fop/fop.conf fi if [ -f $HOME/.foprc ] ; then . $HOME/.foprc fi I have removed the offending period and it now runs. Thanks for all the help. - just starting out with FOP - don't hurt me! -- View this message in context: http://apache-fop.1065347.n5.nabble.com/Performance-improvement-suggestions-tp37754p37808.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: Performance improvement suggestions
that's not an error, its the shell's dot command [1]; perhaps you are using a non-standard shell that doesn't support it [1] http://en.wikipedia.org/wiki/Dot_(Unix) On Sun, Jan 20, 2013 at 6:16 PM, nels nbhc...@gmail.com wrote: Pascal Sancho-2 wrote Probably, fop[58] is for fop shell script, line 58; you should have a look into that part. The reference to line 58 points to the fop script where at said line it executes the configuration file: if [ -f $BMS/cus/scripts/.fop/fop.xconf ] ; then . $BMS/cus/scripts/.fop/fop.xconf fi It looks innocent enough until I noticed the leading period (.) on the second line which is line 58. In fact the other configuration file references in the downloaded fop script, before and after this one, have the same error: # Source/default fop configuration if $no_config ; then rpm_mode=false else # load system-wide fop configuration if [ -f /etc/fop.conf ] ; then . /etc/fop.conf fi # load user fop configuration if [ -f $HOME/.fop/fop.conf ] ; then . $HOME/.fop/fop.conf fi if [ -f $HOME/.foprc ] ; then . $HOME/.foprc fi I have removed the offending period and it now runs. Thanks for all the help. - just starting out with FOP - don't hurt me! -- View this message in context: http://apache-fop.1065347.n5.nabble.com/Performance-improvement-suggestions-tp37754p37808.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: Performance improvement suggestions
Hi, can you attach your file, rather than copy/paste it? that will allow one to test it easily. 2013/1/18 nels nbhc...@gmail.com: Glenn Adams-2 wrote If you want to use strict mode using the command line interface, then you need to use the FOP configuration file to specify strict validation mode. See http://xmlgraphics.apache.org/fop/1.1/configuration.html. In other words, insert strict-validation true /strict-validation into your fop.xconf file at the appropriate level. Thanks Glenn. I just tried running (1.1) FOP with the issued xconf file and it complained: fop[58]: 0403-057 Syntax error at line 2 : `newline or ;' is not expected. The first few lines look like this: ?xml version=1.0? fop version=1.0 base./base Do I need to edit it first? - just starting out with FOP - don't hurt me! -- pascal - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Performance improvement suggestions
Hi pascal, I was referring to the xconf file in my last post is that the one you want me to attach? It is the one that comes with the 1.1 download and it fails with the error: fop[58]: 0403-057 Syntax error at line 2 : `newline or ;' is not expected. - just starting out with FOP - don't hurt me! -- View this message in context: http://apache-fop.1065347.n5.nabble.com/Performance-improvement-suggestions-tp37754p37786.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: Performance improvement suggestions
Thanks again. I have used the Unix method of redirecting output now. The process will be run from the application and the messages are meaningless to the end user hence my question. - just starting out with FOP - don't hurt me! -- View this message in context: http://apache-fop.1065347.n5.nabble.com/Performance-improvement-suggestions-tp37754p37775.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: Performance improvement suggestions
If you want to use strict mode using the command line interface, then you need to use the FOP configuration file to specify strict validation mode. See http://xmlgraphics.apache.org/fop/1.1/configuration.html. In other words, insert strict-validationtrue/strict-validation into your fop.xconf file at the appropriate level. On Thu, Jan 17, 2013 at 12:45 AM, John Brown johnbrown...@hotmail.comwrote: Nels wrote: Thanks John, doing that I now get this error: Exception in thread main java.lang.NoClassDefFoundError: snip/ Could not find the main class: fopFactory.setStrictValidation(false). Program will exit. I was not really paying atention to what you were trying to do. The previous instruction was just to get the shell to accept brackets. However, FOP_OPTS is for specifying parameters to java, for example -Xms64m to set the initial size of the heap to 64 MB. You cannot insert a function call there. Regards, John Brown. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Performance improvement suggestions
Glenn Adams-2 wrote If you want to use strict mode using the command line interface, then you need to use the FOP configuration file to specify strict validation mode. See http://xmlgraphics.apache.org/fop/1.1/configuration.html. In other words, insert strict-validation true /strict-validation into your fop.xconf file at the appropriate level. Thanks Glenn. I just tried running (1.1) FOP with the issued xconf file and it complained: fop[58]: 0403-057 Syntax error at line 2 : `newline or ;' is not expected. The first few lines look like this: ?xml version=1.0? fop version=1.0 base./base Do I need to edit it first? - just starting out with FOP - don't hurt me! -- View this message in context: http://apache-fop.1065347.n5.nabble.com/Performance-improvement-suggestions-tp37754p37781.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: Performance improvement suggestions
Alexios Giotis wrote Update to FOP 1.1 release. Finally, I have noticed some performance improvements using fopFactory.setStrictValidation(false); Alexis Giotis I have updated to 1.1 now. Adding fopFactory.setStrictValidation(false); directly into the fop script gives me this error: fop[263]: 0403-057 Syntax error at line 1 : `(' is not expected. The actual line added is: FOP_OPTS=fopFactory.setStrictValidation(false); Appreciate your advice. - just starting out with FOP - don't hurt me! -- View this message in context: http://apache-fop.1065347.n5.nabble.com/Performance-improvement-suggestions-tp37754p37769.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: Performance improvement suggestions
Nels wrote: I have updated to 1.1 now. Adding fopFactory.setStrictValidation(false); directly into the fop script gives me this error: fop[263]: 0403-057 Syntax error at line 1 : `(' is not expected. The actual line added is: FOP_OPTS=fopFactory.setStrictValidation(false); Appreciate your advice. Put an ESCAPE before the brackets: FOP_OPTS=fopFactory.setStrictValidation\(false\); Regards, John Brown. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
RE: Performance improvement suggestions
I can't get the fop option -q for quiet mode to work. Running from the command line I tried: fop -q -xml xml_file.xml -xsl xsl_file.xsl -pdf pdf_file.pdf But I still receive warnings. Can I suppress these this way? - just starting out with FOP - don't hurt me! -- View this message in context: http://apache-fop.1065347.n5.nabble.com/Performance-improvement-suggestions-tp37754p37772.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: Performance improvement suggestions
Nels wrote: Thanks John, doing that I now get this error: Exception in thread main java.lang.NoClassDefFoundError: snip/ Could not find the main class: fopFactory.setStrictValidation(false). Program will exit. I was not really paying atention to what you were trying to do. The previous instruction was just to get the shell to accept brackets. However, FOP_OPTS is for specifying parameters to java, for example -Xms64m to set the initial size of the heap to 64 MB. You cannot insert a function call there. Regards, John Brown. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
RE: Performance improvement suggestions
Nels wrote: I can't get the fop option -q for quiet mode to work. Running from the command line I tried: fop -q -xml xml_file.xml -xsl xsl_file.xsl -pdf pdf_file.pdf But I still receive warnings. Can I suppress these this way? The warnings that you are seeing are displayed on the standard error output. You can redirect it like this on Linux: $ fop -q ... 2 /dev/null or like this on Windows: C:\fop -q 2 nul Are you sure that you want to suppress those warnings? Consider a DocBook document that I am working on now. When not suppressing warnings, I get among the output: ... Font ZapfDingbats,normal,700 not found. Substituting with ZapfDingbats,normal ,400. Couldn't find hyphenation pattern for lang=en. ... With -q, the font warning goes away, but the hyphenation warning remains. If I suppress the hyphenation warning, I will not know that there is a problem. Regards, John Brown. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Performance improvement suggestions
Hi, tables are good for data grids, but you can use alternate solution in many cases. Example 1: Border can apply to many FOs, so you don't need to use table here. Example 2: title starting with graphic symbol: table solution needs a complete table structure: fo:table/fo:table-body/fo:table-row, plus 2 table-cell (witch consumes time and memory) Alternative: only 2 fo:block-container: fo:block-container keep-with-next=always space-after=-{$my_inner_height} !-- graphic block -- /fo:block-container fo:block-container start-indent={$my_width_allocated_to_graphic_symbol} fo:block start-indent=0My title/fo:block /fo:block-container Note that such solution need to understand how indent inheritance is done in XSL-FO (see [1]). HTH [1] http://wiki.apache.org/xmlgraphics-fop/IndentInheritance 2013/1/14 nels nbhc...@gmail.com: My first FOP project ... I am trying to provide near instantaneous conversion of XML to PDF for our users and have written a custom XSL-FO. Having read a number of threads here I have seen the suggestion to replace PNG images with JPG. I have done this though from my timings I can't say with certainty that run times have reduced. I have seen other suggestions and seek some more information as to how to implement them - they are: load style sheets into memory, use a server VM and don't use tables. The third suggestion I could probably do but would take a fair bit of effort and I would like to know up front if this would speed things up significantly. Also how do I draw the table cell borders if I don't explicitly use tables? Any assistance appreciated. - just starting out with FOP - don't hurt me! -- pascal - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Performance improvement suggestions
On 14 Jan 2013, at 09:25, nels nbhc...@gmail.com wrote: My first FOP project ... I am trying to provide near instantaneous conversion of XML to PDF for our users and have written a custom XSL-FO. Welcome to FOP. Having read a number of threads here I have seen the suggestion to replace PNG images with JPG. I have done this though from my timings I can't say with certainty that run times have reduced. I have seen other suggestions and seek some more information as to how to implement them - they are: load style sheets into memory, I guess you mean keeping in memory a javax.xml.transform.Templates object for each XSLT and I assume that you are embedding FOP in your application (if not, then it will be much faster). Using Templates is a good practice, easy to implement, so do it but don't expect to see big differences. Also note that this step is not really part of FOP. FOP consumes the XSL:FO which is the output of this transformation. use a server VM and Yes, it will definitely help. don't use tables. I am not aware of any significant performance penalty due to the usage of tables. For big tables, there was https://issues.apache.org/jira/browse/FOP-1888 which is fixed in the latest 1.1 release. If you really need tables for your layouts then use them and come back to it, if you later see that this is slow. You will have to write at least how many pages your documents are and what you mean by near instantaneous conversion. Assuming you have images and an output of 2-4 pages, it will be hard to get below 100ms per document, after warming up. Having said that, here is some other points that will help: * Create a single org.apache.fop.apps.FopFactory and reuse it. It should be thread-safe and this is how you will get the best performance after rendering a couple of documents (warm-up) * Make sure the JVM has enough heap (-Xmx). I would not recommend below 512MB. * If you don't need complex script support (e.g. Arabic, Hebrew scripts), then use userAgent.setComplexScriptFeaturesEnabled(false); * This is obvious, but use the latest FOP release. There are some other more advanced tricks one could use. They are harder to implement and don't apply in all cases. For example, about 80% of the time is to convert from XSL:FO to FOP intermediate format and the other 20% is from the intermediate format to the final PDF format. So caching or producing directly the intermediate format is faster. This is of course FOP specific, not well documented and might not be compatible with past future FOP versions. I hope you have enough suggestions to get started, Alexis Giotis - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Performance improvement suggestions
Alexios Giotis wrote use a server VM and Yes, it will definitely help. Where can I find instructions on setting up a server VM? Alexios Giotis wrote You will have to write at least how many pages your documents are and what you mean by near instantaneous conversion. Assuming you have images and an output of 2-4 pages, it will be hard to get below 100ms per document, after warming up. Having said that, here is some other points that will help: * Create a single org.apache.fop.apps.FopFactory and reuse it. It should be thread-safe and this is how you will get the best performance after rendering a couple of documents (warm-up) How do you do that? Alexios Giotis wrote * Make sure the JVM has enough heap (-Xmx). I would not recommend below 512MB. * If you don't need complex script support (e.g. Arabic, Hebrew scripts), then use userAgent.setComplexScriptFeaturesEnabled(false); * This is obvious, but use the latest FOP release. I'll try these. I'm using 1.1 RC1 and JRE 1.6 on AIX 5.3. - just starting out with FOP - don't hurt me! -- View this message in context: http://apache-fop.1065347.n5.nabble.com/Performance-improvement-suggestions-tp37754p37757.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: Performance improvement suggestions
Pascal Sancho-2 wrote tables are good for data grids, but you can use alternate solution in many cases. Note that such solution need to understand how indent inheritance is done in XSL-FO (see [1]). Thanks Pascal but I would like to try Alexis' suggestions first as this would seem to require less reworking of my XSL-FO. - just starting out with FOP - don't hurt me! -- View this message in context: http://apache-fop.1065347.n5.nabble.com/Performance-improvement-suggestions-tp37754p37758.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: Performance improvement suggestions
On 14 Jan 2013, at 12:43, nels nbhc...@gmail.com wrote: Alexios Giotis wrote use a server VM and Yes, it will definitely help. Where can I find instructions on setting up a server VM? You will have to check the Java documentation. For Sun/Oracle JVMs, we typically add -server command line option, when we start java. Last time I worked on AIX, there was no java ... Alexios Giotis wrote You will have to write at least how many pages your documents are and what you mean by near instantaneous conversion. Assuming you have images and an output of 2-4 pages, it will be hard to get below 100ms per document, after warming up. Having said that, here is some other points that will help: * Create a single org.apache.fop.apps.FopFactory and reuse it. It should be thread-safe and this is how you will get the best performance after rendering a couple of documents (warm-up) How do you do that? I assume you have some Java programming background. Check http://xmlgraphics.apache.org/fop/1.1/embedding.html The example that is closer to what you are doing is: ExampleXML2PDF (referenced in the above link). Alexios Giotis wrote * Make sure the JVM has enough heap (-Xmx). I would not recommend below 512MB. * If you don't need complex script support (e.g. Arabic, Hebrew scripts), then use userAgent.setComplexScriptFeaturesEnabled(false); * This is obvious, but use the latest FOP release. I'll try these. I'm using 1.1 RC1 and JRE 1.6 on AIX 5.3. Update to FOP 1.1 release. Finally, I have noticed some performance improvements using fopFactory.setStrictValidation(false); Alexis Giotis - just starting out with FOP - don't hurt me! -- View this message in context: http://apache-fop.1065347.n5.nabble.com/Performance-improvement-suggestions-tp37754p37757.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