Re: Embedding FOP in SVG in FOP?
Adam Augusta wrote: Apparently FOP doesn't support rotating areas. The compliance page suggests using SVG, but then I'd have to have radically different transforms for handling block spacing, progression, etc just because an area was rotated. To that end, I was thinking of generating the area in FOP, and somehow saving that output and giving it to SVG to rotate, which I would in turn embed in FOP. Has anyone had experience with this or other, hopefully better, workarounds? Hmm, maybe a multi-stage sollution: - Extract the rotated content and render into an SVG. Beware, the SVG renderer has a few more bugs than the other. - Add a rotation transformation to the SVG - Render the rest of the content, referring to the SVG. Of course estimating the size of the page master of the rotated content as well as the SVG dimensions maz be non-trivial, also multi-page rotated content content. If the rotated content isn't mixed with non-rotated content on the same page, it may be more convenient to use a rotated page master instead (the usual answer to "I want landscape"). If there are both normal and landscape page sequences, post-processing with iText will clean it up for on-screen viewers. J.Pietschmann - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Embedding FOP in SVG in FOP?
The work-around obviously only works for simple cases. In FOP 0.20.5 there's no chance to do what you suggest. Even with the current development code I doubt this would be so simple. I don't think this is even on the task list. Theoretically, you could try to create a Batik extension to handle FO elements. You could then write a simple wrapper around the FO snippet to create a full XSL-FO document that could be rendered by FOP's AWT renderer to the Graphics2D interface given by Batik. But this is very adventurous. It's probably better on the long run to somehow support the current development so FOP 1.0 gets into arm's reach. On 02.07.2004 19:38:50 Adam Augusta wrote: > Apparently FOP doesn't support rotating areas. The compliance page > suggests using SVG, but then I'd have to have radically different > transforms for handling block spacing, progression, etc just because an > area was rotated. > > To that end, I was thinking of generating the area in FOP, and somehow > saving that output and giving it to SVG to rotate, which I would in > turn embed in FOP. Has anyone had experience with this or other, > hopefully better, workarounds? Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Embedding FOP in SVG in FOP?
Apparently FOP doesn't support rotating areas. The compliance page suggests using SVG, but then I'd have to have radically different transforms for handling block spacing, progression, etc just because an area was rotated. To that end, I was thinking of generating the area in FOP, and somehow saving that output and giving it to SVG to rotate, which I would in turn embed in FOP. Has anyone had experience with this or other, hopefully better, workarounds? -Adam - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Embedding FOP, PDF Encryption & Custom fonts
Thank you both for the update. -Original Message- From: J.Pietschmann [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 15, 2003 6:13 AM To: [EMAIL PROTECTED] Subject: Re: Embedding FOP, PDF Encryption & Custom fonts Chris Bowditch wrote: > The code in HEAD of CVS has PDF encryption fully implemented. However, > it is lacking support for key FO constructs, and is currently unusable > in real world scenarios. Testing and detailed new bug reports are welcome though. I just can't make promises anything gets fixed soon. J.Pietschmann - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Embedding FOP, PDF Encryption & Custom fonts
Chris Bowditch wrote: The code in HEAD of CVS has PDF encryption fully implemented. However, it is lacking support for key FO constructs, and is currently unusable in real world scenarios. Testing and detailed new bug reports are welcome though. I just can't make promises anything gets fixed soon. J.Pietschmann - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Embedding FOP, PDF Encryption & Custom fonts
From: Johannes Stuermer <[EMAIL PROTECTED]> > No. Encryption won't be fully implemented in the maintenance branch. Is there another branch that does have it implemented? The code in HEAD of CVS has PDF encryption fully implemented. However, it is lacking support for key FO constructs, and is currently unusable in real world scenarios. Chris _ Hotmail messages direct to your mobile phone http://www.msn.co.uk/msnmobile - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Embedding FOP, PDF Encryption & Custom fonts
> No. Encryption won't be fully implemented in the maintenance branch. Is there another branch that does have it implemented? Thanks -Original Message- From: J.Pietschmann [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 14, 2003 4:55 PM To: [EMAIL PROTECTED] Subject: Re: Embedding FOP, PDF Encryption & Custom fonts Johannes Stuermer wrote: > Has there been any movement in this area? No. Encryption wount be fully implemented in the maintenance branch. > Can this problem be avoided by > using Adobe fonts? If you mean "built-in", then yes, encryption works if you use one of the built-in default fonts (because they are not embedded). J.Pietschmann - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Embedding FOP, PDF Encryption & Custom fonts
Johannes Stuermer wrote: Has there been any movement in this area? No. Encryption wount be fully implemented in the maintenance branch. Can this problem be avoided by using Adobe fonts? If you mean "built-in", then yes, encryption works if you use one of the built-in default fonts (because they are not embedded). J.Pietschmann - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Embedding FOP, PDF Encryption & Custom fonts
When the PDF file is encrytped, embedded fonts are not rendered correctly. The message "unable to extract embedded font xxx" appears. This issue has been discussed a few months back, with the conclusion: "Known problem. Encryption in the maintenance branch is not completely finished" Has there been any movement in this area? Can this problem be avoided by using Adobe fonts? Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Embedding FOP, PDF Encryption & Custom fonts
damn'! got me again ;) dl'ed the wrong branch (still got to get used to the cvs tool... ) thx for another helpful hint greetz, ald -Original Message- From: Jeremias Maerki [mailto:[EMAIL PROTECTED] Sent: maandag 23 juni 2003 20:05 To: [EMAIL PROTECTED] Subject: Re: Embedding FOP, PDF Encryption & Custom fonts That hasn't changed as far as I know. Are you sure you got the maintenance branch and not the redesign/trunk/HEAD? On 23.06.2003 19:26:11 Andreas Delmelle wrote: > btw : switched to the latest version of the 'maintain' branch, but > the way the custom config xml is processed seems to differ from the > latest distribution version. > > any helpful hints on this one? Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Embedding FOP, PDF Encryption & Custom fonts
That hasn't changed as far as I know. Are you sure you got the maintenance branch and not the redesign/trunk/HEAD? On 23.06.2003 19:26:11 Andreas Delmelle wrote: > btw : switched to the latest version of the 'maintain' branch, but > the way the custom config xml is processed seems to differ from the > latest distribution version. > > any helpful hints on this one? Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Embedding FOP, PDF Encryption & Custom fonts
i get the picture... thx for the info. ( esp. for pointing out that a different editor might drop this object; sth i hadn't really considered ) btw : switched to the latest version of the 'maintain' branch, but the way the custom config xml is processed seems to differ from the latest distribution version. any helpful hints on this one? thx in advance. greetz, ald -Original Message- From: Jeremias Maerki [mailto:[EMAIL PROTECTED] Sent: maandag 23 juni 2003 11:19 To: [EMAIL PROTECTED] Subject: Re: Embedding FOP, PDF Encryption & Custom fonts What kind of signature/verification? A cryptographic signature inside the PDF to authenticate the generator of the PDF? This is already standardized by Adobe. PDF is designed to be extensible. Therefore it is perfectly valid to add custom streams/objects to the PDF. But you must be prepared that a PDF editor may drop the object if it saves the PDF again. And of course, you need to provide a way to support your proprietary extension. Better stick to standards. On 22.06.2003 12:26:04 Andreas Delmelle wrote: > also, i'm considering the option of creating an > additional content-stream, that could contain a > signature for verification. > > is it possible to include an object in the pdf that > would be left alone by other readers ( but could be > used, perhaps as a form of FOP-specific verification ) > and does this even make sense? Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Embedding FOP, PDF Encryption & Custom fonts
What kind of signature/verification? A cryptographic signature inside the PDF to authenticate the generator of the PDF? This is already standardized by Adobe. PDF is designed to be extensible. Therefore it is perfectly valid to add custom streams/objects to the PDF. But you must be prepared that a PDF editor may drop the object if it saves the PDF again. And of course, you need to provide a way to support your proprietary extension. Better stick to standards. On 22.06.2003 12:26:04 Andreas Delmelle wrote: > also, i'm considering the option of creating an > additional content-stream, that could contain a > signature for verification. > > is it possible to include an object in the pdf that > would be left alone by other readers ( but could be > used, perhaps as a form of FOP-specific verification ) > and does this even make sense? Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Embedding FOP, PDF Encryption & Custom fonts
That's the redesign. You will want to get the branch with tag "fop-0_20_2-maintain". See: http://xml.apache.org/fop/dev/ On 22.06.2003 15:07:20 Andreas Delmelle wrote: > switched to latest dev cvs snapshot. > > trouble now is i don't have the apache.commons package. > ( imported in AbstracPDFStream.java ) > > anyone know where to get it? Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Embedding FOP, PDF Encryption & Custom fonts
switched to latest dev cvs snapshot. trouble now is i don't have the apache.commons package. ( imported in AbstracPDFStream.java ) anyone know where to get it? thx, ald -Original Message- From: Jeremias Maerki [mailto:[EMAIL PROTECTED] Sent: zondag 22 juni 2003 9:19 To: [EMAIL PROTECTED] Subject: Re: Embedding FOP, PDF Encryption & Custom fonts On 21.06.2003 12:45:06 Andreas Delmelle wrote: > while embedding FOP using embedded TrueType & implementing PDF > encryption, > stumbled upon the following (Acrobat Reader 5.1) : > > - - unable to extract embedded font ... That's the missing ToUnicode functionality that was discussed a few days ago. It looks like this is becoming a major topic. > - - also the producer (& author / title / date - added myself) > properties in the PDFInfo > produce weird results > anyone encounter this problem yet? Known problem. Encryption in the maintenance branch is not completely finished. Dictionary strings don't get encrypted like they should. This is fixed in the redesign, however. But that won't help you right now. Either someone has to complete the encryption part or we have to switch the the PDF library from the redesign. Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Embedding FOP, PDF Encryption & Custom fonts
's allright. no hurry. another side-effect : on pressing the OK button in the doc properties summary screen, you get the message that 'this operation is not allowed' ( maybe caused by the fact that this screen is a restricted version of the one in the full Acrobat Version & issues a command on pressing that button which is not allowed under the applied restrictions? ) also, i'm considering the option of creating an additional content-stream, that could contain a signature for verification. is it possible to include an object in the pdf that would be left alone by other readers ( but could be used, perhaps as a form of FOP-specific verification ) and does this even make sense? greetz, ald -Original Message- From: Jeremias Maerki [mailto:[EMAIL PROTECTED] Sent: zondag 22 juni 2003 9:19 To: [EMAIL PROTECTED] Subject: Re: Embedding FOP, PDF Encryption & Custom fonts On 21.06.2003 12:45:06 Andreas Delmelle wrote: > while embedding FOP using embedded TrueType & implementing PDF > encryption, > stumbled upon the following (Acrobat Reader 5.1) : > > - - unable to extract embedded font ... That's the missing ToUnicode functionality that was discussed a few days ago. It looks like this is becoming a major topic. > - - also the producer (& author / title / date - added myself) > properties in the PDFInfo > produce weird results > anyone encounter this problem yet? Known problem. Encryption in the maintenance branch is not completely finished. Dictionary strings don't get encrypted like they should. This is fixed in the redesign, however. But that won't help you right now. Either someone has to complete the encryption part or we have to switch the the PDF library from the redesign. Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Embedding FOP, PDF Encryption & Custom fonts
If u don't use custom fonts, code like in my earlier message should do the trick. ( Create an options Hashmap & use driver.getRenderer().setOptions(...) ). Only downside for the moment is that the producer info will get scrambled, but as this is a mere detail... The supplied restrictions are fully & correctly applied though. greetz, ald -Original Message- From: Chris Faulkner [mailto:[EMAIL PROTECTED] Sent: zondag 22 juni 2003 11:00 To: [EMAIL PROTECTED] Subject: RE: Embedding FOP, PDF Encryption & Custom fonts Hello all I am already using FOP to create PDF documents in a servlet environment. I would like to encrypt these documents. I can see on the website that there are instructions to create encrypted documents using the command line tool - how can I use the utilities in a servlet ? Thanks Chris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Embedding FOP, PDF Encryption & Custom fonts
Hello all I am already using FOP to create PDF documents in a servlet environment. I would like to encrypt these documents. I can see on the website that there are instructions to create encrypted documents using the command line tool - how can I use the utilities in a servlet ? Thanks Chris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Embedding FOP, PDF Encryption & Custom fonts
On 21.06.2003 12:45:06 Andreas Delmelle wrote: > while embedding FOP using embedded TrueType & implementing PDF > encryption, > stumbled upon the following (Acrobat Reader 5.1) : > > - - unable to extract embedded font ... That's the missing ToUnicode functionality that was discussed a few days ago. It looks like this is becoming a major topic. > - - also the producer (& author / title / date - added myself) > properties in the PDFInfo > produce weird results > anyone encounter this problem yet? Known problem. Encryption in the maintenance branch is not completely finished. Dictionary strings don't get encrypted like they should. This is fixed in the redesign, however. But that won't help you right now. Either someone has to complete the encryption part or we have to switch the the PDF library from the redesign. Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Embedding FOP, PDF Encryption & Custom fonts
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 while embedding FOP using embedded TrueType & implementing PDF encryption, stumbled upon the following (Acrobat Reader 5.1) : - - unable to extract embedded font ... - - also the producer (& author / title / date - added myself) properties in the PDFInfo produce weird results code : driver.setRenderer(Driver.RENDER_PDF); log.info( "Renderer set..." ); driver.getRenderer().setAuthor( author ); driver.getRenderer().setTitle( title ); opt = new java.util.HashMap(); opt.put( "allowEditContent", "FALSE" ); opt.put( "allowPrint", "FALSE" ); log.info( "Options created..." ); driver.getRenderer().setOptions(opt); anyone encounter this problem yet? greetz ald -BEGIN PGP SIGNATURE- Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com> iQA/AwUBPvQ3J9Bw/OvTa+XUEQIzMwCeNTL8S61/nij4s254OFf/OeaFAEgAnikH mj+rkkPb1j95uQQtxHjaJ7T2 =TNu7 -END PGP SIGNATURE- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: font and embedding FOP question
Steve Albin wrote: I would like to use additional fonts with FOP, where FOP is embedded in a Servlet. The instructions at http://xml.apache.org/fop/fonts.html say to use the -c conf/userconfig.xml option on the command line in order for FOP to find custom font information. However how do you specify this information when FOP is embedded (e.g. when using the FOP APIs)? See http://xml.apache.org/fop/faq.html#usercfg J.Pietschmann - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
font and embedding FOP question
I would like to use additional fonts with FOP, where FOP is embedded in a Servlet. The instructions at http://xml.apache.org/fop/fonts.html say to use the –c conf/userconfig.xml option on the command line in order for FOP to find custom font information. However how do you specify this information when FOP is embedded (e.g. when using the FOP APIs)? Thanks, Steve
RE: embedding fop
Try this http://cvs.apache.org/viewcvs.cgi/xml-fop/examples/embedding/java/embedding/Attic/ -Original Message-From: Marisol Garcia [mailto:[EMAIL PROTECTED]Sent: 10 Feb 2003 11:50To: [EMAIL PROTECTED]Subject: embedding fop Hello, Where could I find the source of the examples: ExampleFO2PDF.java, ExampleXML2FO.java, ExampleXML2PDF.java, ExampleObj2XML.java and ExampleObj2PDF.java ? Thanks in advance. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
embedding fop
Hello, Where could I find the source of the examples: ExampleFO2PDF.java, ExampleXML2FO.java, ExampleXML2PDF.java, ExampleObj2XML.java and ExampleObj2PDF.java ? Thanks in advance.
Re: embedding FOP
Lucian Opris wrote: Could anyone explain step by step, how can I embed userconfig.xml in FopServlet? I'm using Tomcat webserver. I'm assuming, I have to re-build some java file but I don't know which ones. Not really. It's a faq, see http://xml.apache.org/fop/faq.html#faq-N1030C -- Oleg Tkachenko eXperanto team Multiconn Technologies, Israel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: embedding FOP
Hi, Could anyone explain step by step, how can I embed userconfig.xml in FopServlet? I'm using Tomcat webserver. I'm assuming, I have to re-build some java file but I don't know which ones. Thanks in advance for any help. P.S.Exemple of FOPServlet would be great Lucian Opris
RE: embedding FOP
this is a problem in your web.xml. the elements must be in the order listed in the error message. This is not a FOP problem - you will get better support on the tomcat-user list http://jakarta.apache.org/site/mail.html Charlie -Original Message-From: Boris Rousseau [mailto:[EMAIL PROTECTED]Sent: Wednesday, December 11, 2002 7:26 AMTo: [EMAIL PROTECTED]Subject: embedding FOP All, Sorry about the newby question, but I have some trouble with the FOPServlet. I managed to build the .war. However when I put it under my \Tomcat 4.1\webapps directory and I start Tomcat I get the following error in the "Start Tomcat" command prompt: "11-Dec-2002 12:18:57 org.apache.commons.digester.Digester errorSEVERE: Parse Error at line 21 column 11: The content of element type "web-app"must match "(icon?,display-name?,description?,distributable?,context-param*,servlet*,servlet-mapping*,session-config?,mime-mapping*,welcome-file-list?,error-page*,taglib*,resource-ref*,security-constraint*,login-config?,security-role*,env-entry*,ejb-ref*)"." ... Can you point me out what is wrong ? Regards, Boris
RE: embedding FOP
Hi, This is an example of my web.xml file : ... servletpdf Impression des rapports au format PDF com.sncf.margo.testRapport2.FopServlet ... servletpdf /servletpdf You must put all
embedding FOP
All, Sorry about the newby question, but I have some trouble with the FOPServlet. I managed to build the .war. However when I put it under my \Tomcat 4.1\webapps directory and I start Tomcat I get the following error in the "Start Tomcat" command prompt: "11-Dec-2002 12:18:57 org.apache.commons.digester.Digester errorSEVERE: Parse Error at line 21 column 11: The content of element type "web-app"must match "(icon?,display-name?,description?,distributable?,context-param*,servlet*,servlet-mapping*,session-config?,mime-mapping*,welcome-file-list?,error-page*,taglib*,resource-ref*,security-constraint*,login-config?,security-role*,env-entry*,ejb-ref*)"." ... Can you point me out what is wrong ? Regards, Boris
Re: embedding FOP in Java
Boris Rousseau wrote: Do you always need a servlet to run an embedded FOP in a Java ? Not really, you can embed FOP anywhere from standalone application to ejb. FOPServlet is just an example of how to embed, useful though. Obviously I don't want to use a servlet but rather use a Web Service to be able to submit XML documents and get back PDFs. And what's you problem? You know how to embed FOP already, so write your web service and embed FOP there. -- Oleg Tkachenko eXperanto team Multiconn Technologies, Israel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: embedding FOP in Java
All, Do you always need a servlet to run an embedded FOP in a Java ? I am a bit confused with the example provided in fop-0.20.4. (an API documentation of the Driver, XSLTInputHandler, MessageHandler classes would help a lot) Obviously I don't want to use a servlet but rather use a Web Service to be able to submit XML documents and get back PDFs. Regards, Boris - Original Message - From: "Oleg Tkachenko" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, December 09, 2002 6:13 PM Subject: Re: embedding FOP in Java > *This message was transferred with a trial version of CommuniGate(tm) Pro* > Boris Rousseau wrote: > > > Unfortunately when I compile it, I get the following error: > > fop.java:19: cannot resolve symbol > > symbol : constructor XSLTInputHandler (java.lang.String,java.lang.String) > > location: class org.apache.fop.apps.XSLTInputHandler > > InputHandler inputHandler = new XSLTInputHandler(xmlFile, xslFile); > > ^ > > 1 error > > > > Can you help me ? > The only constructor XSLTInputHandler class has is > public XSLTInputHandler(File xmlfile, File xsltfile), there is no > XSLTInputHandler (java.lang.String,java.lang.String) constructor. > > -- > Oleg Tkachenko > eXperanto team > Multiconn Technologies, Israel > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: embedding FOP in Java
[EMAIL PROTECTED] wrote: Now my xml has croatian character and those are showen as #. I read documentation and it says that fonts must be avaliable on the platform. Now I don't understand this since I have croatina locale set and I can view pdf files that have croatian characters. See http://xml.apache.org/fop/faq.html#faq-N103ED and http://xml.apache.org/fop/fonts.html. -- Oleg Tkachenko eXperanto team Multiconn Technologies, Israel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: embedding FOP in Java
Boris Rousseau wrote: Unfortunately when I compile it, I get the following error: fop.java:19: cannot resolve symbol symbol : constructor XSLTInputHandler (java.lang.String,java.lang.String) location: class org.apache.fop.apps.XSLTInputHandler InputHandler inputHandler = new XSLTInputHandler(xmlFile, xslFile); ^ 1 error Can you help me ? The only constructor XSLTInputHandler class has is public XSLTInputHandler(File xmlfile, File xsltfile), there is no XSLTInputHandler (java.lang.String,java.lang.String) constructor. -- Oleg Tkachenko eXperanto team Multiconn Technologies, Israel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
embedding FOP in Java
Sorry for beeing forced to ask this question, I have created I java class that takes xml file and xsl file and creates pdf. Now my xml has croatian character and those are showen as #. I read documentation and it says that fonts must be avaliable on the platform. Now I don't understand this since I have croatina locale set and I can view pdf files that have croatian characters. I have tried to use different font familises for fo:block tag. (Arial, Symbol etc ...) What should I do to make it work. If you can explain it to me step by step I would be very thankful. My method is public void createPdf(String xml, String xslPath, String outputPdfPath) throws TransformerConfigurationException, TransformerException, FileNotFoundException, FOPException, IOException { Logger log = new ConsoleLogger(ConsoleLogger.LEVEL_WARN); MessageHandler.setScreenLogger(log); FileOutputStream fos=new FileOutputStream(outputPdfPath); //Options options = new Options(new File("c: \\Adis\\MedicSoft\\MedicsoftClient\\GUI\\config\\print\\userconfig.xml")); Driver driver=new Driver(); driver.setLogger(log); driver.setOutputStream(fos); driver.setRenderer(Driver.RENDER_PDF); StreamSource xmlStreamSource=new StreamSource(new StringReader(xml)); Transformer transformer=TransformerFactory.newInstance ().newTransformer(new StreamSource(xslPath)); transformer.transform(xmlStreamSource, new SAXResult(driver.getContentHandler())); fos.close(); } and xsl that is used for fop is very easy http://www.w3.org/1999/XSL/Transform"; xmlns:fo="http://www.w3.org/1999/XSL/Format";> http://www.w3.org/1999/XSL/Format";> - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: embedding FOP in Java
i use this method and it works fine public void createPdf(String xml, String xslPath, String outputPdfPath) throws TransformerConfigurationException, TransformerException, FileNotFoundException, FOPException, IOException { MessageHandler.setScreenLogger(log); FileOutputStream fos=new FileOutputStream(outputPdfPath); Driver driver=new Driver(); driver.setLogger(log); driver.setOutputStream(fos); driver.setRenderer(Driver.RENDER_PDF); StreamSource xmlStreamSource=new StreamSource(new StringReader(xml)); Transformer transformer=TransformerFactory.newInstance().newTransformer(new StreamSource(xslPath)); transformer.transform(xmlStreamSource, new SAXResult(driver.getContentHandler())); fos.close(); } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
embedding FOP in Java
Hello, I am using the following file embedding fop: "import org.apache.fop.apps.Driver;import org.apache.fop.layout.Page;import org.apache.fop.apps.Version;import org.apache.fop.apps.XSLTInputHandler;import org.apache.fop.apps.InputHandler;import org.xml.sax.*;import org.apache.fop.messaging.MessageHandler;import java.io.*; //import org.apache.fop.apps.InputHandler;//import org.apache.fop.apps.XSLTInputHandler; public class fop{ public void fop(String xmlFile, String xslFile, String outFile){ Driver driver = new Driver(); driver.setRenderer(Driver.RENDER_PDF); InputHandler inputHandler = new XSLTInputHandler(xmlFile, xslFile); XMLReader parser = inputHandler.getParser(); driver.setOutputStream(new FileOutputStream(outFile)); driver.render(parser, inputHandler.getInputSource());}}" Unfortunately when I compile it, I get the following error: fop.java:19: cannot resolve symbolsymbol : constructor XSLTInputHandler (java.lang.String,java.lang.String)location: class org.apache.fop.apps.XSLTInputHandler InputHandler inputHandler = new XSLTInputHandler(xmlFile, xslFile); ^1 error Can you help me ? I would also like to embed the FOP as a Web Service. Can you give me any pointers to tutorials on this ? Regards, Boris
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
Embedding FOP within Servlet
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
problem with embedding fop solved
We used the Oracle JDeveloper to edit the Java application. Some of the libraries supplied by FOP are already available in the Oracle Java Packages. We had to remove the Oracle Java Packages and to add only the FOP Packages and the problems were solved. The code from Mr.Fischer worked: import org.apache.log.*; public class EmbeddingFOP_1 { public static void main(String[] args) throws Exception { try { javax.xml.transform.stream.StreamSource xmlSource=new javax.xml.transform.stream.StreamSource(new java.io.File("D:\\glossary.xml")); javax.xml.transform.stream.StreamSource xslSource=new javax.xml.transform.stream.StreamSource(new java.io.File("D:\\glossary.xsl")); javax.xml.transform.Transformer transformer=javax.xml.transform.TransformerFactory.newInstance().newTransformer(xslSource); Logger log; Hierarchy hierarchy = Hierarchy.getDefaultHierarchy(); log = hierarchy.getLoggerFor("fop"); log.setPriority(Priority.WARN); org.apache.fop.apps.Driver driver=new org.apache.fop.apps.Driver(); driver.setLogger(log); driver.setOutputStream(new java.io.FileOutputStream("D:\\glossary.pdf")); driver.setRenderer(org.apache.fop.apps.Driver.RENDER_PDF); transformer.transform(xmlSource,new javax.xml.transform.sax.SAXResult(driver.getContentHandler())); } catch( Exception e ) { e.printStackTrace(System.out); } } } The following code also worked: import java.io.*; import org.xml.sax.InputSource; import org.xml.sax.XMLReader; import org.apache.fop.apps.Driver; import org.apache.fop.apps.Version; import org.apache.fop.apps.*; import org.apache.log.*; public class EmbeddingFOP_2 { public static void main(String[] args) throws Exception { File fxml=new File("D:\\glossary.xml"); File fxsl=new File("D:\\glossary.xsl"); File fpdf=new File("D:\\glossary.pdf"); Logger log; Hierarchy hierarchy = Hierarchy.getDefaultHierarchy(); log = hierarchy.getLoggerFor("fop"); log.setPriority(Priority.WARN); Driver dr=new Driver(); dr.setLogger(log); dr.setRenderer(Driver.RENDER_PDF); InputHandler ih=new XSLTInputHandler(fxml,fxsl); XMLReader p=ih.getParser(); dr.setOutputStream(new FileOutputStream(fpdf)); dr.render(p,ih.getInputSource()); } } Thanks to all for the help, Marianne and Viktor.
Re: embedding fop
On 2002.04.04 22:08 J.Pietschmann wrote: > Mihael Knezevic wrote: > > hi, > > > > has someone been successfull on embedding fop in his/her own > application. > > i'm trying but it doesn't work. there are some error messages: > > [ERROR]: Logger not set > > [DEBUG]: using SAX parser org.apache.xerces.parsers.SAXParser > > SystemId Unknown; Line 0; Column 0; Couldn't create PDF file. > > File "myfile" not found. > > but when use fop on the same xml file, it works. > > A lot of people have embedded FOP successfully. > You'll have to supply some more information to get a useful > answer. > Your problem has probably something to do with resolving > relative URIs. sorry for me being so ignorant. my problem was the relative URI. > > and perhaps someone can enlighten my on what SystemId is? > If you don't know what your SystemId is, how should I? that's no answer to my question, but as the error doesn't appear it doesn't really matter cause i don't have any time for research the beauty and wealth of xsl-fo and fop. i'm just happy it is working. thanx for all your help. mk
Re: embedding fop
Mihael Knezevic wrote: hi, has someone been successfull on embedding fop in his/her own application. i'm trying but it doesn't work. there are some error messages: [ERROR]: Logger not set [DEBUG]: using SAX parser org.apache.xerces.parsers.SAXParser SystemId Unknown; Line 0; Column 0; Couldn't create PDF file. File "myfile" not found. but when use fop on the same xml file, it works. A lot of people have embedded FOP successfully. You'll have to supply some more information to get a useful answer. Your problem has probably something to do with resolving relative URIs. If you use the command line FOP application, the current working directory is used for resolving relative URIs. This means, if you simply give a file name, the file will be searched in the current directory. The servlet engine probably has some other CWD, so it won't find the file. Try to specify the absolute pathname of the file, like /my/dir/myfile or C:\my\dir\myfile and perhaps someone can enlighten my on what SystemId is? If you don't know what your SystemId is, how should I? J.Pietschmann
embedding fop
hi, has someone been successfull on embedding fop in his/her own application. i'm trying but it doesn't work. there are some error messages: [ERROR]: Logger not set [DEBUG]: using SAX parser org.apache.xerces.parsers.SAXParser SystemId Unknown; Line 0; Column 0; Couldn't create PDF file. File "myfile" not found. but when use fop on the same xml file, it works. any idea? and perhaps someone can enlighten my on what SystemId is? thanx. mk
Re: embedding fop in php
Hi Sam, > but it is using CommandLine, and i am using fop 0.20.2, and since 0.19 > there is no class CommandLine anymore (correct me, if i´m wrong) I don't know v0.19, but in 0.20.2 you've got a class org.apache.fop.apps.Fop which you can probably use without much hassle like you used CommandLine before. Regards, Sebastian Will __ Darf es ein bisschen mehr sein? Mehr Speicher, mehr Mail, mehr Erlebnis, mehr Prämie, mehr WEB.DE. Der WEB.DE Club - http://club.web.de
embedding fop in php
Hi, i am trying to embed fop in php. i ´ve got an example: fo2pdf.php,v 1.2 2001/11/20 17:28:47 by Christian Stocker <[EMAIL PROTECTED]> but it is using CommandLine, and i am using fop 0.20.2, and since 0.19 there is no class CommandLine anymore (correct me, if i´m wrong) function run($fo, $pdf = "", $DelFo = False) { if (!$pdf) $pdf = tempnam($this->tmpdir, $this->tmppdfprefix); $this->pdf = $pdf; $this->fo = $fo; $options = array($this->fo, $this->pdf); $java = new Java("org.apache.fop.apps.CommandLine", $options); $java->run(); if ($DelFo) { $this->deleteFo($fo); } } so what i need, is a how to, for an absolute java-beginner, to embed fop in php. (i heard this should be faster than command line) thanx in anticipation Sam
Re: Embedding FOP
I've now gotten a bit further. I start Xalan transforming some XML into a SAXResult object constructed with the FOP Driver's Content Handler. This gave me a NullPointerException, because the Driver only sets the StreamRenderer on the FOTreeBuilder when calling one of the two render() methods. (Which is not necesarry when using the ContentHandler instead.) Therefore I used the following hack to make things work: StreamRenderer streamRenderer = new StreamRenderer(new FileOutputStream("c:\\baz.pdf"), driver.getRenderer()); ((FOTreeBuilder)handler).setStreamRenderer(streamRenderer); But I still get a NullPointerException. I cannot, however, see where it is thrown, as Xalan eats all original exceptions. If serialize the excact same series of SAX events into a file and run FOP as a command-line program on this file - everything works dandy. So what this boils down to is: I can get FOP to process the XML as long as it comes from an XMLReader (Xerces), but it won't process the excact same XML when it comes from Xalan. I suspect that the problem could be namespace-related. But what can I do differently with the Driver/FOTreeBuilder? -dennis Dennis Thrysoe - Netnord A/S wrote: > Keiron Liddle wrote: > >> On 2001.12.22 21:53 Dennis Thrysoe - Netnord A/S wrote: >> >>> Hi, >>> >>> Is there an easy way of embedding FOP, including a stylesheet >>> transformation? >>> >>> Using the Driver class doesn't seem to allow this (or did I miss >>> something?). >>> >>> If I use Xalan to generate results to the ContentHandler, that the >>> Driver instance returns, I get an error: >>> >>> Unknown formatting object http://www.w3.org/XSL/Format/1.0^root >> >> >> >> You have the wrong namespace, it should be: >> http://www.w3.org/1999/XSL/Format > > > That's what I originally tried, but then I got (the same): > > building formatting object tree > setting up fonts > WARNING: Unknown formatting object http://www.w3.org/1999/XSL/Format^root > > > Any help still very much appreciated... > > -dennis
Re: Embedding FOP
Keiron Liddle wrote: On 2001.12.22 21:53 Dennis Thrysoe - Netnord A/S wrote: Hi, Is there an easy way of embedding FOP, including a stylesheet transformation? Using the Driver class doesn't seem to allow this (or did I miss something?). If I use Xalan to generate results to the ContentHandler, that the Driver instance returns, I get an error: Unknown formatting object http://www.w3.org/XSL/Format/1.0^root You have the wrong namespace, it should be: http://www.w3.org/1999/XSL/Format That's what I originally tried, but then I got (the same): building formatting object tree setting up fonts WARNING: Unknown formatting object http://www.w3.org/1999/XSL/Format^root Any help still very much appreciated... -dennis
Re: Embedding FOP
On 2001.12.22 21:53 Dennis Thrysoe - Netnord A/S wrote: Hi, Is there an easy way of embedding FOP, including a stylesheet transformation? Using the Driver class doesn't seem to allow this (or did I miss something?). If I use Xalan to generate results to the ContentHandler, that the Driver instance returns, I get an error: Unknown formatting object http://www.w3.org/XSL/Format/1.0^root You have the wrong namespace, it should be: http://www.w3.org/1999/XSL/Format
Embedding FOP
Hi, Is there an easy way of embedding FOP, including a stylesheet transformation? Using the Driver class doesn't seem to allow this (or did I miss something?). If I use Xalan to generate results to the ContentHandler, that the Driver instance returns, I get an error: Unknown formatting object http://www.w3.org/XSL/Format/1.0^root Do I need a DOCTYPE or something here? It would be really great if FOP could take care of the transformation before rendering - just as with the -XSL commandline argument. Any help appreciated! -dennis
Embedding FOP problem
Hello, I'm experiencing problems to include FOP in my java app. Here is my code : public static void main(java.lang.String[] args) { try{ String aFilePath = new String("D:/fop/normal.fo"); ByteArrayOutputStream out = new ByteArrayOutputStream(); Driver driver = new Driver(new InputSource(aFilePath), out); driver.run(); } catch(Throwable t){ t.printStackTrace(); } } Here is the output : java.lang.InternalError: (Ex02) An error has occurred. java.lang.Throwable(java.lang.String) java.lang.Error(java.lang.String) java.lang.VirtualMachineError(java.lang.String) java.lang.InternalError(java.lang.String) org.apache.fop.apps.Driver() org.apache.fop.apps.Driver() org.apache.fop.apps.Driver(org.xml.sax.InputSource, java.io.OutputStream) void org.apache.fop.apps.Svg2PDF.main(java.lang.String []) Any help appreciated, Jean-Michel