Re: request for java code snippet to XML-> XSL-FO -> PDF
Hello Robert, You can find a full example in our current release: {fop directory}\examples\ embedding\java\embedding\ExampleXML2PDF.java. To compile and run this example, it would be best to have Apache Ant on your machine. The build.xml file is at {fop directory}\examples\embedding. From that directory, just type "ant" to compile the Java file, and "ant example3" to run the above Java application. Thanks, Glen > On Wed, 2004-02-04 at 15:57, > [EMAIL PROTECTED] wrote: > > > > can someone send a java code snippet on how to do > this > > from within a java app > __ Do you Yahoo!? Yahoo! Finance: Get your refund fast by filing online. http://taxes.yahoo.com/filing.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem with scaling png image file in svg section
Thanks Chris. I tried with Batik Squiggle for the png images. If I does not use , the png image looks good in the GUI, it does get scaled properly. But image with scale() transform attribute losses quality, and the png file generated by Squiggle is in bad quality. I am also sending the email to batik-user mail list. Hope Batik team can also help. Attache please find a svg file , a source png file and generated png file. Thanks a lot. Jay List: fop-user Subject:Re: Problem with scaling png image file in svg section From: Chris Bowditch Date: 2004-02-05 9:11:43 Message-ID: <402208CF.4010500 () hotmail ! com> [Download message RAW] Jay Chiu wrote: > I generate fo file with svg section to hold absolute positioned > text and images. If the image size matches the width and height > attributes of the svg:image element, the image in final > generated pdf looks fine. But if the image size is bigger than > the width/height attributes of the svg:image element, then the > quality of the image in the final pdf is very bad. > I include the png file in svg section of .fo file through > xlink:href="p2.png"/> Have you tried running your SVG using Batik's squiggle? Does it look okay there. If not, then this question should really be directed at the Batik guys, because FOP uses Batik to handle its SVG. If it does look okay in squiggle, then there could be an issue in FOP's SVG-PDF Transcoder. One other question: Does the image inside the SVG look okay if you dont specify width and height attributes on svg:image? Get your own "800" number Voicemail, fax, email, and a lot more http://www.ureach.com/reg/tag On Wed, 4 Feb 2004, Jay Chiu ([EMAIL PROTECTED]) wrote: > > I generate fo file with svg section to hold absolute positioned > text and images. If the image size matches the width and height > attributes of the svg:image element, the image in final > generated pdf looks fine. But if the image size is bigger than > the width/height attributes of the svg:image element, then the > quality of the image in the final pdf is very bad. > I include the png file in svg section of .fo file through > xlink:href="p2.png"/> > > But the png file directly included in .fo scales fine. > height="100px"/> > > I use jfreechart to generate the chart image. Because of > jfreechart's implementation, I have to generate a big chart > image and put it into a smaller space to have high resolution. > > Attached please find a fo file and the generated pdf file. > > Can someone please tell me how to solve this problem? > > Thank you very much. > > Jay > > > Get your own "800" number > Voicemail, fax, email, and a lot more > http://www.ureach.com/reg/tag > > > > ATTACHMENT 1: application/pdf > DISPOSITION: attachment; filename="r3.pdf" > > > ATTACHMENT 2: application/octet-stream > DISPOSITION: attachment; filename="r.fo" > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > png.svg Description: Binary data <><>- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How turn off logger?
How do I turn off the logger? Or at least turn off logging to the console? Also, are there any performance tips anyone can give? The generation of a PDF from a ".fo" file is a bit slow. _ Check out the great features of the new MSN 9 Dial-up, with the MSN Dial-up Accelerator. http://click.atdmt.com/AVE/go/onm00200361ave/direct/01/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How turn off logger?
> How do I turn off the logger? Or at least turn off logging to > the console? For info about how to turn off logging, or using a different logger - you should check out these links: http://xml.apache.org/fop/embedding.html#basic-logging http://xml.apache.org/fop/embedding.html#logging Regards, Flemming - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How turn off logger?
from the same link, "If you want FOP to be totally silent you can also set an org.apache.avalon.framework.logger.NullLogger instance" -Original Message- From: Flemming Jønsson [mailto:[EMAIL PROTECTED] Sent: Friday, February 06, 2004 9:46 AM To: [EMAIL PROTECTED] Subject: RE: How turn off logger? > How do I turn off the logger? Or at least turn off logging to > the console? For info about how to turn off logging, or using a different logger - you should check out these links: http://xml.apache.org/fop/embedding.html#basic-logging http://xml.apache.org/fop/embedding.html#logging Regards, Flemming - 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]
RE: How turn off logger?
Thanks! From: [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: RE: How turn off logger? Date: Fri, 6 Feb 2004 09:58:48 -0500 from the same link, "If you want FOP to be totally silent you can also set an org.apache.avalon.framework.logger.NullLogger instance" -Original Message- From: Flemming Jønsson [mailto:[EMAIL PROTECTED] Sent: Friday, February 06, 2004 9:46 AM To: [EMAIL PROTECTED] Subject: RE: How turn off logger? > How do I turn off the logger? Or at least turn off logging to > the console? For info about how to turn off logging, or using a different logger - you should check out these links: http://xml.apache.org/fop/embedding.html#basic-logging http://xml.apache.org/fop/embedding.html#logging Regards, Flemming - 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] _ Check out the great features of the new MSN 9 Dial-up, with the MSN Dial-up Accelerator. http://click.atdmt.com/AVE/go/onm00200361ave/direct/01/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Why is FOP MUCH slower the first time than all other runs?
I'm using FOP from a servlet in Tomcat. The first time I run FOP (using Driver to render a dpf - is that the best way?), it's VERY slow. However, every time after that, it's very fast. Does anyone know why? What can I do to fix this? _ Optimize your Internet experience to the max with the new MSN Premium Internet Software. http://click.atdmt.com/AVE/go/onm00200359ave/direct/01/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Why is FOP MUCH slower the first time than all other runs?
its prob has something to do with caching of with the fact that reflection is used first time to find calss and instantiate it, but there after its in the class loader could add a context listener to tomcat startup and it does the first xform on container startup -Original Message- From: Robert Paris [mailto:[EMAIL PROTECTED] Sent: Friday, February 06, 2004 11:55 AM To: [EMAIL PROTECTED] Subject: Why is FOP MUCH slower the first time than all other runs? I'm using FOP from a servlet in Tomcat. The first time I run FOP (using Driver to render a dpf - is that the best way?), it's VERY slow. However, every time after that, it's very fast. Does anyone know why? What can I do to fix this? _ Optimize your Internet experience to the max with the new MSN Premium Internet Software. http://click.atdmt.com/AVE/go/onm00200359ave/direct/01/ - 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]
RE: Why is FOP MUCH slower the first time than all other runs?
It needs to load a lot libs, (many IOs ) This happens to all java apps. Not Just FOP. -Original Message- From: Robert Paris [mailto:[EMAIL PROTECTED] Sent: Friday, February 06, 2004 10:55 AM To: [EMAIL PROTECTED] Subject: Why is FOP MUCH slower the first time than all other runs? I'm using FOP from a servlet in Tomcat. The first time I run FOP (using Driver to render a dpf - is that the best way?), it's VERY slow. However, every time after that, it's very fast. Does anyone know why? What can I do to fix this? _ Optimize your Internet experience to the max with the new MSN Premium Internet Software. http://click.atdmt.com/AVE/go/onm00200359ave/direct/01/ - 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]
RE: Why is FOP MUCH slower the first time than all other runs?
I don't think it's the tomcat issue, it takes a long time the first time even when I call it from a java class (if the class creates a pdf then creates another one before exiting, the second one is much faster). It's got to be in the FOP. Is there a way to fix this? From: [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: RE: Why is FOP MUCH slower the first time than all other runs? Date: Fri, 6 Feb 2004 12:02:00 -0500 its prob has something to do with caching of with the fact that reflection is used first time to find calss and instantiate it, but there after its in the class loader could add a context listener to tomcat startup and it does the first xform on container startup -Original Message- From: Robert Paris [mailto:[EMAIL PROTECTED] Sent: Friday, February 06, 2004 11:55 AM To: [EMAIL PROTECTED] Subject: Why is FOP MUCH slower the first time than all other runs? I'm using FOP from a servlet in Tomcat. The first time I run FOP (using Driver to render a dpf - is that the best way?), it's VERY slow. However, every time after that, it's very fast. Does anyone know why? What can I do to fix this? _ Optimize your Internet experience to the max with the new MSN Premium Internet Software. http://click.atdmt.com/AVE/go/onm00200359ave/direct/01/ - 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] _ Click here for a FREE online computer virus scan from McAfee. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: fop ant task: change working directory?
No worries - I figured out that does the trick. Basic question, I know.. But I was learning ant. cheers --alan On February 2, 2004 03:22 pm, J.Pietschmann wrote: > S. Alan Ezust wrote: > > I'm not sure if this is an ant question or a fop question, but I was > > trying to use the fop custom task, and I want to set the current working > > directory that fop runs from. How does one do that with fop ant task? Do > > I set a property somewhere? > > I'm notsure what you mean by "working directory". Ant > has the concept of "project directory", and relative > pathnames used in tasks are resolved agains this. > If you mean the base directory FOP uses for resolving > relative URLs in the external graphics src, I think > the task has a parameter for it. If not, well, check > the source whether it sets the base directory to the > base directory of the currently processed FO document, > as it actually should. > > Now that I think of it, the task should be updated to > have a parameter for the font base directory as well. > > J.Pietschmann > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] -- S. Alan Ezust Ottawa, Ontario, Canada http://cartan.cas.suffolk.edu/~sae - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Why is FOP MUCH slower the first time than all other runs?
No, it's not in FOP. George is on the right track and Robert is not that far away IMO. FOP is a relatively big package and with a number of dependecies. Lots of classes take a lot of time to load. After loading they need to be initialized and then the JIT (Just in time Compiler) clicks in and compiles some of the often used Java byte code to native code on the fly. This is commonly called virtual machine warm-up. Once it's warmed up it gets real fast. The caching comment from Robert if rephrased points to another possible speed difference between the first and the second run. FOP caches images. So if you use the same images in many documents FOP can reuse the already loaded images. Loading images takes quite some time. Every program will need some time to ramp up in the beginning, be it written in Java or any other language. In Java this may be a bit more distinctive due to class loading and VM warm-up. So, I don't think there is a way to fix this. It's pretty common knowledge that you have to let the VM warm up before performance benchmarks (as an example) can be done (at least on the Java platform). This fact can be a problem for people using the FOP command-line very often as they have to endure the VM warm-up every time. On 06.02.2004 21:21:12 Robert Paris wrote: > I don't think it's the tomcat issue, it takes a long time the first time > even when I call it from a java class (if the class creates a pdf then > creates another one before exiting, the second one is much faster). It's got > to be in the FOP. Is there a way to fix this? Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Why is FOP MUCH slower the first time than all other runs?
Robert Paris wrote: I don't think it's the tomcat issue, it takes a long time the first time even when I call it from a java class (if the class creates a pdf then creates another one before exiting, the second one is much faster). It's got to be in the FOP. Is there a way to fix this? 1. It has to load all the classes from the jars. 2. Some static data is set up while loading classes, for example the tables mapping the FO names to factories. There's a lot of object creation and such going on at this time. The current implementation has certainly room for improvement. Several ideas have been discussed, here as well as for other software facing similar problems. Unfortunately, Java doesn't allow for really static memory initialization like C/C++ does, which, together with the lack of plain function pointers, makes further optimization of the mapping tables somewhat difficult. If you have ideas, please post. Well, the static data as well as various instance data is quite often initialized too eagerly. I'll be indebted to anyone who scrutinizes the whole setup for places where postponing creating a variety of ArrayLists and HashTables is a win. IIRC in the example I used for tracking down the table area problems there were 80 HashTables created, of which only 20 ever saw an element put into it (the average number of elements for hash tables with at elast one element was less than 1.2). J.Pietschmann - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Why is FOP MUCH slower the first time than all other runs?
One way to work around, you can write an init servlet to load these jars when you start Tomcat. Of cause these will increase Tomcat startup time. -Original Message- From: J.Pietschmann [mailto:[EMAIL PROTECTED] Sent: Friday, February 06, 2004 3:12 PM To: [EMAIL PROTECTED] Subject: Re: Why is FOP MUCH slower the first time than all other runs? Robert Paris wrote: > I don't think it's the tomcat issue, it takes a long time the first time > even when I call it from a java class (if the class creates a pdf then > creates another one before exiting, the second one is much faster). It's > got to be in the FOP. Is there a way to fix this? 1. It has to load all the classes from the jars. 2. Some static data is set up while loading classes, for example the tables mapping the FO names to factories. There's a lot of object creation and such going on at this time. The current implementation has certainly room for improvement. Several ideas have been discussed, here as well as for other software facing similar problems. Unfortunately, Java doesn't allow for really static memory initialization like C/C++ does, which, together with the lack of plain function pointers, makes further optimization of the mapping tables somewhat difficult. If you have ideas, please post. Well, the static data as well as various instance data is quite often initialized too eagerly. I'll be indebted to anyone who scrutinizes the whole setup for places where postponing creating a variety of ArrayLists and HashTables is a win. IIRC in the example I used for tracking down the table area problems there were 80 HashTables created, of which only 20 ever saw an element put into it (the average number of elements for hash tables with at elast one element was less than 1.2). 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]
RE: Why is FOP MUCH slower the first time than all other runs?
Or you can start tomcat and leave it on... -Original Message- From: George Yi [mailto:[EMAIL PROTECTED] Sent: Friday, February 06, 2004 4:19 PM To: [EMAIL PROTECTED] Subject: RE: Why is FOP MUCH slower the first time than all other runs? One way to work around, you can write an init servlet to load these jars when you start Tomcat. Of cause these will increase Tomcat startup time. -Original Message- From: J.Pietschmann [mailto:[EMAIL PROTECTED] Sent: Friday, February 06, 2004 3:12 PM To: [EMAIL PROTECTED] Subject: Re: Why is FOP MUCH slower the first time than all other runs? Robert Paris wrote: > I don't think it's the tomcat issue, it takes a long time the first time > even when I call it from a java class (if the class creates a pdf then > creates another one before exiting, the second one is much faster). It's > got to be in the FOP. Is there a way to fix this? 1. It has to load all the classes from the jars. 2. Some static data is set up while loading classes, for example the tables mapping the FO names to factories. There's a lot of object creation and such going on at this time. The current implementation has certainly room for improvement. Several ideas have been discussed, here as well as for other software facing similar problems. Unfortunately, Java doesn't allow for really static memory initialization like C/C++ does, which, together with the lack of plain function pointers, makes further optimization of the mapping tables somewhat difficult. If you have ideas, please post. Well, the static data as well as various instance data is quite often initialized too eagerly. I'll be indebted to anyone who scrutinizes the whole setup for places where postponing creating a variety of ArrayLists and HashTables is a win. IIRC in the example I used for tracking down the table area problems there were 80 HashTables created, of which only 20 ever saw an element put into it (the average number of elements for hash tables with at elast one element was less than 1.2). 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] ___ This message contains information that may be privileged or confidential and is the property of the Cap Gemini/Ernst & Young Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. ___ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
fork ant fop task with its own heap?
Is it possible to fork an ANT FOP task and give it a heap size of its own? I can't find a fork= attribute in , or . Do I put this somewhere else? I don't want FOP eating up the memory of my development environment when I run it through Jedit/Antelope. -- S. Alan Ezust Ottawa, Ontario, Canada http://cartan.cas.suffolk.edu/~sae - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: fork ant fop task with its own heap?
S. Alan Ezust wrote: Is it possible to fork an ANT FOP task and give it a heap size of its own? I can't find a fork= attribute in , or . Do I put this somewhere else? You'll probably want to look at the task. Check the Ant docs for details, and you likely get more hints on the Ant user list. J.Pietschmann - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: fork ant fop task with its own heap?
Something like this may be of help--this is what I do for running FOP within the JEdit IDE: Glen --- "J.Pietschmann" <[EMAIL PROTECTED]> wrote: > S. Alan Ezust wrote: > > > Is it possible to fork an ANT FOP task and give it > a heap size of its own? I > > can't find a fork= attribute in , > or . Do I put this > > somewhere else? > > You'll probably want to look at the task. > Check > the Ant docs for details, and you likely get more > hints > on the Ant user list. > > J.Pietschmann > > > - > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > __ Do you Yahoo!? Yahoo! Finance: Get your refund fast by filing online. http://taxes.yahoo.com/filing.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]