RE: FOP in production app (clienside)
I use Java Web Start to deliver a Java application embedding FOP and it works great. I consider a one-time 5M download to be small these days, compared to lots of other internet practices people frequently use (like downloading game demos). Besides, you can quickly surpass 5M in PDF downloads by clients generating PDF files server-side, particularly if you're using any SVG. Rendering large FOP documents server-side (or client-side) is very resource-intensive, and it doesn't take much math to figure out that you will quickly need to have a number of servers to support any significant population of active users. For my purposes, the incremental cost associated with adding a new user under a server-side arrangement would exceed what I could charge them. Meanwhile, their CPUs would be sitting 99% idle waiting for the document to render on the server Patrick Rusk - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How do you set the memory size for FOP
Try -Xms128m The m at the end means megabytes, of course. Not sure what it defaults to if you don't specify a unit. Pat -Original Message- From: Jon Steeves [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 19, 2003 5:33 PM To: '[EMAIL PROTECTED]' Subject: RE: How do you set the memory size for FOP Roland: Actually, java -Xmx128 -cp etc... was the order of the arguments I originally used -- and it was with this that FOP gave the out of memory error even before it started generating pages. Cheers -Original Message- From: Roland Neilands [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 19, 2003 2:26 PM To: [EMAIL PROTECTED] Subject: RE: How do you set the memory size for FOP Jon, java -cp -Xmx128 Try switching these two (-cp expects the path below as an argument. build\fop.jar;lib\batik.jar;lib\xalan-2.0.0.jar;lib\xerces-1.2 .3.jar;li b\avalon-framework-4.0.jar;lib\logkit-1.0.jar;lib\jimi-1.0.jar org.apache.fop.apps.Fop c:\drb\output.fo c:\drb\output.pdf Cheers, Roland - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How to stop a render FOP ?
Be careful when you say stop the Thread. Threads are no longer supposed to be directly stopped. I am, instead, throwing an Error in the thread, catching it in the same thread, and exiting the thread cleanly. The log messages are only going to System.out in the first place because the default implementation of the org.apache.avalon.framework.logger.Logger used by FOP responds to the debug(), info(), warn(), error(), and fatalError() methods by writing the messages to System.out. If you create your own implementation and set is as the logger for the FOP run, you can do whatever you want, including a setText() on a JTextField found in a dialog that was already put on screen by another thread. Pat -Original Message- From: Philippe PITHON [mailto:[EMAIL PROTECTED] Sent: Monday, February 10, 2003 3:11 AM To: [EMAIL PROTECTED] Subject: RE : How to stop a render FOP ? Thank you for your answer! therefore, the only means of stopping a render, it's to put FOP in Thread (and to stop the Thread) But, how did you make to redirect the logger towards a dialog box? Philippe. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Page numbering
now, the pagenumber is not displayed in the first page. But, i need the page number start with 2 page is left alignment and 3 page is right alignment. The same way, create different page masters for even and odd pages. That's right. Extend my example to have page masters for firstPage, otherPageEven, otherPageOdd. Changed the named header regions to firstPage-before, otherPageEven-before, and otherPageOdd-before. Then use the odd-or-even in the conditional-page-master-reference element to distinguish them. Here's an updated fragmentary example: fo:layout-master-set fo:simple-page-master master-name=firstPage fo:region-before region-name=firstPage-before/ fo:region-body/ /fo:simple-page-master fo:simple-page-master master-name=otherPageOdd fo:region-before region-name=otherPageOdd-before/ fo:region-body/ /fo:simple-page-master fo:simple-page-master master-name=otherPageEven fo:region-before region-name=otherPageEven-before/ fo:region-body/ /fo:simple-page-master fo:page-sequence-master master-name=contents fo:repeatable-page-master-alternatives fo:conditional-page-master-reference master-reference=firstPage page-position=first/ fo:conditional-page-master-reference master-reference=otherPageOdd odd-or-even=odd page-position=any/ fo:conditional-page-master-reference master-reference=otherPageEven odd-or-even=even page-position=any/ /fo:repeatable-page-master-alternatives /fo:page-sequence-master /fo:layout-master-set fo:page-sequence master-reference=contents fo:static-content flow-name=firstPage-before fo:block Look! No page number here. /fo:block /fo:static-content fo:static-content flow-name=otherPageOdd-before fo:block text-align=right p. fo:page-number/ /fo:block /fo:static-content fo:static-content flow-name=otherPageEven-before fo:block text-align=left p. fo:page-number/ /fo:block /fo:static-content fo:flow flow-name=xsl-region-body fo:block Body text. /fo:block /fo:flow /fo:page-sequence Pat - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Page numbering
The key is in having a different header (or footer) on the first page versus the others. The steps to do this are: 1) Have a separate page master for the first page versus the rest of the pages. 2) Add different region-names to the header (or footer) regions on those pages. 3) Use the repeatable-page-master-alternatives feature to invoke the proper page masters for the first versus the other pages. 4) In your actual page sequence, define the contents of the header (or footer) regions to include the page number on in the other pages header region. Here's a fragmentary example: fo:layout-master-set fo:simple-page-master master-name=firstPage fo:region-before region-name=firstPage-before/ fo:region-body/ /fo:simple-page-master fo:simple-page-master master-name=otherPage fo:region-before region-name=otherPage-before/ fo:region-body/ /fo:simple-page-master fo:page-sequence-master master-name=contents fo:repeatable-page-master-alternatives fo:conditional-page-master-reference master-reference=firstPage page-position=first/ fo:conditional-page-master-reference master-reference=otherPage page-position=any/ /fo:repeatable-page-master-alternatives /fo:page-sequence-master /fo:layout-master-set fo:page-sequence master-reference=contents fo:static-content flow-name=firstPage-before fo:block Look! No page number here. /fo:block /fo:static-content fo:static-content flow-name=otherPage-before fo:block The page number is fo:page-number/ /fo:block /fo:static-content fo:flow flow-name=xsl-region-body fo:block Body text. /fo:block /fo:flow /fo:page-sequence Hope this helps. Patrick Rusk -Original Message- From: H. krishna [mailto:[EMAIL PROTECTED] Sent: Saturday, February 08, 2003 5:43 AM To: [EMAIL PROTECTED] Subject: Page numbering Hai, i don't need the page number in the first page only. but, want to second page start like 2. Immediate response is highly appreciated. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How to stop a render FOP ?
How to stop a render FOP ? Philippe, I'm going to assume that you want a human or a program to stop a FOP run that is embedded in a program that should otherwise remain running. If you mean the command line, you can, of course, use ^C or whatever interrupt command is appropriate to your shell. It would be preferable to be able to run FOP in a separate thread, and then set some flag from the main thread that FOP would notice and abort on. If such a simple, programmatic mechanism for doing this exists, I don't know of it. I have been able to implement the following though I wanted to put up a modal progress dialog that would indicate how many pages have been rendered thus far. I did this by creating ProgressDialogLogger, an implementation of the org.apache.avalon.framework.logger.Logger interface, and set it as the logger for the rendering run. Then, from the main thread I put up the modal progress dialog with an initial message of Initializing Then I launch FOP in a separate thread. Every time FOP logs a message, particularly the INFO messages counting off the rendered pages, I update the message in the progress dialog. When FOP finishes, the dialog is disposed of. That all worked fine. Then I wanted to put a Cancel button on the dialog. The Cancel button sets a flag on the ProgressDialogLogger. The next time that FOP attempts to log a message, the ProgressDialogLogger notices this flag and throws a CancelError, a subclass of Error. I chose an Error subclass on the assumption that FOP would not have any catch (Error error) blocks, which appears correct. Then, my background thread running FOP catches the CancelError, closes the streams it opened for FOP, disposes of the progress dialog, and exits. Hope this helps. Patrick Rusk - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How can I force a space in rendered output?
I have a need to put copyright symbols in my rendered text from time to time, and I like to follow them with a space. Because of some of the transformation logic required when I do this, I can't easily ensure that an actual space will appear in the event stream that FOP processes. In other words, I can't do the following: fo:character character=#x00A9;/ fo:inline2003/fo:inline What I'm looking for is a FO element that I can put between the fo:character above and the fo:inline. I thought that fo:character character= / would work, but it does not. Does anyone know of an element that I can use? Patrick Rusk - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: extra page breaks inserted
Chris, If you have multiple page sequences, and you restart the page numbering in each one, you may get blank pages inserted if you don't pay attention to the force-page-count property of page sequences. Here's a section from Pawson that describes it: cut here The force-page-count property imposes a condition on the number of pages in a page sequence. This number may be an absolute count, or a parity condition. For each condition, if the condition is not satisfied, the action taken is to add one page to the current page sequence. The values of the property, and the proper interpretation of same, are listed below: force-page-count auto The action taken depends on the existence of a succeeding page sequence, and the value of its initial-page-number property. If there is a succeeding page sequence, and an even initial-page-number is explicitly specified on it, then the current page sequence is forced to have an odd number of pages. If there is a succeeding page sequence, and an odd initial-page-number is explicitly specified on it, then the current page sequence is forced to have an even number of pages. even Force an even page-count for the page sequence. odd Force an odd page-count for the page sequence. end-on-even Force the last page to have an even page number. end-on-odd Force the last page to have an odd page number. no-force Do not force any page count. Tip Note that the default value is auto. This may cause action to be taken. cut here In brief, page sequences default to force-page-count=auto. This forces a sequence to have an even number of pages if the following sequence wants to start on an odd page. If it needs to insert a blank page to cause this, it will. To stop this, set force-page-count=no-force on your page sequences. Just had to do this myself for the first time about an hour ago. Timely, huh? Patrick Rusk P.S. I don't know that this has necessarily changed at all since 0.20.4. It's worked that way in the latest CVS source for at least three months, as long as I've been using FOP. -Original Message- From: Chris McCann [mailto:[EMAIL PROTECTED] Sent: Friday, January 24, 2003 2:09 PM To: [EMAIL PROTECTED] Subject: extra page breaks inserted Hello all, I'm getting weird behavior in fop 0.20.5rc that didn't happen in 0.20.4. What I've got is multiple page-sequences in a .fo file with page numbering being reset in between. In .20.5rc I get extra blank pages inserted in between page sequences. In .20.4 it worked as I expected no black pages. Anybody got any ideas in what it happening? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]