Re: SVG Problem with FOP
Title: Re: SVG Problem with FOP At 10:43 am -0500 25/1/02, Scott Moore wrote: I'm trying to embed the following SVG into my XSL-FO and run it thru FOP (0.20.3rc). Although the SVG looks fine using Adobe's SVG viewer and Batik's viewer, I get an error (below) from FOP. Apparently, it doesn't like the url() reference to the radialGradient. How can I get this to work? Thanks for any help, Scott svg width=3.5in height=1in viewBox=0 0 680 200 xmlns= http://www.w3.org/2000/svg http://www.w3.org/2000/svg preserveAspectRatio=none g defs radialGradient id=PurpleToWhite gradientUnits=objectBoundingBox cx=.5 cy=.5 r=.5 stop offset=5% stop-color=white/ stop offset=100% stop-color=rgb(100,0,100)/ /radialGradient /defs rect fill=black stroke=black x=0 y=0 width=680 height=200/ circle r=80 cx=270 cy=100 fill=url(#PurpleToWhite)/ text font-family=Times font-size=135pt x=213 y=160 fill=whiteD/text /g /svg An I/O error occured while processing the URI 'file:D:/Projects/Dev/#PurpleToWhite' specified on the element circle Are you sure that file that you have requested exists? You might be able to step through the code in a debugger and get a clearer idea of exactly what I/O error occured. Also check the bug lists as it is possible that FOP has special requirements for specifying URIs. Ben.
Displaying characters in PDF
Hopefully someone can help me or at least point me in the right direction. My original problem was that I had a parse error because my xml had the character 0x92 (slanted apostraphe) in it. After using encoding=iso-8859-1 this problem went away. Now the character displays as a # in the PDF output. Ideally I'd like to have it displayed as it is meant to be. As the font I'm using sans-serif, which is probably Helvetica. That leaves me with a few questions: Does this base font support what I want? Should I use a different encoding? Do I have to do stuff with embedding fonts or font metrics to ensure PDF recognises this character? Cheers Tim Keen Analyst Programmer WERD Project Dept of Natural Resources Mines 4th Floor, Mineral House 41 George St Brisbane QLD 4000 (07) 3224 2559 (ph) (07) 3224 7963 (fax) [EMAIL PROTECTED] The information in this e-mail together with any attachments is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any form of review, disclosure, modification, distribution and/or publication of this e-mail message is prohibited. If you have received this message in error, you are asked to inform the sender as quickly as possible and delete this message and any copies of this message from your computer and/or your computer system network.
RE: SVG Problem with FOP
Title: Re: SVG Problem with FOP Thanks for the reply. The file does not exist, except in memory. I create the XSL-FO from a transformation and then directly feed that Document to FOP in my servlet (I'm not using the command-line version of FOP). The SVG is contained in the document and the url reference is local to the document. Scott -Original Message-From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]Sent: Wednesday, January 30, 2002 8:01 PMTo: [EMAIL PROTECTED]Subject: Re: SVG Problem with FOP At 10:43 am -0500 25/1/02, Scott Moore wrote: I'm trying to embed the following SVG into my XSL-FO and run it thruFOP (0.20.3rc). Although the SVG looks fine using Adobe's SVG viewer and Batik's viewer, I get anerror (below) from FOP. Apparently, it doesn't like the url() referenceto the radialGradient. How can I get this to work?Thanks for any help,Scottsvg width="3.5in" height="1in" viewBox="0 0 680 200" xmlns="http://www.w3.org/2000/svg http://www.w3.org/2000/svg "preserveAspectRatio="none"g defs radialGradient id="PurpleToWhite" gradientUnits="objectBoundingBox"cx=".5" cy=".5" r=".5" stop offset="5%" stop-color="white"/ stop offset="100%" stop-color="rgb(100,0,100)"/ /radialGradient /defs rect fill="black" stroke="black" x="0" y="0" width="680"height="200"/ circle r="80" cx="270" cy="100" fill="url(#PurpleToWhite)"/ text font-family="Times" font-size="135pt" x="213" y="160"fill="white"D/text/g/svgAn I/O error occured while processing the URI 'file:D:/Projects/Dev/#PurpleToWhite' specified on the element circle Are you sure that file that you have requested exists? You might be able to step through the code in a debugger and get a clearer idea of exactly what I/O error occured. Also check the bug lists as it is possible that FOP has special requirements for specifying URIs. Ben.
FOPException: no protocol (embedded in servlet)
Hi there, I get a FOPException while processing a XSL-FO with Fop-0.20.3rc. For testing I'm transforming a xml document into xsl-fo using a xsl stylesheet, which should be transformed into a pdf (and returned). But, alas, I get a FOPException with the message no protocol: javax.servlet.ServletException: FOPException: no protocol: ?xml version=1.0 encoding=iso-8859-1? fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format; fo:layout-master-set ... ... ... /fo:root The error occurs in the renderFO(..) method down below. Any suggestions? I got no idea, and the API says about FOPException Exception thrown when FOP has a problem - not quite helpfull. -- THE SERVLET -- // alot of imports: import ... public class DeliverPDF extends HttpServlet { public static String XSL_SOURCE_FILE = /xml/print.xsl; public static String XML_SOURCE_FILE = /xml/japan.xml; Logger log = null; public void doPost( javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException { /** * Der Logger für die PDF Transformation wird gesetzt. * Über diesen werden Fehlermeldungen und Warnungen an den Benutzer * weitergegeben. */ if (log == null) { Hierarchy hierarchy = Hierarchy.getDefaultHierarchy(); log = hierarchy.getLoggerFor(fop); log.setPriority(Priority.WARN); } String foTempString = new String(); StreamSource xmlStreamSource = null; StreamSource xslStreamSource = null; try { /** * TransformerFactory ist eine abstrakte Klasse, d.h. sie hat keinen Konstruktor. * Es wird eine neue Instanz angelegt. */ TransformerFactory tFactory = TransformerFactory.newInstance(); /** Stream Source wird jeweils mit den Dateinamen(java.io.File) initialisiert, * d.h. die SystemID wird automatisch erzeugt, über die die Dateien * eindeutig lokalisiert werden. * Nun kann in der Source erst mit den dateien gearbeitet werden. */ URL url = getClass().getResource(XSL_SOURCE_FILE); if (url == null) { response.getOutputStream().println(Couldn't locate + XSL_SOURCE_FILE + .); } else { xslStreamSource = new StreamSource(url.toString()); } url = getClass().getResource(XML_SOURCE_FILE); if (url == null) { response.getOutputStream().println(Couldn't locate + XML_SOURCE_FILE + .); } else { xmlStreamSource = new StreamSource(url.toString()); } /** Wenn das Anlegen der beiden StreamSources erfolgreich war, * wird die eigentliche transformation durchgeführt und das * Ergebnis präsentiert. */ if (xmlStreamSource != null xslStreamSource != null) { /** Über die Factory wird nun ein neuer Transformator erzeugt, * initialisiert mit der Datei, die die Anweisungen für die * Transformation enthält(XSL-Source). */ Transformer transformer = tFactory.newTransformer(xslStreamSource); /** Durchführen der Transformation, Ergebnis in ein File wegschreiben. */ StringWriter sw = new StringWriter(); transformer.transform( xmlStreamSource, new StreamResult(sw)); /** * Umsetzung nach PDF und rausschreiben an den Client */ renderFO(new InputSource(sw.toString()), response); } } catch (Exception e) { e.printStackTrace(); } } /** * renders an FO inputsource into a PDF file which is rendered * directly to
Re: AW: keep-with-next?
That would be fantastic. Costantino David Wood [EMAIL PROTECTED]To: fop-dev@xml.apache.org ix.com cc: [EMAIL PROTECTED] Subject: Re: AW: keep-with-next? 30.01.02 20:24 Please respond to fop-user I should be more specific - what I mean is; I would like to try to get keep-with-next/previous working with fo:block elements. On Wed, 30 Jan 2002, David Wood wrote: I am a Java coder and know my way around the standard. I volunteer to try to fix this, if someone who is more familiar with FOP's internals can tell me where to look... -David On Wed, 30 Jan 2002, Sam Prokop wrote: I found out it just works with table-rows, if you use keep-with-next and keep-with-previous. and you have to take care, that the table doesn´t exceeds the page, otherwise you´ll get a infinite-loop. that´s all i found out :-( Sam -Ursprüngliche Nachricht- Von: Costantino Sertorio [mailto:[EMAIL PROTECTED] Gesendet: Montag, 28. Januar 2002 16:51 An: [EMAIL PROTECTED] Betreff: keep-with-next? Hello, Is the keep-with-next attribute supported by FOP? If yes, can anybody explain to me what I am doing wrong? I have a heading template which I would like to keep together with the following text, therefore I defined the following, but it doesn't work (the following paragraph ends up in the next page): xsl:template match=heading xsl:choose xsl:when test=@level='1' fo:block keep-with-next=always space-before=0.6cm space-after =0.6cm font-size=13pt font-weight=bold xsl:apply-templates/ /fo:block /xsl:when xsl:when test=@level='2' fo:block keep-with-next=always space-before=5mm font-size= 10pt font-weight=bold xsl:apply-templates/ /fo:block /xsl:when Thank you, Costantino - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
use of multi page tables cause memory problems
Hi all, I have been following the dev list list from some time now, and I am using FOP for a few month. This piece of software totally respond to my formatting needs. I have send a more developper's version of this question to the dev-list. My issue is with memory consumption as soon as I use tables more than one page long. I have tried the use as many page sequence you can trick as many have told me to. The trouble is the memory still grows when I use multi-page tables. I understand that the biggest of my tables use the more memory, but it seems that it grows much much more than expected and during the whole rendering, even if the biggest table is in the first page-sequence. I use 0.20.3rc and I would be very very thankfull if anyone has clue or experience generating 100 to 500 pages with long tables within 256Mo Thanks Cyril
RE: SVG Problem with FOP
Title: RE: SVG Problem with FOP At 5:41 am -0500 31/1/02, Scott Moore wrote: Thanks for the reply. The file does not exist, except in memory. I create the XSL-FO from a transformation and then directly feed that Document to FOP in my servlet (I'm not using the command-line version of FOP). The SVG is contained in the document and the url reference is local to the document. Note: It takes time and effort to attempt to undo the formatting and to wrap your mail, and I haven't yet worked out how to remove the blue colouring. See URL: http://www.arsdigita.com/asj/mime/ URL: http://www.geocities.com/nnqweb/nquote.html URL: http://www.firstpr.com.au/sys-admin/HTML-email/ URL: http://freshmeat.net/articles/view/173/ URL: http://www.lemis.com/email.html URL: http://www.icomm.ca/~dragon/posting.htm URL: http://networknews.vnunet.com/ReadersToTheRescue/16674 URL: http://www.wired.com/news/technology/0,1282,41608,00.html The other answer you received subsumes mine, it is correct in every respect and more detailled. You should work along the lines lines suggested there, to wit, you need to adjust your code so that the URI looks something like: url(file:///c:/refstuff/grad.svg#PurpleToWhite) Ben.
Re: FOPException: no protocol (embedded in servlet)
[EMAIL PROTECTED] wrote: I get a FOPException while processing a XSL-FO with Fop-0.20.3rc. For testing I'm transforming a xml document into xsl-fo ... javax.servlet.ServletException: FOPException: no protocol: ?xml version=1.0 encoding=iso-8859-1? fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format; The message tells: You feed the result of the transformation as a string to a place where the underlying mechanism expects an URL. /** Durchführen der Transformation, Ergebnis in ein File wegschreiben. */ StringWriter sw = new StringWriter(); transformer.transform(xmlStreamSource,new StreamResult(sw)); There is a blatant mismatch between the comment and the code. The result is not written to a file but to a string in memory... renderFO(new InputSource(sw.toString()), ...which in turn is passed to the InputSource where it expects an URL. Lesson: Have only programmers with a clue fiddle with the code. Search the Web or better the mailing list archives for fop-user and fop-dev for how to wire an XSL transformer properly to FOP. Unfortunately, the Servlet example delivered with FOP is a bit outdated. J.Pietschmann
Re: FOPException: no protocol (embedded in servlet)
- Original Message - From: Joerg Pietschmann [EMAIL PROTECTED] hi there, The message tells: You feed the result of the transformation as a string to a place where the underlying mechanism expects an URL. I wrapped the String in a StringReader, and it works. What you are saying makes sense, though. Lesson: Have only programmers with a clue fiddle with the code. Lesson: If you never fiddle with code you don't know inside-out you will never learn something new. Search the Web or better the mailing list archives for fop-user and fop-dev for how to wire an XSL transformer properly to FOP. Unfortunately, the Servlet example delivered with FOP is a bit outdated. Your help is much appreciated. I searched through the available archives (most of them seem to be down), but I cannot find some better way to implement a convert-xml-to-fo-with-xsl-and-render-that-without-writing-to-FS rendering. Any suggestions from your side? A replacement for the outdated FOP example would help alot of people, imo. Sebastian Will