Re: Output to PDF using FOPServlet
See the FAQ! http://www.owal.co.uk:8090/asf/servlet/asf/screen/DisplayQuestionAnswer/action/SetAll/project_id/18/faq_id/276/topic_id/495/question_id/805 On Thu, 20 Dec 2001 18:20:50 -0800 Lakshmi Anantharaman wrote: Just got a download of FOP . Nothing has ever worked for me in a dya amazing I got throu the set up all command line fop worked very well . I test the FOP servlet and running it I get the following logged ! ERROR 10089 [fop ] (): ERROR 10089 [fop ] (): ERROR 10089 [fop ] (): ERROR 10089 [fop ] (): My PDF output was very vague to ( Not sure whether it relates to this error ) %PDF-1.3 %ª«¬ 4 0 obj /Type /Info /Producer (null) endobj 5 0 obj /Length 1719 /Filter /FlateDecode stream xoeYßoÛ6~÷_!`K?ÖoÉy'6ÁV¤M×X?y´EÅJeQ%¥8Ù_?Ê'Ì;Yt`D9Ý}w÷ÝGöj¹zO~Ll˶ ËÖ$²I?VäÆ$°}Ëøzuî$ ,Á¬tòûäj(tm)Þ8-[ótâXê_kZIèY'=#úmcýuvs÷õâÚ-ÅĶÎ. ý|W²âüz×bÅôË?û[½¸ábC«S ýS?^|cEÂDóóßÖür)[EMAIL PROTECTED] l}º\¼kOEvcä5ô*úY¹þ 4í¶Ñb³nH\븥jÍôbËEzü ~M3! ¥È °L!í«DdϬÐëå«~îD{³âQ¿ãË'¶ª$Ño~3ÄOõã'ú VñºÜ¿è¸±û´èÙæÙÓÖ¯ mÁh2þA³çÀ-`Ö®2öEURÃÖ¢YÉ`¼EÅG øúñÎWõ?mÞ¤t f`6#qÁ©a¼×Ë...(tm)eÐUCA5 æS^ (OEÏ·? é73^We ÞÀªB?îoçzÅSǬ0A?S4:(òì;ðù ~à ´hN ØzðG#4%*'%ãPmØ? ÊxÁ}¼û [EMAIL PROTECTED]|ت.ßuêè¶ :yJ*ªq?.KºZ3ÈC¨BJÁ2 V|¿Xó +é£!Øw: ;ó¦ÊfdÂZWUy1¾lrBwî.-§)/OaüÀ?^Ó1þ,©|[äoe¨+w.çz_M·}g#4rZ1?x-g¨z(tm) This is the readMe.fo file that came with the distribution ! Thanks and Regards Lakshmi Cheers, Jeremias Märki mailto:[EMAIL PROTECTED] OUTLINE AG Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern Fon +41 (41) 317 2020 - Fax +41 (41) 317 2029 Internet http://www.outline.ch
Re: Why used FOP instead of...
FOP does almost all we need. What's missing can be added, since it's OpenSource, right? We're currently working on a project for an insurance company where Compuset is used and is to be replaced by an XML/XSLT/XSL:FO-based approach. One of the reasons for this decision was using freely available standards like XML, XSLT, XSL:FO etc. What you currently get when you're using proprietary software is a beautiful WYSIWYG editor. OK, that's missing for XSLT/XSL:FO but that doesn't matter too much where our project are targeted. FOA, XSLFast etc. are a good start but not yet really useful IMO. Another thing we're doing is provide high-volume printing services, and one of our outsourcing customers is using Jetform with the result that we had to write code that patches the PostScript-Files delivered so we could really use them. And that's just one of many problem they had in that project. Well, there's more to tell, but I got to work... I would like to know why FOP enthousiast (I am one) are using FO rather than products such as Crystal Reports or other such software (anyone Jetfoms ?). Just for the fun of playing with new technology ? Thanks for any hints (in private since this is off-topic) Cheers, Jeremias Märki mailto:[EMAIL PROTECTED] OUTLINE AG Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern Fon +41 (41) 317 2020 - Fax +41 (41) 317 2029 Internet http://www.outline.ch
Re: Why used FOP instead of...
Interesting, I also have experience in Compuset. Do you known Mr. Bulman ? I personally don't have any experience with Compuset. Sorry. Are you happy with FO's speed ? No. But that doesn't matter so much at the moment, because we will start small and have designed our solution to be scalable (CPU power doesn't cost much). I expect the redesign to improve performance and we're determined to contribute some more work to FOP this year when we get air to breathe again (well, maybe not too much in the performance part, I guess). So do I understand that Jetform does not produce clean PS ? Isn't it easier to use as FO (I do nor really know Jetform) ? Is it expensive ? No DSC, at least. And the paper bin code is made for an HP laser printer, not for a Xerox 4635. Jetform's support seems to be quite bad, too, from what I've heard. Don't know about the price, though. Again, no experience in that field. The customer uses Jetform, not us. Cheers, Jeremias Märki mailto:[EMAIL PROTECTED] OUTLINE AG Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern Fon +41 (41) 317 2020 - Fax +41 (41) 317 2029 Internet http://www.outline.ch
Re: ClassDefNotFoundError
When I try to transfrom a fo file to a pdf file, I get the following error: Exception in thread main java.lang.NoClassDefFoundError: org/apache/batik/dom/svg/SVGContext at org.apache.fop.svg.SVGElementMapping.addToBuilder(SVGElementMapping.java:21) at org.apache.fop.apps.Driver.addElementMapping(Driver.java:373) at org.apache.fop.apps.Driver.addElementMapping(Driver.java:384) at org.apache.fop.apps.Driver.setupDefaultMappings(Driver.java:253) at org.apache.fop.apps.Driver.init(Driver.java:189) at org.apache.fop.apps.CommandLineStarter.run(CommandLineStarter.java:55) at org.apache.fop.apps.Fop.main(Fop.java:19) I checked all the jar files included in the release and they're all in their proper directories. Can anybody help? But obviously there is a problem with batik.jar. Check your classpath again. Good luck. Cheers, Jeremias Märki mailto:[EMAIL PROTECTED] OUTLINE AG Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern Fon +41 41 317 20 20 - Fax +41 41 317 20 29 Internet http://www.outline.ch
Re: sax conflicts with tomcat-4.0.2-LE-jdk1.4
On 11.02.2002 17:32:49 Bart Locanthi wrote: for OutputStreams when all JSP will give you are Writers.. JSP is bad for your mental health anyway :-) uh oh, you got me started... i rather like JSP (in principle) and the idea of developing tags for use by UI and layout people. fop fo={layout}.foxslt xsl={book}.xslbook ...//xslt/fop can even be a true pipeline with a little tomcat hacking to avoid those stupid BodyContent things. looking at the code generated by a JSP compiler does give my stomach a turn, and the Writer/OutputStream problem rears its ugly head with Fop. i can see why Fop doesn't deal with Writers - all of the Image serialization things i've seen use OutputStreams exclusively. Well, PDF for example is basically a binary format. And binary formats don't go well with Writers. That's a short story. plus, sun appears to finally be making a push in jdk1.4 to make byte streams go fast. no idea what this will do to JSP. but without Fop able to use Writers the above pipeline is going to have a byte-char-byte thing going on, just waiting for a unicode/buffer-alignment bug to pop up a year from now. JSP is nice but use a Servlet in this case and save your nerves. You'll live longer that way. Sorry, I couldn't hold back on this one. :-) Cheers, Jeremias Märki mailto:[EMAIL PROTECTED] OUTLINE AG Postfach 3954 - Rhynauerstr. 15 - 6002 Luzern Fon +41 (0)41 317 2020 - Fax +41 (0)41 317 2029 Internet http://www.outline.ch
Re: merging FO to get a single PDF
Can FOP be used to merge 2 FO files into one PDF? No, but you can use XSLT to merge the two FO files to a single one. Cheers, Jeremias Märki mailto:[EMAIL PROTECTED] OUTLINE AG Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern Fon +41 41 317 20 20 - Fax +41 41 317 20 29 Internet http://www.outline.ch
Re: Graphics in pdf
I think Josh's suggestion is the right one. Here are some relevant pointers to the archive: http://marc.theaimsgroup.com/?l=fop-devm=101100884011907w=2 http://marc.theaimsgroup.com/?t=10044527565r=1w=2 I want to put an eps-graphic into a pdf-file. I havn't found how I could do this. But maybe there is another method to put a high resolution graphic which looks good in a pdf-printout into a pdf document. Cheers, Jeremias Märki mailto:[EMAIL PROTECTED] OUTLINE AG Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern Fon +41 41 317 20 20 - Fax +41 41 317 20 29 Internet http://www.outline.ch
Re: need version changes: FOP-18 to 20
I'm not so sure you really need to use an older version of FOP. The changes in the spec were few. Why not try to come up with an XSLT stylesheet to convert the old format into the new one and use the current version if you can't update your other stylesheets. That would be relatively simple and should not cost a lot of processing power when used with piped-through SAX. The change list you want is probably the one of the XSL:FO spec, not FOP's. But I'm curious: Why does your project require you to use version 0.18? By the way, there's a splendid CHANGES file in the root directory of the project. On 19.02.2002 17:58:39 syunt wrote: Hello all, I'm an XSL newbie and recently created several xsl files to generate PDFs using FOP-0.20.1. After learning enough XSL to get my reports looking as I wanted, I found that my project required using FOP version 18 instead. I've tried re-creating my PDFs using the older fop.jar, but some of the XSL tags don't seem to work. I've browsed the site and CVS change log but am unable to find a comprehensive feature list to compare between versions. Is there such a list or other place I can figure this out? BTW: I think FOP is an amazing tool, I just wish there was a bit more docs concerning version changes - this would help with recommendations to project managers. Cheers, Jeremias Märki mailto:[EMAIL PROTECTED] OUTLINE AG Postfach 3954 - Rhynauerstr. 15 - 6002 Luzern Fon +41 (0)41 317 2020 - Fax +41 (0)41 317 2029 Internet http://www.outline.ch
Re: SVG-rendered text looks crude with FOP 0.20.3rc; looked fine with 0.15.0
1. How do I configure this when using FOP with Cocoon2? After all, FOP just comes as a JAR file with Cocoon. I did unjar fop-0.20.3rc.jar, added the 'strokeSVG' entry to conf/userconfig.xml and re-jarred it. However, the change does not take effect. It seems I have to implicitely tell FOP to use userrconfig.xml. How do I do that when FOP is invoked by Cocoon? (Is this perhaps more of a question for the cocoon-users list?) This may help you (we had that a few days ago): http://marc.theaimsgroup.com/?l=fop-devm=101379793919354w=2 Cheers, Jeremias Märki mailto:[EMAIL PROTECTED] OUTLINE AG Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern Fon +41 41 317 20 20 - Fax +41 41 317 20 29 Internet http://www.outline.ch
Re: Adobe Type 1 Multiple Master fonts
No, I don't think so. The Multiple Master Font Extensions have not been implemented, yet. Hmm. I have to assume PDF is capable of carrying both the PFB and the MMM; So let me guess: assuming the weight-axis data is in the MMM file, FOP needs to revise it's PFMReader to extrapolate metrics for boldness based on other PFMs and the MMM file, and it needs to revise its method for embedding fonts to be able to include both PFB and MMM data? I dunno, it's very late my time, so forgive me if I'm way off the mark. :) You're on the right way! If you really want to dive into it, here are some pointers: Font specs from Adobe: http://partners.adobe.com/asn/developer/technotes/fonts.html Multiple Master Font Extensions are described in: http://partners.adobe.com/asn/developer/pdfs/tn/5015.Type1_Supp.pdf I wonder how hard that would be to do... I'm not sure. I haven't looked at Multiple Master, yet. Good luck. Cheers, Jeremias Märki mailto:[EMAIL PROTECTED] OUTLINE AG Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern Fon +41 41 317 20 20 - Fax +41 41 317 20 29 Internet http://www.outline.ch
Re: Options
I saw the code pieces on the metioned website but I did not understand ist: Having the driver-object defined in the first box on the site and the option -object from the third box, how can I plug the option to the driver? Well, the documentation might be misleading. You don't have to plug in anything, because new Options... uses static stuff in the background. So, just do new Options somewhere before your call to FOP and it should work. Cheers, Jeremias Märki mailto:[EMAIL PROTECTED] OUTLINE AG Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern Fon +41 41 317 20 20 - Fax +41 41 317 20 29 Internet http://www.outline.ch
Re: newbie in town
'master-reference' for 'fo:page-sequence' matches no 'simple-page-master' or 'page-sequence-master' You have to change some of the master-name attributes to master-reference to be conformant with the XSL REC. fo:conditional-page-master-reference master-name=main odd-or-even=any/ fo:conditional-page-master-reference master-reference=main odd-or-even=any/ fo:page-sequence master-reference=standard Cheers, Jeremias Märki mailto:[EMAIL PROTECTED] OUTLINE AG Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern Fon +41 41 317 20 20 - Fax +41 41 317 20 29 Internet http://www.outline.ch
Re: Have anyone used FOA tool
I am having problem with bringing up the main window Formatting Object Authoring Tool window. All the other windows come up ok. That's probably the wrong spot to ask. http://foa.sourceforge.net/ Cheers, Jeremias Märki mailto:[EMAIL PROTECTED] OUTLINE AG Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern Fon +41 41 317 20 20 - Fax +41 41 317 20 29 Internet http://www.outline.ch
Re: FOPException / Quiet Mode / error compliing servlets
Thanks Jay and Jeremias for your help. I need to convince people from work that FOP is our PDF solution. However, without a good scalability test result (100% job completion rate), I am having trouble doing so. I truely believe that one of the main reason for out of memory error is because FOP is running in debug mode, where you see every page gets generated (ex: page 1,2 [1][2]). Most of the memory is used by java to write debug information such as pages complete, initial and final heap size.. etc on to window's console. If I can turn this off and run FOP in quiet mode, I am guessing the performance would increase by at least 30% and scability will also improve. Jeremias, you sugguest to me to change edit the logger (http://xml.apache.org/fop/embedding.html). how do I edit the code? Do I need to get Avalon? Using a text editor. :-) Seriously, I guess you're using the fop.war in docs/examples/embedding, right? The source code is in FopServlet.java. Unfortunately, the WAR file is not built with the build script, so you have to manually build the WAR file after adjusting the code. Actually, it's not even necessary to build the WAR. It is sufficient to compile FopServlet.java (you need to get servlet.jar from your web container to do that) and place it (along with a web.xml file) in the right places. And you don't need to get Avalon, since the necessary jars are in the lib directory of FOP's distribution. Jay, you mentioned that I might have to edit the FOP source code. Do you know which java file I should edit so I can turn off the log screen? Also, I am having trouble compling servlets. Following is the error message, can you tell me where I can get the SAX servlet package? SAX has nothing to do with servlets. The SAX stuff is in xerces.jar. You can get the servlet.jar from your web container or from here: http://java.sun.com/products/servlet/ To turn of logging you can also try to call MessageHandler.setOutputMethod(MessageHandler.NONE); Cheers, Jeremias Märki mailto:[EMAIL PROTECTED] OUTLINE AG Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern Tel. +41 41 317 2020 - Fax +41 41 317 2029 Internet http://www.outline.ch
Re: XML-tag in dom.text-node - how to do?
This is not really the place to ask general XML/DOM questions but here's what you're probably doing wrong: I presume you add the PAGE/ as part of a text node. That way some of the character get escaped like to lt;. To get around that you need to split up your text node into different nodes. An example: variable text bla bla PAGE/ variable text has to be expressed in a DOM as text node: variable text bla bla element node: PAGE text node: variable text That way, the special character don't get escaped. I hope this helps. I'm new in programming with xml, xsl, xsl:fo and i have (not but) one problem: I'm generating a xml-file with dom-interface, this file shoud bei transformed via xsl into a xsl:fo file. I don't know, how to get xml-tags into the output-xml-file with dom. For example a variable footer-text with a page-number-tag inside: The fo-file shoud contain: ... fo:static-content flow-name=xsl-region-after fo:block variable text from xml fo:page-number/ variable text from xml /fo:block /fo:static-content ... The xsl contains: ... xsl:template match=FOOTER xsl:element name=fo:static-content xsl:attribute name=flow-namexsl-region-after/xsl:attribute xsl:element name=fo:block xsl:apply-templates/ /xsl:element /xsl:element /xsl:template xsl:template match=PAGE fo:page-number/ /xsl:template ... The xml shoud contain: ... FOOTER variable text bla bla PAGE/ variable text /FOOTER ... BUT it contains: ... FOOTER variable text bla bla lt;PAGE/ variable text /FOOTER ... How can i get the PAGE-tag into a dom.text-node? Cheers, Jeremias Märki mailto:[EMAIL PROTECTED] OUTLINE AG Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern Tel. +41 41 317 2020 - Fax +41 41 317 2029 Internet http://www.outline.ch
Re: dynamic image in PDF
This happens because you used master-reference instead of master-name on fo:simple-page-master. I have been trying to create a pdf using FOP. This is the exception I get.. Any thoughts. Attached is the FO file being used... Cheers, Jeremias Märki mailto:[EMAIL PROTECTED] OUTLINE AG Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern Tel. +41 41 317 2020 - Fax +41 41 317 2029 Internet http://www.outline.ch
Re: dynamic image in PDF
Also, refer to the page master using the master-name attribute. No, not anymore. That was the old syntax. Cheers, Jeremias Märki mailto:[EMAIL PROTECTED] OUTLINE AG Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern Tel. +41 41 317 2020 - Fax +41 41 317 2029 Internet http://www.outline.ch
Re: XML to AFP
A small group at UBS has once worked on an AFP renderer for FOP but the project got halted as far as I know and they didn't want to publish the code they've done. So, a way to go (even if it's not a simple one right now) would be to write an AFP renderer for FOP. You could also ask IBM what they have done in the PPML (http://www.podi.org/standards/ppml) corner. Maybe there's a possibility. I'm looking for a way to produce AFP (IBM's Advanced Function Presentation) file from XML. I know that there is commercial products like DI Pager. I also can produce PDF or PostScript file and then convert it to AFP format. But may be somebody knows a simpler way. Cheers, Jeremias Märki mailto:[EMAIL PROTECTED] OUTLINE AG Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern Tel. +41 41 317 2020 - Fax +41 41 317 2029 Internet http://www.outline.ch
Re: Page Layout
You can try to work with the number-columns-spanned attribute on table-cell. On 14.03.2002 17:57:23 Balaji Loganathan wrote: Hi, I'm trying to design a Paper document using XSL:FO,PDF so that I can retrive and put the data from XML into PDF as if like filling Paper document in hand. Please see the attachment. I would to create a PDF with 210x 297mm as page width and height,and table's in it with different height and width(later i will put data in it). Please tell me how to create a table with specified height and width,so that I can put tables inside table and build a page like the attachment shown. Really getting mad,I guess i need more lateral thinking. Cheers, Jeremias Märki mailto:[EMAIL PROTECTED] OUTLINE AG Postfach 3954 - Rhynauerstr. 15 - 6002 Luzern Fon +41 (0)41 317 2020 - Fax +41 (0)41 317 2029 Internet http://www.outline.ch
Re: insert a PDF file into another PDF
http://www.etymon.com/pj/ may help you. FOP can't do that for you. On 14.03.2002 19:28:46 Mathy V Arumugam wrote: I need to insert one PDF file into another PDF file, say, insert page 7 in another pdf file or insert page 7-12 into another. Cheers, Jeremias Märki mailto:[EMAIL PROTECTED] OUTLINE AG Postfach 3954 - Rhynauerstr. 15 - 6002 Luzern Fon +41 (0)41 317 2020 - Fax +41 (0)41 317 2029 Internet http://www.outline.ch
Re: Printing Problem,
Maybe you have Fit to page activated in Acrobat Reader. That may cause your page to be scaled and the margins may vary. Normally, PDF is portable between printers which does not mean that the same documents really looks exactly the same on each printer (resolution, font replacements etc). And another point: Keep in mind that a printer is something mechanical which has some tolerances. That may account for 2 or 3 mm, but probably not 6mm. On 15.03.2002 12:22:11 Balaji Loganathan wrote: Hi, Please look at the below program and especially margin settings of body and table. If I print this out in HP printer,Lexmark printer and if I measure the paper output with a Millimeter scale or ruler.The margins all sides seems to vary by plus or minus 2-6 mm with HP printer and Lexmark.Even if I compare my printer output with the original paper document in SUNLIGHT,its varying. If this is the case how can we assure that we can produce the exact Paper document with PDF using XSL:fo which is printer portable. ?? Is PDF is printer portable ? Please advice me where i'm going wrong. Jeremias Märki mailto:[EMAIL PROTECTED] OUTLINE AG Postfach 3954 - Rhynauerstr. 15 - 6002 Luzern Fon +41 (0)41 317 2020 - Fax +41 (0)41 317 2029 Internet http://www.outline.ch
Re: Printing Problem,
Well, a couple of times I almost went mad because I couldn't figure out why my lengths didn't come out like I wanted them. And that was because I had Fit to page enabled. Most problems I have with inaccurate positioning of text elements is when I have to print on preprinted forms. I usually solve this by having this part in an absolutely positioned block-container that I can shift in X and Y direction using variables in XSLT. Another approach we frequently take is to use the X/Y-shift functionality on the big Xerox DocuPrint/DocuTech printers. Of course, that doesn't apply to desktop printers. On 15.03.2002 14:45:36 Balaji Loganathan wrote: Dear Jeremias., Thanks again Jeremias,but my print options doesn't have something like Fit to page,and I also removed all the page print settings simillar to above. I printed the PDF with same printer now,its printing with different margin edges now,So i found the error is in feeding of paper (i'ts not manual feeding,i put bunch paper in tray). So i have to blame only the printer and not PDF or FOP. Did you faced some problem like this and how did you managed.?? Please comment. Cheers, Jeremias Märki mailto:[EMAIL PROTECTED] OUTLINE AG Postfach 3954 - Rhynauerstr. 15 - 6002 Luzern Fon +41 (0)41 317 2020 - Fax +41 (0)41 317 2029 Internet http://www.outline.ch
Re: how to avoid long strings exceeding table cell borders?
I am using FOP version 0.20.1 and have had a problem with long strings. When a word is longer than the page is wide, FOP is lending space from adjacent cells which is not wanted. I have tried using attribute hyphenate, but I noticed that hyphenation does not affect information fetched from a xml document using xsl xsl:value-of. Does anyone know, if any improvements affecting this are made in newer versions of FOP, or if there is any other way to solve the problem? Not at the moment. The overflow property normally controls this behaviour. The problem is that it's not implement at the moment. I need that, too. This is one of the problems I will need to solve within the next 4 weeks. Maybe you check back later if your time doesn't run out. It would be enough to cut long words at cell borders. Theoretically, you would do that using overflow=hidden. Cheers, Jeremias Märki mailto:[EMAIL PROTECTED] OUTLINE AG Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern Tel. +41 41 317 2020 - Fax +41 41 317 2029 Internet http://www.outline.ch
Re: AW: SV: PNG Images
I get an error creating FopImage object (file:to/image.png): org.apache.fop.image.JimiImage That's not the full error message, is it? Did you compile FOP while jimi.jar was available? The FOP build must tell you: Jimi library is present. Fop installs jimi support. I use fop 0.20.3 standalone (on win2k and java 1.4.0), with the old jimi-1.0.jar, which came with an older version of fop. and got no idea, what to do, except using jpeg instead. Cheers, Jeremias Märki mailto:[EMAIL PROTECTED] OUTLINE AG Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern Tel. +41 41 317 2020 - Fax +41 41 317 2029 Internet http://www.outline.ch
Re: Error: null
I constructed my first xsl document to render a pdf using a singletemplate. This worked fine. However the form was rather large so Idecided to split certain parts of it into separate templates and now I amgetting a null error. Please help I used fop -xml TIPS.xml -xsl TIPS.xsl -pdf TIPS.pdf and get C:\dev\homelet2002\dist\libjava -cpc:\fop-0.20.1\build\fop.jar;c:\fop-0.20.1\lib\batik.jar;c:\fop-0.20.1\lib\xalan.jar;c:\fop-0.20.1\l ib\xerces.jar;c:\fop-0.20.1\lib\jimi-1.0.jar org.apache.fop.apps.Fop -xmlTIPS.xml -xsl TIPS.xsl -pdf TIPS.pdf FOP 0.20.1 ERROR: null snip/ fo:page-sequence snip/ I think you forgot the master-reference attribute on fo:page-sequence. Cheers, Jeremias Märki mailto:[EMAIL PROTECTED] OUTLINE AG Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern Tel. +41 41 317 2020 - Fax +41 41 317 2029 Internet http://www.outline.ch
Re: Embedding Type I fonts
Yeah, you're using font-weight=lighter, but only normal (see your fonts element) is registered. On 26.03.2002 20:02:44 Levy, Alane wrote: I am having trouble getting FOP to recognize a Type I font (Helvetica-Light). I followed the instructions on the web page (http://xml.apache.org/fop/fonts.html) to generate the attached font metrics file from the hvl_.pfm file from Adobe. hvl_.xml I added the following element definition to the conf/userconfig.xml file inside the fonts element: font metrics-file=hvl_.xml kerning=yes font-triplet name=Helvetica-Light style=normal weight=normal/ /font I also tried the above with an absolute path to the metrics file, but it made no difference. When I run FOP with the following command line: fop -c c:\fop-0.20.3\conf\userconfig.xml sample_getting_started.fo sample_getting_started.pdf the following errors result: java -cp c:\fop-0.20.3\build\fop.jar;c:\fop-0.20.3\lib\batik.jar;c:\fop-0.20.3\lib\xa lan-2.0.0.jar;c:\fop-0.20 .3\lib\xerces-1.2.3.jar;c:\fop-0.20.3\lib\avalon-framework-4.0.jar;c:\fop-0. 20.3 \lib\logkit-1.0.jar;c:\fop-0.20.3\lib\jimi-1.0.jar org.apache.fop.apps.Fop -c c: \fop-0.20.3\conf\userconfig.xml sample_getting_started.fo sample_getting_started .pdf [INFO]: FOP 0.20.3 [INFO]: building formatting object tree [INFO]: [1] [ERROR]: defaulted font to any,normal,normal [ERROR]: unknown font Helvetica-Light,normal,lighter so defaulted font to any [ERROR]: defaulted font to any,normal,normal [ERROR]: unknown font Helvetica-Light,normal,lighter so defaulted font to any [ERROR]: defaulted font to any,normal,normal [ERROR]: unknown font Helvetica-Light,normal,lighter so defaulted font to any [ERROR]: defaulted font to any,normal,normal [ERROR]: unknown font Helvetica-Light,normal,lighter so defaulted font to any [ERROR]: defaulted font to any,normal,normal [ERROR]: unknown font Helvetica-Light,normal,lighter so defaulted font to any [ERROR]: defaulted font to any,normal,normal [ERROR]: unknown font Helvetica-Light,normal,lighter so defaulted font to any [ERROR]: defaulted font to any,normal,normal [ERROR]: unknown font Helvetica-Light,normal,lighter so defaulted font to any [ERROR]: defaulted font to any,normal,normal [ERROR]: unknown font Helvetica-Light,normal,lighter so defaulted font to any [INFO]: Parsing of document complete, stopping renderer Am I doing something wrong or is this not supported? Cheers, Jeremias Märki mailto:[EMAIL PROTECTED] OUTLINE AG Postfach 3954 - Rhynauerstr. 15 - 6002 Luzern Fon +41 41 317 2020 - Fax +41 41 317 2029 Internet http://www.outline.ch
Re: Help! Problem with Fop in Tomcat
Hello Marina That's weird. It should never be necessary to unjar these jar to make them work. Looking a bit closer at your case I have a few comments: - You seem to edit Tomcat's classpath to include all jars you need. It's better if you placed all jars needed by your SOAP service in the WEB-INF/lib directory. That way they are packed together with your webapp/soap-service and loaded automatically without adjusting Tomcat's classpath. The jars I'd put there, are: avalon-framework, logkit, fop, batik, soap, mail and activation. xerces is needed by Tomcat and I've had troubles putting xalan.jar in WEB-INF/lib because of the way JAXP works, so leave them there. - In you last mail you mentioned a batik-1.1.1.jar. If I'm right FOP needs a specially built batik.jar (included in the distribution), so you might run into problems if you use an official release. Keiron, please correct me if I'm wrong. - I've done similar stuff to what you're doing, and I could do without any special work-arounds. On Windows and Linux. - Think about making a WAR file from your web service. That way, it's much simpler to deploy. Without manual classpath surgery. - I propose you install a fresh Tomcat to another location and start over with the hints I gave you. It may well work what you've done, but it's a hell to maintain. - I guess you're using Tomcat 3.x. Try 4.0.x. I like it a lot better. - Maybe have a look at the current CVS version of FOP. In the contrib directory, there's the sources of the FopServlet. The build creates a WAR file. It's quite similar to what you're doing. Apache SOAP is a servlet, too, right? Good luck! On 12.04.2002 15:13:24 Marina Pérel wrote: Hello Jeremias, Thanks for your help, but I finally found the problem : you must unjar the avalon-framework-4.1.2's jar and the batik-1.1.1's jar. I take a lot of time to find that because there isn't this information in fop's doc or in mailing list. It's curious, no? You don't have to unjar the avalon-framework-4.1.1'sjar. Greetings Marina - Original Message - From: Jeremias Maerki [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, April 11, 2002 12:07 PM Subject: Re: Help! Problem with Fop in Tomcat I developped a Fop service via a service web (with Apache SOAP) in Windows Nt : it works good. But, now i'm trying to set the Fop Service in Linux machine (RedHat7.2). I have this error : Genarated fault : Fault Code = SOAP-ENV:Server Fault String = Exception from service object : org/apache/avalon/framework/loggable/Loggable That should be org/apache/avalon/framework/logger/Loggable. Did you write that by hand or using copy/paste? Loggable is in avalon-framework(-4.1.2).jar. A Hello's service works, so my web service is fine and it's a Fop problem. My Tomcat's classpath is : /tools/beluga/SOAP/xerces-1_2_3/xerces.jar:/tools/beluga/SOAP/jakarta-tomcat -4.0.3/lib/xalan.jar:/tools/beluga/SOAP/jakarta-tomcat-4.0.3/lib/avalon-fram ework-4.1.2.jar:/tools/beluga/SOAP/jakarta-tomcat-4.0.3/lib/logkit-1.0.1.jar :/tools/beluga/SOAP/jakarta-tomcat-4.0.3/lib/batik.jar:/tools/beluga/SOAP/ja karta-tomcat-4.0.3/lib/fop.jar:/tools/beluga/SOAP/soap-2_2/lib/soap.jar:/too ls/beluga/SOAP/javamail-1.2/mail.jar:/tools/beluga/SOAP/jaf-1.0.1/activation .jar:.:/tools/beluga/SOAP/jakarta-tomcat-4.0.3/webapps/soap/WEB-INF/classes/ :/usr/java/j2sdk1.4.0/lib/tools.jar:/tools/beluga/SOAP/jakarta-tomcat-4.0.3/ bin/bootstrap.jar (my .jar files are in the Tomcat lib directory) My code for the logger : Logger log = null; if(log == null) { Hierarchy hierarchy = Hierarchy.getDefaultHierarchy(); log = hierarchy.getLoggerFor(fop); log.setPriority(Priority.WARN); } driver.setLogger(log); Does anybody know what's wrong? All ideas are welcome! Avalon Framework and LogKit seem to be present in Tomcat's classpath. So nothing wrong here. Did you check that the files with the names specified in the classpath really exist? Anyway, FOP was recently changed to use org.apache.avalon.framework.logger.Logger (Avalon Logger Interface) instead of org.apache.log.Logger (LogKit). Loggable is used with LogKit. It has been deprecated in favor of org.apache.avalon.framework.logger.LogEnabled (which uses the Avalon Logger Interface). Maybe that helps finding a solution. Cheers, Jeremias Märki mailto:[EMAIL PROTECTED] OUTLINE AG Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern Tel. +41 41 317 2020 - Fax +41 41 317 2029 Internet http://www.outline.ch Cheers, Jeremias Märki mailto:[EMAIL PROTECTED] OUTLINE AG Postfach 3954 - Rhynauerstr. 15 - 6002 Luzern Fon +41 41 317 2020 - Fax +41 41 317 2029 Internet http://www.outline.ch
Re: PDF include
No, but you can use some PDF touch-up tool like iText or PJ to merge in selected pages from a seprate PDF into your generated PDF. Quite a few people do this. Is it possible to include a external PDF File into the fo File? Like 'include' in PHP or other Languages? Cheers, Jeremias Märki mailto:[EMAIL PROTECTED] OUTLINE AG Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern Tel. +41 41 317 2020 - Fax +41 41 317 2029 Internet http://www.outline.ch
Re: Omitting content length
There was a recent post on chunked transfer. I haven't checked it out, but it might help you. http://marc.theaimsgroup.com/?l=fop-devm=101791907122593w=2 Cheers, Jeremias Märki mailto:[EMAIL PROTECTED] OUTLINE AG Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern Tel. +41 41 317 2020 - Fax +41 41 317 2029 Internet http://www.outline.ch
Re: size of pdf
There's currently no such option AFAIK. I've got the same problem, although I don't have such big graphics. This will eventually be improved. Work-around: If you include this header graphic on every page in your document you could skip it entirely in the FO file and create an overlay page as a PDF with only the ever repeating stuff. Then you have to use some PDF touch-up tool to include the overlay page in the target PDF and apply the overlay on every page. Another toolset I forgot to mention yesterday: http://www.pdf-tools.com I createt a 3 page PDF with a FO file. On every Page is a Header and a Footer SVG grafic.I used a page-sequence-master for the body text and I made one before and after code block like this: !-- before region -- fo:static-content flow-name=xsl-region-before !-- the header grafic -- fo:block-container height=4cm width=21cm top=0cm left=0cm position=absolute fo:block space-before.minimum=0cm space-before.optimum=0cm space-before.maximum=0cm fo:external-graphic src={file:images/head.svg}//fo:block /fo:block-container !-- Title -- /fo:static-content My Problem is, that these SVG Grafics have a very big size, so my PDF File increases his size extremly whit every new page. Its always the same svg grafic! Is there a option or something else to include this picture just one time in the pdf and always make a reference on the pic when it use it?? Cheers, Jeremias Märki mailto:[EMAIL PROTECTED] OUTLINE AG Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern Tel. +41 41 317 2020 - Fax +41 41 317 2029 Internet http://www.outline.ch
Re: Several questions about FOP
i've got several questions about PDF generation with FOP. We want to use a open-source implementation of XSL-FO in our project, but stumbled across several open topics. Perhaps you can help us with these: 1) Can one use FOP on a host-environment, ie. IBM mainframe computers, or does EBCDIC somehow cause problems See Alex's comment. Search the mail archives for info. 2) Can one use font A, even is font A is _not_ installed on a client? Is this done automatically when rendering the PDF, or do I have to include additional fonts somehow in the PDF? You can use font embedding. It's documented on the FOP website. 3) Is linearilazation possible, ie. displaying the first page while loading the rest? In Acrobat Reader, this can be queried in the File- Document Info-General-Optimized = true|false Not with FOP, I think. Linearization requires all PDF objects to be in the right order within the PDF. FOP can't don that, yet. You need to postprocess a PDF if you want that. 4) How well does FOP perform in comparision to other XSL-FO implementations? See Alex's comment. Cheers, Jeremias Märki mailto:[EMAIL PROTECTED] OUTLINE AG Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern Tel. +41 41 317 2020 - Fax +41 41 317 2029 Internet http://www.outline.ch
Transformation matrix wrong in PDF for some SVG files
Hi Foppers For once, I'm here with a problem. It's driving me crazy (probably because I'm not so good at math). I've got a few SVG files that work without problems and I've got a few that FOP 0.20.3cvs (14.2.2002) and FOP 0.20.4cvs (today) won't handle. I've identified the problem spot but haven't been able to find a fix, yet. Acrobat 5 will show the error message Wrong operand type because the second transformation matrix written by PDFRenderer.renderSVGDocument() is 0 0 0 0 0 0 cm instead of x 0 0 x 0 0 cm (where x 0). Here's the except from the PDF: snip/ q q 28.346 811.343 m 212.346 811.343 l 212.346 559.343 l 28.346 559.343 l h W n 1.0 0 0 -1.0 28.346 811.343 cm 0 0 0 0 0 0 cm q 0 0 m 6500 0 l 6500 8900 l 0 8900 l 0 0 l h W n 0 g 0 G 2607 4214 m 2367 4225 l 2136 4259 l 1909 4314 l 1687 4390 l 1467 4485 l snip what=more PDF/ I have attached a small FO file and an external SVG file describing a male sign. male.svg alone renders fine in Adobe SVG Plugin, CorelDraw and Batik v1.1 Browser. If I exchange the male.svg by boxes.svg from docs/examples/svg, everything works as expected. Thanks in advance for any help! Cheers, Jeremias Märki mailto:[EMAIL PROTECTED] OUTLINE AG Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern Tel. +41 41 317 2020 - Fax +41 41 317 2029 Internet http://www.outline.ch attachment: male.zip
Re: background-image and uri
Are background-images implemented in Fop 0.20.3 ? Not yet. I get a message telling me no such function as url but no message telling me background-image not implemented... How can I specify the uri of the image otherwise ? You can try to work with a block-container. I think I remember a few posts on the mailing lists. Try searching in the mailing list archives. Cheers, Jeremias Märki mailto:[EMAIL PROTECTED] OUTLINE AG Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern Tel. +41 41 317 2020 - Fax +41 41 317 2029 Internet http://www.outline.ch
Re: Transformation matrix wrong in PDF for some SVG files
I can't see what the problem is but I can give you some hints. I would suggest testing the svg rendering using the transcoder through batik, so it converts the svg directly to pdf. This works with the cvs trunk also but be aware that there are some differences. I'll try that. I suspect the problem is due to the numbers being used in the svg file. The viewport and path numbers are large and the size is relatively small. I think it is trying to scale the svg and the numbers are getting truncated/rounded to zero. I guess you're right. I've had a closer look at the AffineTransform object that it returned by the ViewBox class. It had very small values (0.028307 and the like) which were rounded to zero by PDFNumber (strange rounding code in there anyway). I'll investigate some more. Thanks a lot for the tips! Cheers, Jeremias Märki mailto:[EMAIL PROTECTED] OUTLINE AG Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern Tel. +41 41 317 2020 - Fax +41 41 317 2029 Internet http://www.outline.ch
Re: euro-sign not working
We're talking Unicode here, not Windows Encoding. Try #x20AC; This works in doc/examples/fo/fonts.fo. I guess this must be a no-brainer for at least somebody. I even got embedded thai-letters rendered to pdf, but cannot get a single euro sign to appear. I inconporated any ttf-font showing the sign, I can think of, but to no avail. Is using #x80; promising at all? Or do I have to embed SVG or even GIF? Cheers, Jeremias Märki mailto:[EMAIL PROTECTED] OUTLINE AG Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern Tel. +41 41 317 2020 - Fax +41 41 317 2029 Internet http://www.outline.ch
Re: In what file is the number of FOP's version ?
It's in conf/config.xml. The version number is inserted during the build process and originally comes from build.xml. In what file is the number of FOP's version? Because by copying FOP to another server and performer (version 0.20.3), FOP shows me 0.20.1 Cheers, Jeremias Märki mailto:[EMAIL PROTECTED] OUTLINE AG Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern Tel. +41 41 317 2020 - Fax +41 41 317 2029 Internet http://www.outline.ch
Re: Refactoring / Rewriting of FOP? Obsolete?
My manager just nixed the use of FOP in our project for the following reason. a) Its only up to 0.20.3 meaning an early beta. That doesn't mean too much. A lot of poeple are using FOP in a production environment. True, you may have to work around one or another problem, but FOP is useful enough. b) He is under the understanding partly based on what he saw on the FOP site that the code is being rewritten from scratch and he therefore does not want to have us tied to an obsolete product. It's correct that FOP is in redesign. But that doesn't mean it's completely rewritten from scratch. I believe that the API will likely stay pretty much the same, and the API really is what should concern you, because that's what you'll work with. FOP should work as a black box for you, so if something changes under the hood, all you have to do is test your stylesheets when you do an update. My question is a) How true is this? b) How can I convince him that it is worthwhile to use it. The product did work nicely in our testing by the way. Cheers, Jeremias Märki mailto:[EMAIL PROTECTED] OUTLINE AG Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern Tel. +41 41 317 2020 - Fax +41 41 317 2029 Internet http://www.outline.ch
Re: problem with path relative - HELP ME
So, it looks like baseDir is set correctly. The error happens because FOP can't load the image from where specified. Try the URL http://localhost:8080/portalrentas/fop/xslfo/escudo-200.jpg in your browser to see if the image is really there. If not, find out what you have to specify so the images can be found. I look distinct examples on Fop configuration. I have a problem with path relative by image. My code in servlet embeded is String baseDirPath = http://localhost:8080/portalrentas/;; org.apache.fop.configuration.Configuration.put(baseDir, baseDirPath); but, I have a problem This, show me the next error: [ERROR]: Error while creating area : Error while recovering Image Informations (http://localhost:8080/portalrentas/fop/xslfo/escudo-200.jpg) : http://localhost:8080/portalrentas/fop/xslfo/escudo-200.jpg I don't understand. What's the error? Why's ocurrs this errors? My code into xslfo is fo:external-graphic src=fop/xslfo/escudo-200.jpg/ Cheers, Jeremias Märki mailto:[EMAIL PROTECTED] OUTLINE AG Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern Tel. +41 41 317 2020 - Fax +41 41 317 2029 Internet http://www.outline.ch
Re: Fopping and batch printing
(comments inline) On 22.04.2002 14:29:04 Wayne Elliott wrote: Howdy Anyone know of the best way to batch FOP generated PDF documents for printing. In our scenario documents are queued for generation, followed by printing, using threads. We print from both a Windows 2000 GUI application and Unix server, by spawning a shell command through Runtime.exec. The commands we use are along the lines of (I'm not at work Win/Dos: c:/Program Files/Adobe/Acrobat 5.0/Reader/AcroRd32.exe + /t + file + + printerName + + driverName + + portName Unix: cat blah.pdf | acroread -toPostScript | lpr The trouble we are having is tracking the print job and knowing when to kill it. In the Dos version we can't get no exit status. In fact we currently count to 10 then kill the process. I think using Acrobat Reader to launch a print job is loony tunes, but am struggling to find a better way. Does anyone know of a better way, either to better control the shell command, or to fire PDF at a printer from Java. I gave up using Acrobat Reader on Windows except for displaying a PDF in a browser. I'd do all the printing via unix if that's possible. You might also get happy using GhostScript. Yet another possibility might be to use the AWT printing functionality of FOP. I don't use it but others do and it seems to work well. Also seeing some corruptiion of the margins in the Unix case. Any Unix gurus know if lpr or acroread need some flags to shrink the margin or set the page size. So many variables... I had that, too. You have to explicitly specify the page size using one of those command line options. Prob this is all slightly off topic. Not sure. Seems printing is a reasonable thing to do with a PDF so maybe we have all floundered a bit in this area. WPE When not Fopping, can be found floundering with style. Cheers, Jeremias Maerki
Re: Embedding FOP within Servlet
That's a classloader issue. I haven't investigated what exactly the problem is, but putting xalan.jar in common/lib or lib instead of WEB-INF/lib should do the trick. On 22.04.2002 16:29:16 Georg Daniel Vassilopulos wrote: Hello All, With the example embedding distributed with fop-0.20.3-src.tar.gz I got stuck. The PDF generation from a *.fo file works fine. But while generating a PDF out of a xml file and a xsl stylesheet I always get the exception: org.apache.fop.apps.FOPException: javax.xml.transform.Transformer at org.apache.fop.apps.XSLTInputHandler.getParser(XSLTInputHandler.java:107) at FopServlet.renderXML(FopServlet.java:118) at FopServlet.doGet(FopServlet.java:67) at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) I have following jar files in my tomcat/webapps/WEB_INF/lib directory and the logiles report that following jar file were found (yes I did put them there): ant.jar ant-1.3-optional.jar avalon-framework-4.0.jar batik.jar bsf.jar buildtools.jar fop.jar logkit-1.0.jar stylebook.jar xalan-2.0.0.jar xerces-1.2.3.jar I thougt the Transformer class ships with xalan-2.0.0.jar but anyway, I get the exception. Any help would be great. Thanks a lot... Georg Cheers, Jeremias Maerki
Re: Debugging FOP
There's obviously something going wrong in the XML parser. Here's a list of things that come to my mind: - Check if the standard FOP examples work correctly. If yes, there might be a problem with your fo file. - Open the fo in one or two XML editors to see if it gets parsed correctly. - Search the Internet for similar the same NPE. - Switch your XML parser (even if you just use another version of the same) - Get the source code of the XML parser and try to track down the cause of the exception using the line numbers in the stacktrace. - Try to set everything up in your IDE and set an exception breakpoint for java.lang.NullPointerException. I hope this helps. On 23.04.2002 06:41:23 Patrick Lanphier wrote: How does one debug this? Thank much for your help. [EMAIL PROTECTED] fop-0.20.3]# ./fop.sh -d -fo test.fo -pdf test.pdf [DEBUG]: Input mode: [DEBUG]: FO [DEBUG]: fo input file: test.fo [DEBUG]: Output mode: [DEBUG]: pdf [DEBUG]: output file: test.pdf [DEBUG]: OPTIONS [DEBUG]: no user configuration file is used [default] [DEBUG]: debug mode on [DEBUG]: dump configuration [DEBUG]: quiet mode on [DEBUG]: base directory: file:/tmp/fop-0.20.3/ [INFO]: FOP 0.20.3 [DEBUG]: using SAX parser org.apache.xerces.parsers.SAXParser [INFO]: building formatting object tree [DEBUG]: setting up fonts [ERROR]: null org.apache.fop.apps.FOPException at org.apache.fop.apps.Driver.render(Driver.java:486) at org.apache.fop.apps.CommandLineStarter.run(CommandLineStarter.java:72) at org.apache.fop.apps.Fop.main(Fop.java:19) - java.lang.NullPointerException at org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1193) at org.apache.fop.apps.Driver.render(Driver.java:481) at org.apache.fop.apps.CommandLineStarter.run(CommandLineStarter.java:72) at org.apache.fop.apps.Fop.main(Fop.java:19) Patrick Lanphier The Artemis Group http://www.artemisgroup.com phone: 814-235-0444 fax: 800-582-9710 Cheers, Jeremias Maerki
Re: Positioning of a table
That's an FAQ. Try to use blind tables (like many do it in HTML). You can easily embed a table in a table-cell. On 23.04.2002 08:13:36 terence.wong wrote: Hi, does anyone know how to position tables in the region-body? If I try to add a start-indent in the fo:table tag, the content of the cells shifts but not the table position. I saw examples using block-containers but that seem to require absolute positioning. I was thinking of something more like html where you can align a table by specifying an align attribute. Any examples of workable constructs would be appreciated. Regards, Terence Wong This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited. Cheers, Jeremias Maerki
Re: support for PS printer-specific options using PPDs
Being the one who wrote the PS renderer in the first place, I can comment on a few things: - The PS renderer, as it is now, is more of a proof of concept, than anything else. Some people are using it productively, though. - As you gathered, there are a few things that still need to be done. Here's the todo list from the PSRenderer's javadocs: Character size/spacing, configuration, move to PrintRenderer, maybe improve filters (I'm not very proud of them), add a RunLengthEncode filter (useful for Level 2 Postscript), Improve DocumentProcessColors stuff (probably needs to be configurable, then maybe add a color to grayscale conversion for bitmaps to make output smaller (See PCLRenderer), font embedding, support different character encodings, try to implement image transparency, positioning of images is wrong etc. And of course, there's the missing PPD functionality. - There's also another problem: XSL:FO does not provide any means to specify things like tray selection. These will have to be proprietary solutions. And that means some work as well. What's important here is to have mechanisms that can be reused for PCL later. - Conclusion: Any help is welcome! (Because I haven't got the time yet, to do it. At least, it's on my todo list, because we're currently working with the PDF renderer, then using Acrobat Reader to produce PostScript, which is finally patched with code for tray selection and OMR marks. And this is a suboptimal solution especially since the Acrobat Reader takes between 20 to 50 percent of processing time for a job.) On 25.04.2002 09:03:41 Nathan Carter wrote: I currently use PJ for PDF output from a homegrown customer/member management system, built on JBoss/Postgresql/etc. There are two basic uses for the PDF output: 1) letters that use standard fonts to produce a mail merged PDF form letter - starting with a blank PDF document and text grabbed from client database 2) forms that fill in PDF form template with fields from client database - this was accomplished using jakarta-ORO and string substitution - we use several fonts, including a barcode font, on the writable areas of these forms. I'm thinking of moving to iText or FOP for #1, but there's one particular problem that I can't seem to solve. When the client prints letters, they always want the first page to print on letterhead paper and the second and following pages to print on plain paper. With PS, you have the ability to set printer-specific options like paper-tray/type, but PDF doesn't have this capability as far as I know (I've read both specs pretty carefully). Unfortunately, it's not a clean switch trays every page situation, because some letters end up 3 pages rather than 2 (longer address, extra paragraph, etc.). So there's no way to render PDF ---ghostscript-PS, adding change trays every page to the PS at the end. In other words, I have to add the use tray x flag at the time of rendering, which means I must render to PS rather than PDF. Ideally, I would be able to use FOP and grab the proper use tray x flag from the PPD for the HP printer I'm using - I've even looked at a Canon machine called the imageRunner 5000 that allows you to set flags for switching trays, stapling, and folding (which would be nice for 1000+ person mailings). From checking the main fop page and the fop-dev archive, it seems that PS output in general, and any PPD capability specifically, is pretty far off. From what I can tell, renderX doesn't have PPD features either. Does anyone have any other ideas? Nathan Cheers, Jeremias Maerki
Re: support for PS printer-specific options using PPDs
Hi Nathan On 25.04.2002 15:00:29 Nathan Carter wrote: Jeremias, Thanks for your thoughtful response. Jeremias Maerki wrote: Being the one who wrote the PS renderer in the first place, I can comment on a few things: - The PS renderer, as it is now, is more of a proof of concept, than anything else. Some people are using it productively, though. - As you gathered, there are a few things that still need to be done. Here's the todo list from the PSRenderer's javadocs: Character size/spacing, configuration, move to PrintRenderer, maybe improve filters (I'm not very proud of them), add a RunLengthEncode filter (useful for Level 2 Postscript), Improve DocumentProcessColors stuff (probably needs to be configurable, then maybe add a color to grayscale conversion for bitmaps to make output smaller (See PCLRenderer), font embedding, support different character encodings, try to implement image transparency, positioning of images is wrong etc. And of course, there's the missing PPD functionality. I'll spend some time looking at the code today or tomorrow - I'm assuming that I should look in CVS, and that there is not any wholesale rewrite of at least the PS renderer portion going on outside of CVS (I saw some confusion about outside of CVS rewrites on the fop-dev list). Not sure what you mean. Anyway, you should just keep in mind that we're working on two branches in CVS: main branch for redesign and the maintenance branch where current releases come from. If you want to have quick results it's probably best to work on the maintenance branch and we move the code over to the main branch later. - There's also another problem: XSL:FO does not provide any means to specify things like tray selection. These will have to be proprietary solutions. And that means some work as well. What's important here is to have mechanisms that can be reused for PCL later. Hmm. I was thinking this morning that it would be ideal to make it fully configurable by the client, so that I'm not changing code every time they buy a new printer. What would be ideal is to have some sort of web-based strict equivalent to GPR (http://www.compumetric.com/linux.html ) or XPP ( http://cups.sourceforge.net/xpp/ ) that would allow me to set paper tray, stapling, and folding on a per-document (per-letter) level. per-document is probably not fine-grained enough. It should be per-page, at least for tray selection and folding, for example. There are already quite a few XML standards for job tickets (JDF as an example). Most of them are huge constructs which means a lot of work. It's probably easier if we just implemented what we need in a proprietary way, for now. That means we'll have an extension that enables us to specify some parameters on fo:root, fo:simple-page-master and probably fo:page-sequence. I don't know yet how this would look in detail. Is there a PCL equivalent of PPD, or would this have to be built separately for PS and PCL? (Uggh - this is beginning to sound like a big project). I think PCL can use PPDs, too. I seem to have a PCL-specific PPD for my Brother HL-1250 on my machine. And you're right, this will be a rather big project depending on how much you need. At present, we're using PJ to concatenate PDF documents (so that the client can print out hundreds of letters in one print job, a critical usability feature). With the system from the preceding paragraph in place, I could just concatenate PostScript letter that had already been generated with the proper tray/staple/fold settings (which may or may not work very well given our experience below). [[Side Note: At present, we're having plenty of problems using PJ to concatenate PDF document. In addition to the letters and forms PDF documents mentioned in my original posting, there are two sources of PDF documents that we sometimes integrate into the print stream - 1) a document scanning system that produces TIFF, that we then convert to PDF using ImageMagick/Ghostscript 2) Word documents that we convert to PDF using Abiword ( http://www.abiword.org ) and Ghostscript. We've determined that the concatenation problems are from poor conversion of Word--PDF, so we're hoping to move to OpenOffice or activePDF for this conversion in the not-too-distanct future ]] We decided to concatenate the PostScript files, not the PDF's, because we've found this not easier but more reliable, especially when all PostScript files have been generated by the same converter (Acrobat Reader). Like this, the PS files all have a similiar structure and are (relatively) easy to patch. The most difficult thing was rebuilding a unified font directory and rewriting all font lookups. - Conclusion: Any help is welcome! (Because I haven't got the time yet, to do it. At least, it's on my todo list, because we're currently working with the PDF renderer, then using Acrobat Reader
Re: Building a FO document with FOP
I recommend you don't build XSL:FO through Java code directly. Produce a simple XML format with just the data in it. Use a XSLT stylesheet afterwards to convert the XMl to XSL:FO. It sounds like a lot of work, but you're actually going to save time. For example, if your layout has to change you have to adjust your Java code, recompile, redeploy. If you're working with XSLT you can use some external XML tool, and you just have to switch the stylesheet if something changes in the layout. The whole idea about XSL (XSLT+XSL:FO) is separation of data/layout. You will be a lot more flexible that way! Just imagine you want to generate HTML or SVG instead of XSL:FO. This way, you (only) have to switch stylesheets. Your way means writing the Java classes that produce the XML all over again. This is not exactly what I mean. I don't have XML data documens, I'm trying to build a pure XSL:FO document through code, not transform an existing XML to FO. It will go like this: Data (from DB) --(Java code)-- FO document --(render with FOP)-- PDF Any clue? -Original Message- From: Katiyar, Bhawana [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 30, 2002 5:05 PM To: [EMAIL PROTECTED] Subject: RE: Building a FO document with FOP I guess it is better to build them as XML documents and use xsl:fo to transform them to FO documents. It is much easier. You could use the XML to render HTML, RTF or any other format. FOP programming is also much easier, as you shift all the java programming burden of building the FO document to FOP. Bhawana -Original Message- From: Ismaeil, Sameh Z [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 30, 2002 10:37 AM To: '[EMAIL PROTECTED]' Subject: Building a FO document with FOP Hello All, We are trying to build FO documents through Java code, these documents will be rendered with FOP. I would like to know whether it is recommended to build them using the FOP classes that represent FO elements (FONode/FObj and its decendants), or whether it is better to build them as XML docuemnts and use FOP for rendering only. Cheers, Jeremias Märki mailto:[EMAIL PROTECTED] OUTLINE AG Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern Tel. +41 41 317 2020 - Fax +41 41 317 2029 Internet http://www.outline.ch
Re: FOP: Page Orientation in Postscript
I've had similar experiences within GhostView, but I haven't found out yet what's missing. Maybe it's the missing BoundingBox DSC comment, although adding that manually didn't help. It's likely that a setpagedevice command might solve that, but I haven't investigated yet. Please tell me if you find anything. I was just mucking around with Ghostscript to see what it could do, and used it to turn a FOP-produced postscript file into PDF. It came out in portrait when it should have been landscape, and I can't work out how to stop this happening. If I make the PDF using FOP it comes out as it should. Manually editing the .ps file produced by FOP has so far only given me both my page and my page contents rotated 90 degrees - not much use. Cheers, Jeremias Märki mailto:[EMAIL PROTECTED] OUTLINE AG Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern Tel. +41 41 317 2020 - Fax +41 41 317 2029 Internet http://www.outline.ch
Re: fonts
This means the Java VM can't load the class in the error message. The clue is to supply the necessary jar files in the classpath. This involves the -cp parameter. I suggest that if you plan to use Java in the future that you at least read about some basics on launching the Java VM. The documentation about the TTFReader is not 100% correct, because the -cp parameter has been left out. For a Java programmer this becomes clear in a second. :-) Just use the same -cp parameter as shown above on that particular page for the Type 1 fonts. You may have to adjust the filenames because the jars often have version numbers in their name and the documentation is not updated every time. I hope this helps. I'm trying to create a few font metrics files. Here's the command I'm using: C:\Program Files\FOP\fop-0.20.3java org.apache.fop.fonts.apps.TTFReader -ttcname HGRM C:\Windows\Fonts\HGRM.TTC hgrm.xml And this is the error message I get: Exception in thread main java.lang.NoClassDefFoundError: org/apache/fop/fonts/apps/TTFReader I don't know s**t about Java programming but I guess this means that my command wasn't good or I'm missing something. How do I fix this? Cheers, Jeremias Märki mailto:[EMAIL PROTECTED] OUTLINE AG Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern Tel. +41 41 317 2020 - Fax +41 41 317 2029 Internet http://www.outline.ch
Re: FOP: Page Orientation in Postscript
You can have that a lot simpler! Edit the config.xml in the conf directory and remove all entries in list für the stream-filter-list. You then have to rebuild FOP. That way, you get an uncompressed PDF directly. It looks like it could be a bit more complicated than some missing commands. The reason I was doing this was that I wanted uncompressed PDF as a template: FOP's great but a bit slow for 200-odd near-identical documents. In the end what I did was make the PDF in FOP and use Ghostscript to make an uncompressed version. It seems to have worked fine. So then I used Ghostscript to make a postscript version of the ok PDF and compared it to FOP version that had all the problems, but there was no difference in the commands that I could recognise, although there were plenty of differences amongst the gobbledegook below them - not very helpful I'm afraid. Cheers, Jeremias Märki mailto:[EMAIL PROTECTED] OUTLINE AG Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern Tel. +41 41 317 2020 - Fax +41 41 317 2029 Internet http://www.outline.ch
Re: Best coding practice.
Balaji, xsl:template mainly helps you split up your processing in handy parts that may even be reused instead of copy-pasted. Copy-Paste is often A Bad Thing (TM). That's probably one of the top ten best practices in every computer language. Processing speed is always one thing. Maintainability of code and code reuse are another. Sometimes they contradict each other. It does not always make sense to go for speed over maintenance costs. In the past I've often went for lower maintenance cost and it has almost always paid off. What I want to say is this: If you're doing quite a lot of XSLT you should learn how to work with templates. It will make life easier. As Patrick said xsl:template with a match attribute (probably!) won't be so fast, but a named template (xsl:template name=xy...) should be relatively fast. But don't take that as a definitive rule. Some things may be faster with one implementation of XSLT, slower with another. I know some people who have always asked for definitive and simple rules, but often they don't exist. Often you have to try something out and measure the performance. Then you change it if it's not good enough and measure again. Experimenting can help you get a feel on how fast certain things are. As for checking for mandatory elements there are several points to consider: - Structure checking (or in other words: Validation) is for DTDs and XML Schemas and the like... - ..., normally. You can of course let this checking code in your XSLT, but as soon as you're in production and you can rely on getting valid XML those checks are not really necessary. - If you have an unreliable source of XML (for example many different producers sending you XML Files of the Internet) then it's probably best to use XML Schema or DTD validation. My suggestion to you: Measure the performance of your current XSLT, then read into xsl:template and do a refactoring cycle structuring the code into handy parts using xsl:template, then measure again and decide which one of those two approaches you like more using the criterias: Speed, maintanability and possibility of code reuse. On 03.05.2002 16:29:35 Balaji Loganathan wrote: Hi, Is there is any best practice for coding the XSL:FO, that is always 1. use xsl:template 2. check whether the element exist or not even for mandatory elements. My xsl is of 578 lines,Suddenly i felt that my code is not object oriented beacuse no where i have used xsl:template. I construct the PDF line after line.Does this affect the processing speed. Does using xsl:template increases the processing speed. Please comment. Regards Balaji Cheers, Jeremias Maerki
Re: Out of Memory Error !!
The problem is probably your page-number-citation that looks up the last page. This is well known to have impact on memory usage, because FOP can render the first page only after the last page has been setup. It has to wait until it knows how many pages your page-sequence has. Take out the page-number-citation and look if the problems go away. I'm pretty sure they will. That means you might have to live with page x instead of page x of y for now. On 09.05.2002 11:18:59 Abhijat Upadhyay wrote: hi there !! i am sending u the code of my XSL and XML... though the code might be slightly big but if u r able to find a solution to it then nothing like it... this set of XSL and XML should be able to print around 300 - 500 pages but currently it prints hardly 40... THE XSL CODE: - snip/ Page #fo:page-number/ of xsl:value-of select=$page-count/ snip/ /xsl:stylesheet THE XML CODE: - library pagetitleList of Books/pagetitle book titleDiscovery of India/title authorPandit Jawaharlal Nehru/author publisherTata McGraw Hill/publisher cover type='paperback'/ category class='historical'/ isbn1-23-456-7890/isbn rating number='5'/ commentsTells about history of India right from its birth/comments /book ... mutiple book tags are there and finally the closing tag i.e. /library Currently i want to print around 3000 - 4000 rows of in a table in the PDF... but the total page count does not go beyond 40... actually it should go to 140... similarly if the number of rows increases then the number of pages will also increase. NOTE: - this is just anexample XML. Cheers, Jeremias Maerki
Re: FOP Scalability
I've never really done this for real, but I think I'd do it like this: On the first HTTP-Request, the job gets sent on the JMS queue. The user receives a Please wait.. page with an automatic refresh and and ID that will be returned to the server upon refresh. Use the ID in a message selector to see whether the job with the respective ID has already finished. If not, send the Please wait... again. I think this should work, but I may be wrong. I'm sure there are others on the list who have done similar things. I think I remember some posts on one of the FOP lists. Browsing the mail archive might be interesting. This is an interesting suggestion - but how does the notification to the Front Controller allow a user to know when the document is ready without some type of polling? We have a similar setup, but a polling applet is being used - which we would love to get rid of. Cheers, Jeremias Märki mailto:[EMAIL PROTECTED] OUTLINE AG Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern Tel. +41 41 317 2020 - Fax +41 41 317 2029 Internet http://www.outline.ch
Re: page-masters for different 1st page
You're almost there. All you have to do now is apply a non-default region-name to the region-after of one of the simple-page-masters. Then you create a new fo:static-content and set the flow-name to this other name. Example (uninteresting stuff is left out): fo:simple-page-master master-name=first fo:region-body / fo:region-after region-name=first-region-after/ /fo:simple-page-master fo:simple-page-master master-name=rest fo:region-body/ fo:region-after/ /fo:simple-page-master [..] fo:static-content flow-name=first-region-after/ [..] fo:static-content flow-name=xsl-region-after/ I now have a requirement for a document to have different content in the region-after for the first page. I've thought about using different fo:simple-page-master elements for this and also using something like: fo:page-sequence-master master-name=seq fo:repeatable-page-master-alternatives fo:conditional-page-master-reference master-name=first page-position=first / fo:conditional-page-master-reference master-name=rest page-position=rest / /fo:repeatable-page-master-alternatives /fo:page-sequence-master From what I can gleam from the examples all this allows me to do is have different margins for the first page. My first page needs to have different content in the region-after only for the first page. Is there a way of doing this? Cheers, Jeremias Märki mailto:[EMAIL PROTECTED] OUTLINE AG Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern Tel. +41 41 317 2020 - Fax +41 41 317 2029 Internet http://www.outline.ch
Re: Image Size and Rotation
At the moment it's probably best to embedd the image in SVG where you can easily scale and rotate. I've done this with SVG a lot but not with JPEG, but this should work, too. Here's an excerpt from one of my stylesheets that does this kind of stuff. fo:instream-foreign-object svg xmlns=http://www.w3.org/2000/svg; width=40mm height=270mm viewBox=0 0 40 270 g transform=translate(0 270) rotate(-90) font-family=Frutiger svg width=270 height=40 viewBox=0 0 2700 400 g transform=translate(1360 150) scale(2.5) xsl:copy-of select=document('mylogo.svg')/ /g /svg /g /svg /fo:instream-foreign-object Maybe this helps. is there anyone who can tell me how to resize and rotate an image (SVG and/or JPG). For resize an image I know the trick through the content-width attribute in an table-cell element. However there I lose the posssibility to set a ratio. More important is on how I can rotate an SVG image. Cheers, Jeremias Märki mailto:[EMAIL PROTECTED] OUTLINE AG Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern Tel. +41 41 317 2020 - Fax +41 41 317 2029 Internet http://www.outline.ch
Re: FOP Helvetica - is it really Arial?
AFAIK the standard fonts specified in the PDF spec match the base 14 fontset of PostScript which includes Helvetica, Times, Courier, Symbol and ZapfDingbats. Acrobat 3.x, I think, used Helvetica and Times. Current versions include Arial. Helvetica is then replaced by ArialMT. Furthermore, I've read (and experienced myself) that Arial (by Microsoft) is not the same as Helvetica. Don't know about ArialMT (by Adobe). Scott Moore wrote: There's a debate raging in our company right now about the use of Arial and Helvetica in FOP produced PDF. After careful examination of both fonts, I can see absolutely no difference, even though Helvetica has minor but distinguishable differences from Arial. I'm using the information on this website to distinguish between the two fonts: http://www.ms-studio.com/articlesarialsid.html It appears to me that Helvetica is actually Arial in the PDF. Even when I have Acrobat Reader 5.0 list the fonts, it says Helvetica maps to ArialMT. So, my question is: is this a problem with FOP or Acrobat Reader? Is Helvetica something that Acrobat Reader renders or did FOP use Arial for the Helvetica font? I'm not exactly sure how fonts work in PDF, but I've read Helvetica comes standard with PDF. I find it strange that Helvetica is mapping to Arial though. AFAIK the standard fonts supported by the Adobe tools (and the PDF format) include Arial, but not Helvetica. The glyphs rendered for FOP Helvetica are certainly taken from Arial. I'm not sure whether the font metrics used by FOP is indeed generated from an Helvetica font, or whether it is actually an Arial font, with the name being some historic relict (AFAIK early PDF specs had Helvetica instead of arial in them). Cheers, Jeremias Märki mailto:[EMAIL PROTECTED] OUTLINE AG Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern Tel. +41 41 317 2020 - Fax +41 41 317 2029 Internet http://www.outline.ch
Re: Print Servlet
Not really. Not with a servlet. A servlet is a server based thing and it's not intended to provide GUI-interactive stuff. If you want to have access to the print dialog, you will have to install the printer drivers locally, run FOP locally and transfer the generated print stream to the remote site in some way, for example using port forwarding from SSH on the LPR port. Another possibility is to identify what you need to be able to change in the print dialog, construct your own dialog on the client side and transfer the settings along with the data to the PrintServlet. But then, you will need to extend the print servlet. Either way, what you want to do is not is not so simple, at least not with the standard PrintServlet. I'd ask myself if this is really necessary. Hi,I ran the FOPPrintServlet with success. My servlet is on a server 2000 miles away. Why would we print to their server. Is there a way to twwek the code to make my print dialog come up on the client side? Cheers, Jeremias Märki mailto:[EMAIL PROTECTED] OUTLINE AG Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern Tel. +41 41 317 2020 - Fax +41 41 317 2029 Internet http://www.outline.ch
Re: Newbie - Dynamic data in .fo file
You can improve the use of the document() function if you do something like that: document('urltoyourxmlfile')/mystuff/entry[position() = 3]/text which basically means that you can append an XPath statement to further restrict the content to be included. I use this to include language dependant textblocks. If you wrap the result using node-set() function (See Xalan documentation) you can even apply templates from your stylesheet to it. Thanks for your reply. The problem is that I need to replace certain place holders in my .fo file with corresponding tags in the xml file. I dont need to dump the whole xml file in the fo file. For eg: To: replace with Client Name is in the fo file, and the client name is in the xml file as a tag. Cheers, Jeremias Märki mailto:[EMAIL PROTECTED] OUTLINE AG Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern Tel. +41 41 317 2020 - Fax +41 41 317 2029 Internet http://www.outline.ch
Re: ClassDefNotFound
I don't have a big idea what's wrong, but Rectangle usually resides in jre/lib/rt.jar in your Java installation. It's a standard J2SE class. Maybe someone else has an idea. I have been using FOP quite succesfully over the last few months and have recently migrated in to a new Server. When I try and run it I recieve a ClassDefNotFound java.awt.Rectangle exception. Does anyone know which JAR file this would live in ? I am assuming this is just a CLASSPATH problem. Any help would be greatly appreciated Cheers, Jeremias Märki mailto:[EMAIL PROTECTED] OUTLINE AG Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern Tel. +41 41 317 2020 - Fax +41 41 317 2029 Internet http://www.outline.ch
Re: Problem with PDF generation [was: Is there an archive of this list?]
It is VERY bad practive to reply to a mail when you want to start a new thread! Not even the subject is changed. The empty PDF often happens when an exception/error occurs. You'll have to post more information on your problem: error message, stacktrace/log, version of FOP, platform where the error occurs. Otherwise we can't help you. While trying to generate a PDF from a xml using a xsl... the pdf generated is a 0KB one. Can anybody tell me the probable reason for this TIA, Cheers, Jeremias Märki mailto:[EMAIL PROTECTED] OUTLINE AG Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern Tel. +41 41 317 2020 - Fax +41 41 317 2029 Internet http://www.outline.ch
Re: What else than PCL?
I'm not no familiar with the PCL renderer, so I can't help here immediately. But you've got the possibility to use the AWT renderer and print directly to a printer. Have a look at the documentation and the FOPPrintServlet in docs/examples/embedding. Another possibility is to create a PDF or a PS file and use GhostScript to convert it to the target printer format (ex. PCL). This will be rather slow, though. Or you can print a PDF on the command line using Acrobat Reader. Examples of everything should also be in the mailing list archive and maybe even in the FAQ. trying to convert a FO file including some bitmap images to PCL ends up with: [INFO]: FOP 0.20.3 [INFO]: building formatting object tree [INFO]: rendering areas to PCL [INFO]: [1] [ERROR]: null The only image format which is recognized by FOP/PCL is the GIF format. However the rendering doesn't also work. Coming to this result the PCLRenderer is useless at least for my need. My Problem is, I don't know how else I can get my FO file straight and rendered to a printer. Is there anyone who can tell me howto achieve this. Cheers, Jeremias Märki mailto:[EMAIL PROTECTED] OUTLINE AG Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern Tel. +41 41 317 2020 - Fax +41 41 317 2029 Internet http://www.outline.ch
Re: Problem printing using FOP
I'm not sure but I think AWT normally uses the default printer driver config from the OS. If your on Windows check your Printing Preferences on the printer. Maybe you've got the manual feed as a default. Just a thought... I have a problem I can't figure out, hoping someone has done this before. I have a FOP program to do some printing from a Java. I created a Java Swing Applet that uses FOP to do the printing. I am using code out of FOP 0.20.3 distribution that is in org.apache.fop.apps. I used the same code in PrintStarter to do the printing. The printing works fine (the page looks as I would expect) but the really weird thing is that the output from the print is going to the manual feed on my printer instead of to the normal output bin. What this means is each time I print I have to walk over to the printer and manually feed in the pages to be printed...obviously not a good solution :) The same problem occurs when I use the fop.bat program to do the printing instead of my program. Has anyone encountered anything like this before? Any solutions would be greatly appreciated. Cheers, Jeremias Märki mailto:[EMAIL PROTECTED] OUTLINE AG Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern Tel. +41 41 317 2020 - Fax +41 41 317 2029 Internet http://www.outline.ch
Re: render only page n
No. Want to add support for this yourself? I can give you some pointers, if you want. The other possibility is using iText or something similar to delete the pages you don't want. Is it possible to tell fop to render only page n? Without having to put explicit tags in the source of course. Cheers, Jeremias Märki mailto:[EMAIL PROTECTED] OUTLINE AG Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern Tel. +41 41 317 2020 - Fax +41 41 317 2029 Internet http://www.outline.ch
Re: getting the outputStream
Everything you need should be here: http://xml.apache.org/fop/embedding.html How can I get an OutputStream from a fop processed xml+xsl files? Cheers, Jeremias Märki
Re: Is it possible to maintain kerning in FO?
Actually, in 0.20.4rc letter-spacing should work now, but only for the PDF and PS renderers. On 14.06.2002 21:13:09 Oleg Tkachenko wrote: Max Dcosta wrote: Is it possible to maintain kerning in FO? In FO yes, it's possible by letter-spacing property: fo:inline letter-spacing=2mmThis is a text with 2mm letter-spacing/fo:inline But afaik letter-spacing is not implemented in fop yet, fop only able to keep font built-in kerning. -- Oleg Tkachenko Multiconn International Ltd Cheers, Jeremias Maerki
Re: error handling
It is. The problem is that FOP can't delete the output file in case of a problem if it only gets an OutputStream. And for optimization reasons FOP can't wait until the end to write the output to the target stream. On 14.06.2002 21:21:48 Oleg Tkachenko wrote: Ruane, Conleth wrote: I'm using the latest version of FOP to automatically generate pdf files from xml (what else) and I've noticed that when fop stops due to errors in the input file(s) a corrupt pdf file is generated. Is there any way I can prevent this or is there any way I can access a FOP exit code so that I know that something went wrong. Currently my only option is to grep the output for errors and react on that. Any suggestions welcome. Driver's render() and run() methods are declared to throw FOPException - is it not a correct way to report errors? -- Oleg Tkachenko Multiconn International Ltd Cheers, Jeremias Maerki
Re: error handling
You're right. The command line wrapper can and probably should delete the target file in case of an error. Could you check if the return code is set on the command line? If not, we should fix that. It is. The problem is that FOP can't delete the output file in case of a problem if it only gets an OutputStream. And for optimization reasons FOP can't wait until the end to write the output to the target stream. But does fop should delete output file? I don't think so, that's responsibility of enclosing application, which has full control of OutputStream and can easily do this being catching FOPException. All very well for embeddding, but the command prompt version still leaves the corrupt file there no file at all would be preferable to a useless one. I hope the UNIX script sets the return code on errors (haven't tested yet). Cheers, Jeremias Märki
Re: Configuring Portrait/landscape from PSRenderer
Is it possible to do the same thing with pdf? Yes, it is, if someone's going to implement it. Another question is if it makes sense to do this, or better: is it really necessary? I haven't investigated that, yet. I'm printing in portrait mode usually... I wonder what you're trying to do. AFAIK pdf doesn't have info about page orientation, and as a sequence, you have to pass the orientation to the printing application (eg acrobat) so that it prints corectly, but I need someone to assert this info.. That's correct. PDF doesn't contain info about page orientation. Also, the page size (A3, A4, letter, etc..), AFAIK pdf doesn't have info about it either. so even with the right page sizes you cant configure your pdf print application to choose the correct paper size form within the pdf. again, you have to pass/set the page size into the application. right? The PDF contains the extent of each page (width and height) but not a paper size as in A4 or letter. Acrobat Reader has a lot of options in the GUI to rotate and scale a page before it is printed. The unix command line of Acrobat Reader has options that need to be set (ex. -size a4) so the page is transformed to PostScript correctly. What is your application? What about formats other than ps and pdf? There are probably similar issues. Cheers, Jeremias Märki
Re: Can FOP tell Acrobat Reader about wanted orientation?
Did you follow a similar discussion yesterday? http://marc.theaimsgroup.com/?t=10243211241r=1w=2 PDF does not provide what you ask. The only values you can enter in the PDF are the one you can set in File/Document Properties/Open Options... And none of them are implemented in FOP. I think that if you enable auto-rotate then the PDF should always come out correctly without having to set anything on the printer driver. For the moment you will have to stick with what you have. A possibility is to add a rotation similar the stuff I did for the PS renderer. But this would also need to be made configurable. There may be other solutions if there's no requirement that your users want to preview the PDF in Acrobat Reader before printing. But none of them is really simple. I'm using reports in the PDF format using an XSL-stylesheet on an XML-souce, using FOP-0.20.3. I will need to control the orientation of the output - for some reports I need portrait orientation, for others I need landscape. My current problem is with landscape. In my style sheet, I try to control this by setting page-width=297mm page-height=210mm. FOP runs fine from a command line and my Adobe Acrobat Reader 5.0 displays the result in landscape. The xsl:template match = / tag is include below. However, to get the thing printed right, I currently have to MANUALLY set Copies and Adjustment radio buttons in the Adobe Acrobat Reader 5.0 print pop-up as follows Shrink oversized pages to paper size CHECKED Expand small pages to paper size NOT CHECKED Auto-rotate and center pages NOT CHECKED Thsi is higly inconvenient for our end useres. (Also I must set paper orientation to landscape in the printer properties, but I recognize that this has nothing to do with FOP). My question: assuming, that Copies and Adjustment settings are part of the Acrobat Reader's settings for that document, is there any way to set these settings in the style sheet and getting FOP to tell Acrobat Reader about it? Or, more general, what are the possibilities with FOP to control page orientation in the resulting PDF? Any suggestions are warmly welcomed Cheers, Jeremias Märki
Re: some help..
Several people have been successful at embedding MathML using some tool that converts MathML to SVG. SVG can be easily embedded in XSL:FO. Have a look into the FOP mailing list archives and search for MathML. http://xml.apache.org/fop/resources.html Can you please describe me how to embedd equations inside FO style sheet. i render for PDF it doesn't takes MathML markups. As per W3C Draft Specification 15 October 2001 there is no information about incorporating MathML tags inside the FO. This is the main problem with any STM(science,technical and medicine) document formatting. Cheers, Jeremias Märki
Re: Please remove me from the mailing list!
You have to do that yourself. See http://xml.apache.org/mail.html Cheers, Jeremias Märki
Re: Support of Type3 fonts - future thoughts?
I dont know where I have to post this message, so I try in this mailinglist. Oh, it's the right place. :-) I right know looking at the development of FOP and its very nice. But I just need one thing before I can start using it - support of Type3 fonts etc.. I know the Font Support page says that it does not support other files than the embedded package in Adobe PDF spec. and Abobe Type1 and TTF but anyone know if we maybe soon can see support of type3 fonts and maybe other kinds of fonts? :) I hope so... There are no plans, currently. Anyone know something about this? Or how I maybe can make a work-around in the meantime? Maybe there are some utilities that can translate your Type3 fonts to TrueType or Type 1 to use them in FOP. The other possibility, if you know Java, is to read the specs and add support for it yourself. We would be happy to include code for this in FOP. Tore Engvig has once started code for Type 3 but that's obviously not finished. Have a look at org.apache.fop.pdf.PDFFontType3.java as a starting point. Cheers, Jeremias Märki
Re: PDF performance issues.
That schematic, is this a b/w-image? If so I can imagine that the original TIFF is compressed using CCITT compression. FOP doesn't support CCITT at the moment, so it recompresses the image using ZLib compression. For b/w-images this often results in a bigger file. As for the redraw speed: It probably is related to the different compression type. But this question is better directed at Adobe. The optimized flag is to indicate whether all objects in a PDF are aligned in a way that the PDF can be loaded over the web and Acrobat can quickly display the first page without having to wait until the whole PDF is loaded. FOP doesn't support this, but it isn't relevant here. Maybe FOP isn't the best way (at least at the moment) to accomplish exactly what you want to do, except you need to do other things than just embedding images in a PDF. Maybe iText could help you here. It seems to support CCITT, but you wouldn't be able to use XSL:FO. On Thu, 31 Oct 2002 15:27:40 - Phil Dickinson wrote: Hello, Help with the following problem would be very much appreciated. I have installed the JIMI image libraries onto my machine for use by FOP 0.20.4 so that FOP can read TIFF files. The output PDF refresh or screen redraw in Acrobat Reader is slow compared to the redraw for a PDF created from the same TIFF by Acrobat itself. Here are some basic facts: 1) I have an out-of-the-box FOP installation, no unusual configuration other than addition of JINI. 2) Simple FOP transformation to PDF. 3) One page of A3 comprised of a single large TIFF file (a schematic). 4) FOP 0.20.4 running on Windows 2000. For the sake of this thread we can use the example where the original TIFF image is 4681x3311 approx and the FO used reads: ?xml version=1.0 encoding=UTF-8? fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format; fo:layout-master-set fo:simple-page-master margin-right=10mm margin-left=10mm margin-bottom=10mm margin-top=10mm page-width=420mm page-height=297mm master-name=page fo:region-body margin-right=0mm margin-left=0mm margin-bottom=0mm margin-top=0mm/ fo:region-after extent=0mm/ /fo:simple-page-master /fo:layout-master-set fo:page-sequence master-reference=page fo:flow flow-name=xsl-region-body fo:block margin-left=0mm padding=0mm fo:external-graphic src=image.tif/ /fo:block /fo:flow /fo:page-sequence /fo:root The PDF output file is 237K and the redraw in Acrobat is slow (2.5 seconds). When the same file (image.tif) is converted using Acrobat, the resulting PDF file is 143K and redraws speedily enough (1 second approx). The PDF file generated by Acrobat has the optimized flag set and that from FOP does not. I don't know if this is relevant. Both files are sized correctly for A3. Thanks, Phil Dickinson Aicom Limited Jeremias Maerki
Re: Embedding TIFF in PDF results in huge filesize
See my answer to Phil Dickinson just a few moments ago. It seems to apply to you, too. Here's the link: http://marc.theaimsgroup.com/?l=fop-userm=103640636016829w=2 On Mon, 4 Nov 2002 11:29:46 +0100 Bellinger, Michael wrote: I am embedding TIFF images into a PDF document to enable users to watch and print the images from their browser without having a tiff-plugin. The TIFF images are usually at 200 - 300 dpi (black/white) and use CCITT Fax Gr.4 compression. Embedding them in the PDF results in a filesize nearly 4 times bigger than the original TIFF (e.g. the Tiff is 57 kByte, the resulting PDF is 183 kBytes). Is there a way to reduce the filesize of the generated PDF? Thanks for you help, Michael Bellinger Jeremias Maerki
Re: Table and first/last page
Here's a sample of a layout-master-set that has different page headers for the first and other pages. The important hint is the region-name that is overridden in fo:region-before. fo:layout-master-set fo:simple-page-master master-name=IS-11 page-height=29.7cm page-width=21cm margin-left=1.5cm margin-right=1.3cm margin-top=12mm margin-bottom=0mm fo:region-before region-name=doc-header extent=71mm/ fo:region-body margin-top=73mm margin-bottom=10mm/ fo:region-after extent=10mm/ /fo:simple-page-master fo:simple-page-master master-name=IS-12 page-height=29.7cm page-width=21cm margin-left=1.5cm margin-right=1.3cm margin-top=34mm margin-bottom=0mm fo:region-before region-name=other-page-header extent=17mm/ fo:region-body margin-top=19mm margin-bottom=10mm/ fo:region-after extent=10mm/ /fo:simple-page-master fo:page-sequence-master master-name=invoice fo:repeatable-page-master-alternatives fo:conditional-page-master-reference master-reference=IS-11 page-position=first/ fo:conditional-page-master-reference master-reference=IS-12/ /fo:repeatable-page-master-alternatives /fo:page-sequence-master /fo:layout-master-set Further down the document you'll then have the following: fo:static-content flow-name=doc-header fo:static-content flow-name=other-page-header instead of fo:static-content flow-name=xsl-region-before This lets you define separate page headers. What you currently can't do is define a conditional-page-master-reference for page-position=last. This is not implemented. On Mon, 11 Nov 2002 11:07:35 +0100 Nwilan Glirt wrote: I am using FO to transform an XML document into a nice business form (like an invoice). I am thinking of presenting all the postings in a table that runs across as many pages as needed. My problem is, that I want to make the top and bottom of the document to be different for the first page (should contain address etc.), last pages (should contain a total amount) and all the pages in between (should just list the postings). I have been playing around with fo:repeatable-page-master-alternatives and conditional-page-master-reference, but that only seems to be affecting the selection of the page-master, which only deals with the pysical aspects of the page (size, margins etc), and those don't differ across the pages. I feel I got something basically wrong here. I would appreciate any help! Jeremias Maerki
Re: page-position=last, FOP vs XEP
On Mon, 11 Nov 2002 14:33:22 +0100 Nwilan Glirt wrote: It has come to my attention that page-position=last is not yet implemented in FOP. That is a big problem for the purpose I have. I tried with XEP (from RenderX) and it seems to work here. The problem with XEP is a) it does note support pcl output, which I need, and b) it is a Windows-only-thing, which is also a problem. I want to stick with FOP. Can anybody tell me when page-position=last will be supported in FOP? No, it will be done during the redesign phase, but we can't give you a date, yet. We were facing the same problem and therefore tried to change (or to make our customers change) the layout so we didn't need the page-position=last functionality. Maybe it's also possible with your layout. Jeremias Maerki
Re: page-position=last vs. conditional blocks
If you know what's exactly on your last page (ex. the last page is a form that the recipient of the document has to fill out) you could try to use two page-sequences, where the second page-sequence only defines a single page-master for the last page. But that won't work if content flows from the n-1th page to the last page. Anyway, during XSLT you don't get any information from FOP (even if it had it) to determine the last page. You can do that only if in the way outlined above. Perhaps, you have a situation like that. I hope this helps anyway. On Mon, 11 Nov 2002 16:17:19 +0100 Nwilan Glirt wrote: Now that I discovered that page-position=last is not implemented in FOP, I am looking for alternative ways to produce first, middle and last specific pages. Is there any way to do some conditional stuff on blocks such as testing if we are currently writing the last page? Jeremias Maerki
Re: page-position=last, FOP vs XEP, business forms
Of course. This approach has been proposed a number of times, but that only works if you really know the height of each invoice position in advance. But at least for me, it's not that general solution I'm looking for. Let's hope this helps at least Nwilan Glirt. On Mon, 11 Nov 2002 15:49:00 + Ward, Christopher wrote: Would it be posible to iterate over your list of invoices (by using recursion with the head and tail approach in the xslt translation). But keep a counter of the number of invoices processed this page. When the counter hits a certain level start a new page by doing the carried forward/brought forward part of the page break. That way if there are no page breaks all of the invoice lines will appear on the one page, and if there are more invoice lines that can appear on a single page the appropriate page break will appear. This approach will however mean that you have a page sequence for each page. It will also mean that you have to know how many invoice lines can appear on a single page. Jeremias Maerki
Re: PFM font embedding problems.
Dennis, an addition to Oleg's answer: I've posted a checklist a while ago that describes how to tweak the values in the XML font metric file generated by the PFM Reader. Yes, sometimes it's necessary to alter the generated file. That will change when we have an AFM and an improved PFB parser. http://nagoya.apache.org/eyebrowse/[EMAIL PROTECTED]msgId=474801 On Tue, 12 Nov 2002 21:36:20 +0100 Dennis Myrén wrote: Could that have something to do with the calculations in the StandardGroteskBSK-Regular XML font metrics file? I have read that these calculations are only approximations of the actual values. Do i have to manually alter this file then? Jeremias Maerki
Re: Fonts in PDF (embedded postscript)
I've looked at the files. I'm not sure but it could be a bug in the PFB parser. GhostScript complains about PFB segment lengths when opening the PDF (See File/Show Messages). I can investigate further next week. In Ad.ps the Creator is shown as ICE. What's that? Wouldn't it be possible to generate SVG instead of PS? That would avoid any problems. Having high-resolution TIFFs could also be a solution. On Tue, 12 Nov 2002 14:54:08 +0100 Torsten Erler wrote: Attached is a sample pdf file with one included postscsript-ad (Ad.ps). The PDF uses the same font like the original postscript file (BellCentennial). The postscript file is called in the generated fo-file as followed: fo:block text-align=center fo:external-graphic src=file:/c:/Ad.ps/ /fo:block I print the document on command line from whithin a java program: Runtime.getRuntime().exec( [path_to_acrobat]/acdrord32.exe myfile.pdf /p /h ); The text in the pdf is using this special font but the postscript font will be substituted on printing with Courier. If I print the generated pdf document to a postscript-file and open it with gsview everything looks ok (fonts are installed in ghostscripts fonts directory). It's impossible to embedd the font in each postscript file, because of the most of the postscript files contains only one line (like Name Tel.-Nr.). (Theoretically) hundreds of generated ad's are in one pdf-proof and thousends of proofs can be processed in a batch. ThanX Torsten -Original Message- From: Jeremias Maerki [mailto:[EMAIL PROTECTED] Sent: Dienstag, 12. November 2002 13:37 To: [EMAIL PROTECTED] Subject: Re: Fonts in PDF (embedded postscript) Probably, it has something to do with the way a particular font is referenced. Acrobat maps the font names to different names when you convert a PDF to PS. The PS part in the PDF has then no access to the embedded fonts because the names don't match. You could try to let the application that produces your EPS files embedd the fonts. I've checked with CorelDraw and it works. But that will obviously mean that the font gets embedded twice, once for the EPS and once for the PDF. Another approach is to switch to SVG instead of EPS. Can you post a sample? How do you print the PDF? Jeremias Maerki Jeremias Maerki
Re: PFM font embedding problems.
Does Acrobat open the PDF without problems if you don't embed the font (remove embed-file attribute)? On Wed, 13 Nov 2002 11:08:09 +0100 Dennis Myrén wrote: Thank You for all help so far, with my PFM font embedding problem. I am very thankful. My implementation in the userconfig.xml file looks like this (as childs of the fonts node): These are two declarations, one for the normal weighted font, and one with bold: snip/ The error i get when opening the generated PDF from Adobe Acrobat Reader 5.0: Unable to extract the embedded font StandardGroteskBSK-Bold. Some characters may not display or print correctly. The names displayed in the XML metrics files are: font-nameStandardGroteskBSK-Regular/font-name and font-nameStandardGroteskBSK-Bold/font-name I have also tried to use these names without success. But when using SVG, i succeed to use this font, using the name: StandardGroteskBSK-Regular for example: text x=100 y=100 style=font-family:StandardGroteskBSK-Regular;This is StandardGroteskBSK-Regular/text or StandardGroteskBSK-Bold to get the bold one. Which is the actual name here? I am a little bit confused about that. Sure its me doing something wrong here. If anyone has a clue, that's great, but I understand the complexity of my problems here. It is not very easy for you to recreate my problem and debug it. Jeremias Maerki
Re: PFM font embedding problems.
*Smack* Of course! Thanks for spotting it. Still doesn't explain why it still doesn't work when he removes the embed-file attribute. Dennis, would you try to use an URL instead of a filename for the metrics-file attribute? I always use URLs and I've never had problems, yet. On Wed, 13 Nov 2002 11:41:35 +0100 Torsten Erler wrote: HI IIRC try to use *.pfb files in embed-file=... cu Torsten Jeremias Maerki
Re: SVG LinearGradient
Keiron, I've upgraded FOP branch CVS to Batik 1.5b4. You may have missed that mail yesterday. :-) On 14 Nov 2002 11:28:33 +0100 Keiron Liddle wrote: On Thu, 2002-11-14 at 11:08, marco scotoni wrote: Symptoms are a blank page instead PDF File. (From a FO file) That's 'cause i have substituted FOP 0.20.4 with CVS (I need to use LinearGradient!) I use Win 2000, JDK 1.4.0, Cocoon 2.0.3, Fop CVS and Batik 1.5b4 Since there has been some api changes they will not work together. You could get them working by compiling cocoon with the fop you want and fixing the problems. Since it is not a release of fop you may find that the documents don't turn out how you want. Jeremias Maerki
Re: Viewing PDF without AcrobatReader or FOP??
Hmm, what about converting the PDF to a TIFF (or similar) on the server and sending that to the client? Can be accomplished with GhostScript, for example. On Fri, 15 Nov 2002 09:55:04 +0100 Müller, Markus wrote: Hi there, we're just testing FOP to generate PDF on a host, then sending the PDF document in a way we don't know yet to some clients. The clients should be able to view (and perhaps to print) the document. Is this possible without AcrobatReader? The AcroRead for Java is not really a good thing, and using FOP only to display a file isn't a solution, too (since it's too large). Has anybody a little hint? Markus Jeremias Maerki
Re: Producing Font Metrics
done. Thanks Bernard! On 18.11.2002 11:18:20 Jeremias Maerki wrote: I've seen your patch. It seems like I screwed up when improving the code there. Sorry! I'm going to apply your patch in a few minutes. Jeremias Maerki
Re: Strange error when upgrading from 0.20.3 to 0.20.4
That's probably a follow-up error because a font could not be loaded. If you run your sample form the command line with the -d option, you should get a better error message. Maybe you didn't set the second logger in the MessageHandler class correctly because that's where the original error message should have been logged. The logging in the maint branch is still somewhat strange. On 18.11.2002 12:01:52 Jiri_Nejedly wrote: I am trying to upgrade FOP from version 0.20.3 to 0.20.4 . I use Oracle's JDeveloper 9i To my project I added all libraries, which I found in fop.bat : fop.jar batik.jar xalan-2.3.1.jar xercesImpl-2.0.1.jar xml-apis.jar avalon-framework-cvs-20020315.jar logkit-1.0.jar When I process my FO file by fop.bat, everything is ok. When I do this in servlet, following error appears: [INFO]: building formatting object tree [INFO]: [1]- the logging stops here java.lang.NullPointerException int org.apache.fop.render.pdf.fonts.LazyFont.getAscender(int) int org.apache.fop.layout.FontState.getAscender() void org.apache.fop.layout.LineArea.(org.apache.fop.layout.FontState, int, int, int, int, int, org.apache.fop.layout.LineArea) void org.apache.fop.layout.BlockArea.start() org.apache.fop.fo.Status org.apache.fop.fo.flow.Block.layout(org.apache.fop.layout.Area) org.apache.fop.fo.Status org.apache.fop.fo.flow.Flow.layout(org.apache.fop.layout.Area, org.apache.fop.fo.pagination.Region) org.apache.fop.fo.Status org.apache.fop.fo.flow.Flow.layout(org.apache.fop.layout.Area) void org.apache.fop.fo.pagination.PageSequence.format(org.apache.fop.layout.AreaTree) void org.apache.fop.apps.StreamRenderer.render(org.apache.fop.fo.pagination.PageSequence) void org.apache.fop.fo.FOTreeBuilder.endElement(java.lang.String, java.lang.String, java.lang.String) java.lang.String oracle.xml.parser.v2.NonValidatingParser.parseElement() NonValidatingParser.java:1112 void oracle.xml.parser.v2.NonValidatingParser.parseRootElement() NonValidatingParser.java:287 void oracle.xml.parser.v2.NonValidatingParser.parseDocument() NonValidatingParser.java:254 void oracle.xml.parser.v2.XMLParser.parse(org.xml.sax.InputSource) XMLParser.java:141 void org.apache.fop.apps.Driver.render(org.xml.sax.XMLReader, org.xml.sax.InputSource) void org.apache.fop.apps.Driver.run() void or.jbo.html.beans.ReportShowBean.kresli() ReportShowBean.java:554 void _dt. _ReportShowDT._jspService(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) ReportShowDT.jsp:23 void oracle.jsp.runtime.HttpJsp.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse) HttpJsp.java:119 void oracle.jsp.runtimev2.JspPageTable.service(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.String) JspPageTable.java:302 void oracle.jsp.runtimev2.JspServlet.internalService(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) JspServlet.java:407 void oracle.jsp.runtimev2.JspServlet.service(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) JspServlet.java:328 void javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse) HttpServlet.java:336 void com.evermind.server.http.ServletRequestDispatcher.invoke(javax.servlet.ServletRequest, javax.servlet.ServletResponse) ServletRequestDispatcher.java:684 void com.evermind.server.http.ServletRequestDispatcher.forwardInternal(javax.servlet.ServletRequest, javax.servlet.http.HttpServletResponse) ServletRequestDispatcher.java:269 boolean com.evermind.server.http.HttpRequestHandler.processRequest(com.evermind.server.ApplicationServerThread, com.evermind.server.http.EvermindHttpServletRequest, com.evermind.server.http.EvermindHttpServletResponse, java.io.InputStream, java.io.OutputStream, boolean) HttpRequestHandler.java:735 void com.evermind.server.http.HttpRequestHandler.run(java.lang.Thread) HttpRequestHandler.java:243 void com.evermind.util.ThreadPoolThread.run() ThreadPoolThread.java:64 Any suggestions what's wrong ? Thanks. Jeremias Maerki
Re: Embed font results in FontFormatException ?
On 18.11.2002 15:04:41 Dennis Myrén wrote: Hi. Do you have any advice for me now, to get the text elements rendered correctly? Just have a bit of patience (at most 1-2 days) until I have an improved Type 1 font loader. I'll send you a slightly altered PFB file offlist that you could check. This altered file is embedded correctly with FOP. Did you try to use my font in a PDF? Your font is ok. Sorry if bothering you all the time. Don't worry. I've got time now. Jeremias Maerki
Re: fo:external-graphic problem when using HTTPS - EntityResolver?
Currently there's no possibility to set or use an EntityResolver (or similar) but it's on the todo list. In the meantime you could try to set the baseURL in Java code like this: Configuration.put(baseDir, https://myserver/somedir;); But please be aware that this currently only works in the CVS version of FOP (branch 'fop-0_20_2-maintain'). The current release only support local directories, no URLs. This will be in the upcoming 0.20.5 release. On 19.11.2002 13:51:55 Johan Åbrandt wrote: Hi, I have the following external graphic declaration in a XML file: fo:external-graphic src=url('{$base-url}/images/logo.jpg') height=30pt width=170pt/ I render it to a servlet outputstream using: Driver driver; driver = new Driver( new InputSource( reader ), out ); driver.setRenderer( Driver.RENDER_PDF ); driver.run(); This works just fine when having the server configured for HTTP but when using HTTPS, it fails with error: Error while creating area : Error with image URL: unknown certificate and no base directory is specified I think this is because I am using a own generated certificate and not a real certificate from f ex Verisign. I know that I can either create my own SecurityManager (effectively disabling security), or use a real certificate. I would however like to circumvent all such hazzles and retrieve the image in some other means instead, intially I tried to use a custom EntityResolver, but I doesnt seem like it is used for image url resolution: i.e. driver = new Driver( new InputSource( reader ), out ); driver.setRenderer( Driver.RENDER_PDF ); XMLReader xmlReader = XMLReaderFactory.createXMLReader(); xmlReader.setEntityResolver( new CustomEntityResolver() ); driver.setXMLReader( xmlReader ); driver.run(); Does anyone have any tips how to get the EntityResolver approach to work, or know any other way to achieve something similar. Jeremias Maerki
Re: fo:external-graphic problem when using HTTPS - EntityResolver?
Are your images located on the same server as FOP? If yes, you could access the files directly by filesystem if you set baseDir to something like: Configuration.put(baseDir, C:\tomcat\webapps\webapp); Surely not a clean solution but faster than going via http/https and it could work for the moment. On 19.11.2002 14:19:33 Johan Åbrandt wrote: Hi Jeremias, Thank you for answering, I am already using urls, i.e http://host.domain.com/webapp/images/foo.gif works, but https://host.domain.com/webapp/images/foo.gif does not. Currently there's no possibility to set or use an EntityResolver (or similar) but it's on the todo list. Nice to hear, it would be usefull on occasion. Br - Johan Jeremias Maerki wrote: Currently there's no possibility to set or use an EntityResolver (or similar) but it's on the todo list. In the meantime you could try to set the baseURL in Java code like this: Configuration.put(baseDir, https://myserver/somedir;); But please be aware that this currently only works in the CVS version of FOP (branch 'fop-0_20_2-maintain'). The current release only support local directories, no URLs. This will be in the upcoming 0.20.5 release. On 19.11.2002 13:51:55 Johan Åbrandt wrote: Hi, I have the following external graphic declaration in a XML file: fo:external-graphic src=url('{$base-url}/images/logo.jpg') height=30pt width=170pt/ I render it to a servlet outputstream using: Driver driver; driver = new Driver( new InputSource( reader ), out ); driver.setRenderer( Driver.RENDER_PDF ); driver.run(); This works just fine when having the server configured for HTTP but when using HTTPS, it fails with error: Error while creating area : Error with image URL: unknown certificate and no base directory is specified I think this is because I am using a own generated certificate and not a real certificate from f ex Verisign. I know that I can either create my own SecurityManager (effectively disabling security), or use a real certificate. I would however like to circumvent all such hazzles and retrieve the image in some other means instead, intially I tried to use a custom EntityResolver, but I doesnt seem like it is used for image url resolution: i.e. driver = new Driver( new InputSource( reader ), out ); driver.setRenderer( Driver.RENDER_PDF ); XMLReader xmlReader = XMLReaderFactory.createXMLReader(); xmlReader.setEntityResolver( new CustomEntityResolver() ); driver.setXMLReader( xmlReader ); driver.run(); Does anyone have any tips how to get the EntityResolver approach to work, or know any other way to achieve something similar. Jeremias Maerki
Re: Rendering output
Not with FOP in its present state. You have to render both documents into separate PDFs and then merge them with some tool. You'll find links to iText and PJ at the bottom of the following page: http://xml.apache.org/fop/resources.html Can't you merge the FOs prior to do the rendering? That could also solve your problem. On 19.11.2002 15:11:42 Henrik Olsson wrote: Does any one know if its possible to get two fo trees in to one output (ex in to one pdf)? Jeremias Maerki
Re: AW: Invoice positions partial sums
You can prepend another stylesheet that just adds the sums to the xml. Then you convert modified XML to XSL:FO. Using JAXP/SAX you can easily chain these transformations. On 20.11.2002 15:44:14 Mirko Sertic wrote: Hello! sounds good. Unlikely it's not possible to change the structure of the xml data. It's fixed by our customer. Isn't there any other way? ( i think of faking around with the sum() funktion and node tests? ) Cheers Mirko -Ursprüngliche Nachricht- Von: Müller, Markus [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 20. November 2002 15:36 An: [EMAIL PROTECTED] Betreff: AW: Invoice positions partial sums Hi Mirko, when you provide the partial sums within the XML, you can work with markers. This would look like this: // -- the items all have a partialSum xsl:for-each select=item fo:table-row fo:table-cell fo:block fo:marker marker-class-name=carry xsl:value-of select=partialSum/ /fo:marker /fo:block /fo:table-cell /fo:table-row /xsl:for-each // -- find the last partial sum on the page and display on page bottom fo:static-content flow-name=xsl-region-after fo:block text-align=right xsl:textcarry from this page: /xsl:text fo:retrieve-marker retrieve-class-name=carry retrieve-boundary=page retrieve-position=last-ending-within-page/ /fo:block /fo:static-content I hope, this will help a little bit (you can find many samples etc. on the web just using google). Markus # -Ursprüngliche Nachricht- # Von: Mirko Sertic [mailto:[EMAIL PROTECTED] # Gesendet am: Mittwoch, 20. November 2002 14:11 # An: FOP-User (E-Mail) # Betreff: Invoice positions partial sums # # Hello! # # i'm working on a stylesheet that generates an invoice. I'd # like to have a # partial sum on the bottom of the first page of the invoice, when # it has more than one page. Has anybody done this before? # # Greetings # # Mirko # Jeremias Maerki
Re: Ant Task
There is one in org.apache.fop.tools. Look at docs/examples/build.xml on how to use it. Seems like we should document it On 20.11.2002 16:56:32 Howard Miller wrote: Hi, I can feel a FTFM coming on, but... Is there an existing Ant task for FOP. Have had a good dig around but can't find anything. Jeremias Maerki
Re: trying to extend FOP to handle Barcodes
I haven't done this before you I can try to give you some pointers: 1. Have a look at this page: http://xml.apache.org/fop/extensions.html 2. I'd implement your extension as fo:instream-foreign-object, like SVG is implemented. Example: fo:block fo:instream-foreign-object b:barcode xmlns:b=http://mybarcodeext;12345/b:barcode /fo:instream-foreign-object /fo:block 3. Have a look at the following classes as a template to add support for your extension: - org.apache.fop.svg.SVGObj - org.apache.fop.svg.SVGElement - org.apache.fop.svg.SVGArea - org.apache.fop.svg.SVGElementMapping (to register the extension) 4. Last but not least you will have to either change or subclass org.apache.fop.render.pcl.PCLRenderer to support your extension. The renderer is not really finished especially what SVG is concerned and that's why there is still something to do. Other renderers like PDF will help you to make it work. I hope that helps a bit. On 21.11.2002 03:58:53 Raffi Simon wrote: I am trying to add a new element called barcode ( fox:barcode/fox:barcode) to the PCL rendering FOP. I would like to be able to insert this into a table or block and have the parser to attach the correct pcl command that i will define, whenever it sees this element. For example if I do this: fo:blockfox:barcode12345/fox:barcode/fo:block I would like my output stream (pcl) to have the starting pcl command (to turn the barcode chip on the Hp printer on) print the digits that follow in the barcode format and then the closing PCL command (to turn off the chip on the printer) can anyone help me extend the FOP to do this. I am at a lose. Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: AbstractMethodError when trying to extend FOP
Turn on debug info in the build.xml and recompile FOP. Having line numbers will make it a lot easier for you to track down the problem. Looking at the source of Driver I guess you don't have a method addToBuilder(FOTreeBuilder) in your ElementMapping implementation. On 21.11.2002 22:25:24 Raffi Simon wrote: I follow the directions to extend FOP, I created a jar file with my classes and place a org.apache.fop.fo.ElementMapping file in the jar and when I run the FOP with my custom element I get the following. [INFO] FOP 0.20.4rc Exception in thread main java.lang.AbstractMethodError at org.apache.fop.apps.Driver.addElementMapping(Unknown Source) at org.apache.fop.apps.Driver.addElementMapping(Unknown Source) at org.apache.fop.apps.Driver.setupDefaultMappings(Unknown Source) at org.apache.fop.apps.Driver.init(Unknown Source) at org.apache.fop.apps.CommandLineStarter.run(Unknown Source) at org.apache.fop.apps.Fop.main(Unknown Source) Can anyone help? -Raf Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: AbstractMethodError when trying to extend FOP
AbstractMethodError means that a method on a class is called that is abstract. Compare your implementation with org.apache.fop.svg.SVGElementMapping. addToBuilder is just plain public and that's how it should be. Going to bed now...back in 9 hours. On 21.11.2002 22:51:38 Raffi Simon wrote: as a test, I took the ExtensionElementMapping.java file that comes with the sourse files and I added a system.out.println to the code and compiled it and placed it in the classpath, I still get the same exception. I do not think this has to do with my implementation. Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Bug when integrating with SAX?
The call to run() is not necessary. The transformation is started when the SAX startDocument() is called by the XSLT Transformer. On 22.11.2002 13:33:23 Matthias Brunner wrote: Hello, I am trying to use FOP by firing SAX events: fopDriver.setOutputStream(System.out); fopDriver.setRenderer(fopDriver.RENDER_XML); stylesheet.newTransformer().transform( new DOMSource(source), new SAXResult(fopDriver.getContentHandler()) ); fopDriver.run(); I get a NullPointerException when the formatting object tree is built. Am I doing anything wrong? Setting a logger does not help. When using the DefaultContentHandler instead of FOP's no error is reported. That's why I think it's a FOP bug. Software: FOP 0.20.4, Sun JDK 1.4.1_01, Linux Output: [ERROR] Logger not set [INFO] building formatting object tree [WARNING] Screen logger not set. [INFO] [1] [INFO] [2] javax.xml.transform.TransformerException: java.lang.NullPointerException at org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1226) Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Bug when integrating with SAX?
Mmm, probably, I think I remember some saying that Crimson doesn't work correctly. Namespace issues probably. Not sure. On 22.11.2002 14:19:50 Matthias Brunner wrote: On Friday 22 November 2002 13:39, Jeremias Maerki wrote: The call to run() is not necessary. The transformation is started when the SAX startDocument() is called by the XSLT Transformer. This statement is not reached. The exception is thrown in the line before (to make sure I deleted it - no effects). Could it be that it is because I am using crimson rather than xerces? And an older xalan version (as deployed with jdk 1.4.1)? Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Which logging library is needed to run fop 0.20.4 servlets
Logging has changed from 0.20.3 to 0.20.4. We were able to eliminate the need for logkit. Instead we use the logger interface from Avalon which also has a ConsoleLogger which became our new standard logger. I don't know if you really use the FOPServlet from the distribution, but if you do, you should also update the servlet when you upgrade FOP (because the logging has changed). Probably you have the old servlet that still wants to use a LogKit logger. Look in the contrib/servlet directory in the distribution. The libs you need to run the FOP Servlet are: fop.jar, batik.jar, avalon-framework*.jar. logkit.jar is not needed anymore. Look here for details about logging in 0.20.4: http://xml.apache.org/fop/embedding.html I hope this helps. On 22.11.2002 22:35:57 Ciot, Thierry wrote: I have searched the FAQ and the mail archive but could not find anything useful. Thanks in advance for answering this question. I am using fop 0.20.4 (fop-0.20.4rc). I cannot use fop within a servlet. I have tested with both tomcat 3.3.1 and Tomcat 4. I get the following error message java.lang.NoClassDefFoundError: org/apache/log/Hierarchy It turns out that the avalon jar file shipped with fop does not contain that class. I have tracked down Hierarchy to belong to the logkit project. I downloaded logkit 1.1 and put the jar file in the lib directory. Now I can proceed further but it still fails when trying to renderFO with the following error message: Location: /fop/servlet/fop Internal Servlet Error:java.lang.NoSuchMethodError: org.apache.fop.apps.Driver.setLogger(Lorg/apache/log/Logger;)V The method now has the following signature: org.apache.fop.apps.Driver.setLogger(org.apache.avalon.framework.logger.Logger); That's the reason for the NoSuchMethodError. This is probably because the setLogger requires a different method parameter. What lib do I need to run a fop servlet? Thierry. Location: /fop/servlet/fop Internal Servlet Error: java.lang.NoClassDefFoundError: org/apache/log/Hierarchy at FopServlet.doGet(FopServlet.java:53) at javax.servlet.http.HttpServlet.service(HttpServlet.java) at javax.servlet.http.HttpServlet.service(HttpServlet.java) snip/ Location: /fop/servlet/fopInternal Servlet Error:java.lang.NoSuchMethodError: org.apache.fop.apps.Driver.setLogger(Lorg/apache/log/Logger;)V at FopServlet.renderFO(FopServlet.java:94) at FopServlet.doGet(FopServlet.java:64) at javax.servlet.http.HttpServlet.service(HttpServlet.java) snip/ Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Unknown formatting object null^null
And you don't have that problem when running FOP from the command line? Could you try to rebuild FOP with debug info on (see build.xml, properties). You then get line numbers in stacktraces so it's simpler to identify the problem. And you have relatively new versions of Xerces and Xalan, right? On 22.11.2002 15:08:58 Matthias Kräuter wrote: Hello, I#180;ve got a problem with rendering an fo-file to pdf using an embedded Fop. I get the following exceptions. [reports] [INFO] building formatting object tree [reports] [DEBUG] setting up fonts [reports] [ERROR] Unknown formatting object null^null BUILD FAILED java.lang.NullPointerException at org.apache.fop.fo.FOTreeBuilder.startElement(Unknown Source) at org.apache.fop.tools.DocumentReader.parse(Unknown Source) at org.apache.fop.apps.Driver.render(Unknown Source) I tried out the hints in the list, but none of them really worked. I#180;m using FOP 0.20.4 with included Xalan and Xerces and Xerces Namespace-Awareness set explicitly to 'true'. My fo-File looks like that: ?xml version=1.0 encoding=UTF-8 standalone=no? fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format; fo:layout-master-set ... /fo:root Does someone know what I#180;m doing wrong? Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Font embending
It is implemented. I think you've got everything you need (embed-file attribute). See here: http://xml.apache.org/fop/fonts.html On 25.11.2002 18:51:01 Nyári Gyõzõ wrote: Hi! How can I embend fonts in the pdf? I've the emded-file param in the userconfig.xml. The faq writes: Provide$$$ It isn't implemented? Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Font embending
Are you sure your Arial font is really a Type 1 font? I've never seen Arial in Type 1 before. Are you sure you have an Arial.pfb and an Arial.pfm? I think you will more likely have a Arial.ttf which you have to specify in the embed-file attribute. That's the file you will have generated the font metrics from, right? If it is a Type 1 font, Dennis is right and you have to specify Arial.pfb, not Arial.pfm. Good luck! On 26.11.2002 09:23:06 Nyári Gyõzõ wrote: I've the embed-file param in the userconfig.xml file. I read up the config file with Options options = new Options(userconfig.xml); Then when I watch the file with Acrobat, it a message shows up: Unable to extract the embedded font 'ArialHU'. Some characters... userconfig.xml: font metrics-file=d:\pdflib\Arial1.xml kerning=yes embed-file=d:\pdflib\Arial1.pfm font-triplet name=ArialHU style=normal weight=normal/font-triplet /font Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Font embending
On 26.11.2002 09:25:12 Oleg Tkachenko wrote: Nyári Gyõzõ wrote: userconfig.xml: font metrics-file=d:\pdflib\Arial1.xml kerning=yes embed-file=d:\pdflib\Arial1.pfm Should be font metrics-file=d:\pdflib\Arial1.xml kerning=yes embed-file=d:\pdflib\Arial1.pfb Probably font embedding page should updated to provide an example of type1 font registration in userconfig.xml. Will do. Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]