You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Sebastien <ka...@gmail.com> on 2008/11/21 14:48:15 UTC
SVG1.2 and flowRoot in PDF
Hi,
I would like to use the flowing text abilities of SVG1.2 with FOP but i
can't get FOP to "switch" to SVG1.2 mode and i get this error:
GRAVE: Exception
org.w3c.dom.DOMException: The current document is unable to create an
element of the requested type (namespace: http://www.w3.org/2000/svg, name:
flowRoot).
at
org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:217)
at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:125)
at org.apache.fop.cli.Main.startFOP(Main.java:166)
at org.apache.fop.cli.Main.main(Main.java:197)
---------
org.w3c.dom.DOMException: The current document is unable to create an
element of the requested type (namespace: http://www.w3.org/2000/svg, name:
flowRoot).
at org.apache.batik.dom.AbstractNode.createDOMException(Unknown
Source)
at
org.apache.batik.dom.svg.SVGDOMImplementation.createElementNS(Unknown
Source)
at org.apache.batik.dom.svg.SVGOMDocument.createElementNS(Unknown
Source)
at org.apache.xml.utils.DOMBuilder.startElement(DOMBuilder.java:324)
at
org.apache.xalan.transformer.TransformerIdentityImpl.startElement(TransformerIdentityImpl.java:1072)
at
org.apache.fop.util.DelegatingContentHandler.startElement(DelegatingContentHandler.java:182)
at
org.apache.fop.util.DOMBuilderContentHandlerFactory$Handler.startElement(DOMBuilderContentHandlerFactory.java:124)
at
org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:163)
at
org.apache.xalan.transformer.TransformerIdentityImpl.startElement(TransformerIdentityImpl.java:1072)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown
Source)
at org.apache.xerces.xinclude.XIncludeHandler.startElement(Unknown
Source)
at
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown
Source)
at
org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:484)
at
org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:214)
at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:125)
at org.apache.fop.cli.Main.startFOP(Main.java:166)
at org.apache.fop.cli.Main.main(Main.java:197)
I found a thread in the archives which is exactly what i'm trying to do:
http://fop-users.markmail.org/search/?q=flowroot#query:flowroot+page:1+mid:h2oak7zhcds6tvje+state:results
Unfortunately, the answer given by Jeremias (writing version="1.2" in the
svg root tag) didn't help.
Here is the .fo file (the svg part comes from the W3C):
<?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-bottom="10mm" margin-top="10mm"
margin-right="10mm" margin-left="10mm" page-width="210mm"
page-height="297mm" master-name="A4-portrait">
<fo:region-body margin-bottom="10mm" margin-top="10mm" />
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence font-size="10pt" font-family="times"
master-reference="A4-portrait">
<fo:flow flow-name="xsl-region-body">
<fo:block>
<fo:instream-foreign-object>
<svg xmlns="http://www.w3.org/2000/svg" version="1.2"
width="100mm" height="150mm">
<flowRoot font-size="16">
<flowRegion>
<path d="M100,50L50,300L250,300L300,50z"/>
</flowRegion>
<flowPara>Tomorrow, and tomorrow, and tomorrow; creeps
in this
petty pace from day to day, until the last syllable
of recorded time.
And all our yesterdays have lighted fools the way to
dusty death.
</flowPara>
</flowRoot>
</svg>
</fo:instream-foreign-object>
</fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>
However, when i use fo:external-graphic to include the same svg, it "works",
or maybe should i say it doesn't crash... The PDF rendering is working, but
the result is just a black parallelogram instead of the text (exactly the
same result as in Firefox 3 for instance). There is only InkScape which
renders the svg correctly.
What am I missing here ?
Thanks for your help ;)
Re: SVG1.2 and flowRoot in PDF
Posted by Sebastien <ka...@gmail.com>.
On Fri, Nov 21, 2008 at 4:16 PM, Jeremias Maerki <de...@jeremias-maerki.ch>wrote:
> I have a pretty good idea why it doesn't work. For i-f-o the basic SVG
> 1.1 DOMImplementation is currently hard-coded but it actually needs to
> be selected based on the version attribute like for the e-g variant. I'm
> looking into that.
>
Ok, thank you very much.
>
> As for the black parallelogram, I may have to send you over to
> batik-users@xmlgraphics.apache.org since the same output appears when
> looking at the SVG in Batik's Squiggle Browser. Setting
> visibility="false" fixes that problem. Please note that the SVG 1.2
> flowText feature is not finalized. The spec is still in draft mode. The
> semantics may not be clearly enough defined, yet, and Batik might also
> not do everything correctly, yet.
>
Actually, i'm just trying to get word wrapping in SVG without using known
hacks such as dividing my text in substrings, each in one in a tspan, or
using tbreak. I can't use them because my text is dynamicaly generated and
the algorythm to find out how it should be split will just be a real pain in
the ass...
So, any other solution allowing me to have word wrapping would be fine for
me ;)
Re: SVG1.2 and flowRoot in PDF
Posted by Sebastien <ka...@gmail.com>.
It works just the way i want, you rock !
Thanks a lot, again ;)
P.S: visibility="hidden" does the trick indeed
On Fri, Nov 21, 2008 at 6:26 PM, Jeremias Maerki <de...@jeremias-maerki.ch>wrote:
> Found a solution that works:
> http://svn.apache.org/viewvc?rev=719646&view=rev
>
> On 21.11.2008 17:47:22 Jeremias Maerki wrote:
> > Actually, it doesn't seem to work in all cases. I have to revise my fix.
> > My current solution causes a ClastCastException inside Batik.
> >
> > On 21.11.2008 17:10:29 Jeremias Maerki wrote:
> > > Ok, you can now use SVG 1.2 in FOP Trunk:
> > > http://svn.apache.org/viewvc?rev=719616&view=rev
> > >
> <snip/>
>
>
>
> Jeremias Maerki
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>
>
Re: SVG1.2 and flowRoot in PDF
Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
Found a solution that works:
http://svn.apache.org/viewvc?rev=719646&view=rev
On 21.11.2008 17:47:22 Jeremias Maerki wrote:
> Actually, it doesn't seem to work in all cases. I have to revise my fix.
> My current solution causes a ClastCastException inside Batik.
>
> On 21.11.2008 17:10:29 Jeremias Maerki wrote:
> > Ok, you can now use SVG 1.2 in FOP Trunk:
> > http://svn.apache.org/viewvc?rev=719616&view=rev
> >
<snip/>
Jeremias Maerki
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: SVG1.2 and flowRoot in PDF
Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
Actually, it doesn't seem to work in all cases. I have to revise my fix.
My current solution causes a ClastCastException inside Batik.
On 21.11.2008 17:10:29 Jeremias Maerki wrote:
> Ok, you can now use SVG 1.2 in FOP Trunk:
> http://svn.apache.org/viewvc?rev=719616&view=rev
>
> On 21.11.2008 16:43:27 Sebastien wrote:
> > On Fri, Nov 21, 2008 at 4:37 PM, Jeremias Maerki <de...@jeremias-maerki.ch>wrote:
> >
> > > I forgot: you also need to enclose the flowPara with a flowDiv element.
> > > I believe the example in the SVG 1.2 working draft is actually wrong (it
> > > doesn't conform to the schema given further above in the document).
> > >
> >
> > Yes, the example is clearly wrong (on the webpage, the source code doesn't
> > even end the flowRoot tag correctly...)
> >
> >
> > > On 21.11.2008 16:16:30 Jeremias Maerki wrote:
> > > > I have a pretty good idea why it doesn't work. For i-f-o the basic SVG
> > > > 1.1 DOMImplementation is currently hard-coded but it actually needs to
> > > > be selected based on the version attribute like for the e-g variant. I'm
> > > > looking into that.
> > > >
> > > > As for the black parallelogram, I may have to send you over to
> > > > batik-users@xmlgraphics.apache.org since the same output appears when
> > > > looking at the SVG in Batik's Squiggle Browser. Setting
> > > > visibility="false" fixes that problem. Please note that the SVG 1.2
> > > > flowText feature is not finalized. The spec is still in draft mode. The
> > > > semantics may not be clearly enough defined, yet, and Batik might also
> > > > not do everything correctly, yet.
> > > >
> > > > I will report back when I've fixed the first problem above. Shouldn't be
> > > > a biggy.
> > > >
> > > > On 21.11.2008 14:48:15 Sebastien wrote:
> > > > > Hi,
> > > > > I would like to use the flowing text abilities of SVG1.2 with FOP but i
> > > > > can't get FOP to "switch" to SVG1.2 mode and i get this error:
> > > > >
> > > > > GRAVE: Exception
> > > > > org.w3c.dom.DOMException: The current document is unable to create an
> > > > > element of the requested type (namespace: http://www.w3.org/2000/svg,
> > > name:
> > > > > flowRoot).
> > > > > at
> > > > > org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:217)
> > > > > at
> > > org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:125)
> > > > > at org.apache.fop.cli.Main.startFOP(Main.java:166)
> > > > > at org.apache.fop.cli.Main.main(Main.java:197)
> > > > >
> > > > > ---------
> > > > >
> > > > > org.w3c.dom.DOMException: The current document is unable to create an
> > > > > element of the requested type (namespace: http://www.w3.org/2000/svg,
> > > name:
> > > > > flowRoot).
> > > > > at org.apache.batik.dom.AbstractNode.createDOMException(Unknown
> > > > > Source)
> > > > > at
> > > > > org.apache.batik.dom.svg.SVGDOMImplementation.createElementNS(Unknown
> > > > > Source)
> > > > > at
> > > org.apache.batik.dom.svg.SVGOMDocument.createElementNS(Unknown
> > > > > Source)
> > > > > at
> > > org.apache.xml.utils.DOMBuilder.startElement(DOMBuilder.java:324)
> > > > > at
> > > > >
> > > org.apache.xalan.transformer.TransformerIdentityImpl.startElement(TransformerIdentityImpl.java:1072)
> > > > > at
> > > > >
> > > org.apache.fop.util.DelegatingContentHandler.startElement(DelegatingContentHandler.java:182)
> > > > > at
> > > > >
> > > org.apache.fop.util.DOMBuilderContentHandlerFactory$Handler.startElement(DOMBuilderContentHandlerFactory.java:124)
> > > > > at
> > > > > org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:163)
> > > > > at
> > > > >
> > > org.apache.xalan.transformer.TransformerIdentityImpl.startElement(TransformerIdentityImpl.java:1072)
> > > > > at
> > > org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown
> > > > > Source)
> > > > > at
> > > org.apache.xerces.xinclude.XIncludeHandler.startElement(Unknown
> > > > > Source)
> > > > > at
> > > > >
> > > org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
> > > > > Source)
> > > > > at
> > > > >
> > > org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
> > > > > Source)
> > > > > at
> > > > >
> > > org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
> > > > > Source)
> > > > > at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
> > > > > Source)
> > > > > at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
> > > > > Source)
> > > > > at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
> > > > > at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
> > > Source)
> > > > > at
> > > org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown
> > > > > Source)
> > > > > at
> > > > >
> > > org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:484)
> > > > > at
> > > > > org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:214)
> > > > > at
> > > org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:125)
> > > > > at org.apache.fop.cli.Main.startFOP(Main.java:166)
> > > > > at org.apache.fop.cli.Main.main(Main.java:197)
> > > > >
> > > > >
> > > > > I found a thread in the archives which is exactly what i'm trying to
> > > do:
> > > > >
> > > http://fop-users.markmail.org/search/?q=flowroot#query:flowroot+page:1+mid:h2oak7zhcds6tvje+state:results
> > > > >
> > > > > Unfortunately, the answer given by Jeremias (writing version="1.2" in
> > > the
> > > > > svg root tag) didn't help.
> > > > > Here is the .fo file (the svg part comes from the W3C):
> > > > >
> > > > >
> > > > > <?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-bottom="10mm" margin-top="10mm"
> > > > > margin-right="10mm" margin-left="10mm" page-width="210mm"
> > > > > page-height="297mm" master-name="A4-portrait">
> > > > > <fo:region-body margin-bottom="10mm" margin-top="10mm" />
> > > > > </fo:simple-page-master>
> > > > > </fo:layout-master-set>
> > > > > <fo:page-sequence font-size="10pt" font-family="times"
> > > > > master-reference="A4-portrait">
> > > > > <fo:flow flow-name="xsl-region-body">
> > > > > <fo:block>
> > > > > <fo:instream-foreign-object>
> > > > > <svg xmlns="http://www.w3.org/2000/svg" version="1.2"
> > > > > width="100mm" height="150mm">
> > > > > <flowRoot font-size="16">
> > > > > <flowRegion>
> > > > > <path d="M100,50L50,300L250,300L300,50z"/>
> > > > > </flowRegion>
> > > > > <flowPara>Tomorrow, and tomorrow, and tomorrow;
> > > creeps
> > > > > in this
> > > > > petty pace from day to day, until the last
> > > syllable
> > > > > of recorded time.
> > > > > And all our yesterdays have lighted fools the
> > > way to
> > > > > dusty death.
> > > > > </flowPara>
> > > > > </flowRoot>
> > > > > </svg>
> > > > > </fo:instream-foreign-object>
> > > > > </fo:block>
> > > > > </fo:flow>
> > > > > </fo:page-sequence>
> > > > > </fo:root>
> > > > >
> > > > > However, when i use fo:external-graphic to include the same svg, it
> > > "works",
> > > > > or maybe should i say it doesn't crash... The PDF rendering is working,
> > > but
> > > > > the result is just a black parallelogram instead of the text (exactly
> > > the
> > > > > same result as in Firefox 3 for instance). There is only InkScape which
> > > > > renders the svg correctly.
> > > > > What am I missing here ?
> > > > >
> > > > > Thanks for your help ;)
> > > >
> > > >
>
>
>
> Jeremias Maerki
>
Jeremias Maerki
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: SVG1.2 and flowRoot in PDF
Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
Ok, you can now use SVG 1.2 in FOP Trunk:
http://svn.apache.org/viewvc?rev=719616&view=rev
On 21.11.2008 16:43:27 Sebastien wrote:
> On Fri, Nov 21, 2008 at 4:37 PM, Jeremias Maerki <de...@jeremias-maerki.ch>wrote:
>
> > I forgot: you also need to enclose the flowPara with a flowDiv element.
> > I believe the example in the SVG 1.2 working draft is actually wrong (it
> > doesn't conform to the schema given further above in the document).
> >
>
> Yes, the example is clearly wrong (on the webpage, the source code doesn't
> even end the flowRoot tag correctly...)
>
>
> > On 21.11.2008 16:16:30 Jeremias Maerki wrote:
> > > I have a pretty good idea why it doesn't work. For i-f-o the basic SVG
> > > 1.1 DOMImplementation is currently hard-coded but it actually needs to
> > > be selected based on the version attribute like for the e-g variant. I'm
> > > looking into that.
> > >
> > > As for the black parallelogram, I may have to send you over to
> > > batik-users@xmlgraphics.apache.org since the same output appears when
> > > looking at the SVG in Batik's Squiggle Browser. Setting
> > > visibility="false" fixes that problem. Please note that the SVG 1.2
> > > flowText feature is not finalized. The spec is still in draft mode. The
> > > semantics may not be clearly enough defined, yet, and Batik might also
> > > not do everything correctly, yet.
> > >
> > > I will report back when I've fixed the first problem above. Shouldn't be
> > > a biggy.
> > >
> > > On 21.11.2008 14:48:15 Sebastien wrote:
> > > > Hi,
> > > > I would like to use the flowing text abilities of SVG1.2 with FOP but i
> > > > can't get FOP to "switch" to SVG1.2 mode and i get this error:
> > > >
> > > > GRAVE: Exception
> > > > org.w3c.dom.DOMException: The current document is unable to create an
> > > > element of the requested type (namespace: http://www.w3.org/2000/svg,
> > name:
> > > > flowRoot).
> > > > at
> > > > org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:217)
> > > > at
> > org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:125)
> > > > at org.apache.fop.cli.Main.startFOP(Main.java:166)
> > > > at org.apache.fop.cli.Main.main(Main.java:197)
> > > >
> > > > ---------
> > > >
> > > > org.w3c.dom.DOMException: The current document is unable to create an
> > > > element of the requested type (namespace: http://www.w3.org/2000/svg,
> > name:
> > > > flowRoot).
> > > > at org.apache.batik.dom.AbstractNode.createDOMException(Unknown
> > > > Source)
> > > > at
> > > > org.apache.batik.dom.svg.SVGDOMImplementation.createElementNS(Unknown
> > > > Source)
> > > > at
> > org.apache.batik.dom.svg.SVGOMDocument.createElementNS(Unknown
> > > > Source)
> > > > at
> > org.apache.xml.utils.DOMBuilder.startElement(DOMBuilder.java:324)
> > > > at
> > > >
> > org.apache.xalan.transformer.TransformerIdentityImpl.startElement(TransformerIdentityImpl.java:1072)
> > > > at
> > > >
> > org.apache.fop.util.DelegatingContentHandler.startElement(DelegatingContentHandler.java:182)
> > > > at
> > > >
> > org.apache.fop.util.DOMBuilderContentHandlerFactory$Handler.startElement(DOMBuilderContentHandlerFactory.java:124)
> > > > at
> > > > org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:163)
> > > > at
> > > >
> > org.apache.xalan.transformer.TransformerIdentityImpl.startElement(TransformerIdentityImpl.java:1072)
> > > > at
> > org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown
> > > > Source)
> > > > at
> > org.apache.xerces.xinclude.XIncludeHandler.startElement(Unknown
> > > > Source)
> > > > at
> > > >
> > org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
> > > > Source)
> > > > at
> > > >
> > org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
> > > > Source)
> > > > at
> > > >
> > org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
> > > > Source)
> > > > at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
> > > > Source)
> > > > at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
> > > > Source)
> > > > at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
> > > > at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
> > Source)
> > > > at
> > org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown
> > > > Source)
> > > > at
> > > >
> > org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:484)
> > > > at
> > > > org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:214)
> > > > at
> > org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:125)
> > > > at org.apache.fop.cli.Main.startFOP(Main.java:166)
> > > > at org.apache.fop.cli.Main.main(Main.java:197)
> > > >
> > > >
> > > > I found a thread in the archives which is exactly what i'm trying to
> > do:
> > > >
> > http://fop-users.markmail.org/search/?q=flowroot#query:flowroot+page:1+mid:h2oak7zhcds6tvje+state:results
> > > >
> > > > Unfortunately, the answer given by Jeremias (writing version="1.2" in
> > the
> > > > svg root tag) didn't help.
> > > > Here is the .fo file (the svg part comes from the W3C):
> > > >
> > > >
> > > > <?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-bottom="10mm" margin-top="10mm"
> > > > margin-right="10mm" margin-left="10mm" page-width="210mm"
> > > > page-height="297mm" master-name="A4-portrait">
> > > > <fo:region-body margin-bottom="10mm" margin-top="10mm" />
> > > > </fo:simple-page-master>
> > > > </fo:layout-master-set>
> > > > <fo:page-sequence font-size="10pt" font-family="times"
> > > > master-reference="A4-portrait">
> > > > <fo:flow flow-name="xsl-region-body">
> > > > <fo:block>
> > > > <fo:instream-foreign-object>
> > > > <svg xmlns="http://www.w3.org/2000/svg" version="1.2"
> > > > width="100mm" height="150mm">
> > > > <flowRoot font-size="16">
> > > > <flowRegion>
> > > > <path d="M100,50L50,300L250,300L300,50z"/>
> > > > </flowRegion>
> > > > <flowPara>Tomorrow, and tomorrow, and tomorrow;
> > creeps
> > > > in this
> > > > petty pace from day to day, until the last
> > syllable
> > > > of recorded time.
> > > > And all our yesterdays have lighted fools the
> > way to
> > > > dusty death.
> > > > </flowPara>
> > > > </flowRoot>
> > > > </svg>
> > > > </fo:instream-foreign-object>
> > > > </fo:block>
> > > > </fo:flow>
> > > > </fo:page-sequence>
> > > > </fo:root>
> > > >
> > > > However, when i use fo:external-graphic to include the same svg, it
> > "works",
> > > > or maybe should i say it doesn't crash... The PDF rendering is working,
> > but
> > > > the result is just a black parallelogram instead of the text (exactly
> > the
> > > > same result as in Firefox 3 for instance). There is only InkScape which
> > > > renders the svg correctly.
> > > > What am I missing here ?
> > > >
> > > > Thanks for your help ;)
> > >
> > >
Jeremias Maerki
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: SVG1.2 and flowRoot in PDF
Posted by Sebastien <ka...@gmail.com>.
On Fri, Nov 21, 2008 at 4:37 PM, Jeremias Maerki <de...@jeremias-maerki.ch>wrote:
> I forgot: you also need to enclose the flowPara with a flowDiv element.
> I believe the example in the SVG 1.2 working draft is actually wrong (it
> doesn't conform to the schema given further above in the document).
>
Yes, the example is clearly wrong (on the webpage, the source code doesn't
even end the flowRoot tag correctly...)
> On 21.11.2008 16:16:30 Jeremias Maerki wrote:
> > I have a pretty good idea why it doesn't work. For i-f-o the basic SVG
> > 1.1 DOMImplementation is currently hard-coded but it actually needs to
> > be selected based on the version attribute like for the e-g variant. I'm
> > looking into that.
> >
> > As for the black parallelogram, I may have to send you over to
> > batik-users@xmlgraphics.apache.org since the same output appears when
> > looking at the SVG in Batik's Squiggle Browser. Setting
> > visibility="false" fixes that problem. Please note that the SVG 1.2
> > flowText feature is not finalized. The spec is still in draft mode. The
> > semantics may not be clearly enough defined, yet, and Batik might also
> > not do everything correctly, yet.
> >
> > I will report back when I've fixed the first problem above. Shouldn't be
> > a biggy.
> >
> > On 21.11.2008 14:48:15 Sebastien wrote:
> > > Hi,
> > > I would like to use the flowing text abilities of SVG1.2 with FOP but i
> > > can't get FOP to "switch" to SVG1.2 mode and i get this error:
> > >
> > > GRAVE: Exception
> > > org.w3c.dom.DOMException: The current document is unable to create an
> > > element of the requested type (namespace: http://www.w3.org/2000/svg,
> name:
> > > flowRoot).
> > > at
> > > org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:217)
> > > at
> org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:125)
> > > at org.apache.fop.cli.Main.startFOP(Main.java:166)
> > > at org.apache.fop.cli.Main.main(Main.java:197)
> > >
> > > ---------
> > >
> > > org.w3c.dom.DOMException: The current document is unable to create an
> > > element of the requested type (namespace: http://www.w3.org/2000/svg,
> name:
> > > flowRoot).
> > > at org.apache.batik.dom.AbstractNode.createDOMException(Unknown
> > > Source)
> > > at
> > > org.apache.batik.dom.svg.SVGDOMImplementation.createElementNS(Unknown
> > > Source)
> > > at
> org.apache.batik.dom.svg.SVGOMDocument.createElementNS(Unknown
> > > Source)
> > > at
> org.apache.xml.utils.DOMBuilder.startElement(DOMBuilder.java:324)
> > > at
> > >
> org.apache.xalan.transformer.TransformerIdentityImpl.startElement(TransformerIdentityImpl.java:1072)
> > > at
> > >
> org.apache.fop.util.DelegatingContentHandler.startElement(DelegatingContentHandler.java:182)
> > > at
> > >
> org.apache.fop.util.DOMBuilderContentHandlerFactory$Handler.startElement(DOMBuilderContentHandlerFactory.java:124)
> > > at
> > > org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:163)
> > > at
> > >
> org.apache.xalan.transformer.TransformerIdentityImpl.startElement(TransformerIdentityImpl.java:1072)
> > > at
> org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown
> > > Source)
> > > at
> org.apache.xerces.xinclude.XIncludeHandler.startElement(Unknown
> > > Source)
> > > at
> > >
> org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
> > > Source)
> > > at
> > >
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
> > > Source)
> > > at
> > >
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
> > > Source)
> > > at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
> > > Source)
> > > at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
> > > Source)
> > > at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
> > > at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
> Source)
> > > at
> org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown
> > > Source)
> > > at
> > >
> org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:484)
> > > at
> > > org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:214)
> > > at
> org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:125)
> > > at org.apache.fop.cli.Main.startFOP(Main.java:166)
> > > at org.apache.fop.cli.Main.main(Main.java:197)
> > >
> > >
> > > I found a thread in the archives which is exactly what i'm trying to
> do:
> > >
> http://fop-users.markmail.org/search/?q=flowroot#query:flowroot+page:1+mid:h2oak7zhcds6tvje+state:results
> > >
> > > Unfortunately, the answer given by Jeremias (writing version="1.2" in
> the
> > > svg root tag) didn't help.
> > > Here is the .fo file (the svg part comes from the W3C):
> > >
> > >
> > > <?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-bottom="10mm" margin-top="10mm"
> > > margin-right="10mm" margin-left="10mm" page-width="210mm"
> > > page-height="297mm" master-name="A4-portrait">
> > > <fo:region-body margin-bottom="10mm" margin-top="10mm" />
> > > </fo:simple-page-master>
> > > </fo:layout-master-set>
> > > <fo:page-sequence font-size="10pt" font-family="times"
> > > master-reference="A4-portrait">
> > > <fo:flow flow-name="xsl-region-body">
> > > <fo:block>
> > > <fo:instream-foreign-object>
> > > <svg xmlns="http://www.w3.org/2000/svg" version="1.2"
> > > width="100mm" height="150mm">
> > > <flowRoot font-size="16">
> > > <flowRegion>
> > > <path d="M100,50L50,300L250,300L300,50z"/>
> > > </flowRegion>
> > > <flowPara>Tomorrow, and tomorrow, and tomorrow;
> creeps
> > > in this
> > > petty pace from day to day, until the last
> syllable
> > > of recorded time.
> > > And all our yesterdays have lighted fools the
> way to
> > > dusty death.
> > > </flowPara>
> > > </flowRoot>
> > > </svg>
> > > </fo:instream-foreign-object>
> > > </fo:block>
> > > </fo:flow>
> > > </fo:page-sequence>
> > > </fo:root>
> > >
> > > However, when i use fo:external-graphic to include the same svg, it
> "works",
> > > or maybe should i say it doesn't crash... The PDF rendering is working,
> but
> > > the result is just a black parallelogram instead of the text (exactly
> the
> > > same result as in Firefox 3 for instance). There is only InkScape which
> > > renders the svg correctly.
> > > What am I missing here ?
> > >
> > > Thanks for your help ;)
> >
> >
> >
> >
> > Jeremias Maerki
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> > For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
> >
>
>
>
>
> Jeremias Maerki
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>
>
Re: SVG1.2 and flowRoot in PDF
Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
I forgot: you also need to enclose the flowPara with a flowDiv element.
I believe the example in the SVG 1.2 working draft is actually wrong (it
doesn't conform to the schema given further above in the document).
On 21.11.2008 16:16:30 Jeremias Maerki wrote:
> I have a pretty good idea why it doesn't work. For i-f-o the basic SVG
> 1.1 DOMImplementation is currently hard-coded but it actually needs to
> be selected based on the version attribute like for the e-g variant. I'm
> looking into that.
>
> As for the black parallelogram, I may have to send you over to
> batik-users@xmlgraphics.apache.org since the same output appears when
> looking at the SVG in Batik's Squiggle Browser. Setting
> visibility="false" fixes that problem. Please note that the SVG 1.2
> flowText feature is not finalized. The spec is still in draft mode. The
> semantics may not be clearly enough defined, yet, and Batik might also
> not do everything correctly, yet.
>
> I will report back when I've fixed the first problem above. Shouldn't be
> a biggy.
>
> On 21.11.2008 14:48:15 Sebastien wrote:
> > Hi,
> > I would like to use the flowing text abilities of SVG1.2 with FOP but i
> > can't get FOP to "switch" to SVG1.2 mode and i get this error:
> >
> > GRAVE: Exception
> > org.w3c.dom.DOMException: The current document is unable to create an
> > element of the requested type (namespace: http://www.w3.org/2000/svg, name:
> > flowRoot).
> > at
> > org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:217)
> > at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:125)
> > at org.apache.fop.cli.Main.startFOP(Main.java:166)
> > at org.apache.fop.cli.Main.main(Main.java:197)
> >
> > ---------
> >
> > org.w3c.dom.DOMException: The current document is unable to create an
> > element of the requested type (namespace: http://www.w3.org/2000/svg, name:
> > flowRoot).
> > at org.apache.batik.dom.AbstractNode.createDOMException(Unknown
> > Source)
> > at
> > org.apache.batik.dom.svg.SVGDOMImplementation.createElementNS(Unknown
> > Source)
> > at org.apache.batik.dom.svg.SVGOMDocument.createElementNS(Unknown
> > Source)
> > at org.apache.xml.utils.DOMBuilder.startElement(DOMBuilder.java:324)
> > at
> > org.apache.xalan.transformer.TransformerIdentityImpl.startElement(TransformerIdentityImpl.java:1072)
> > at
> > org.apache.fop.util.DelegatingContentHandler.startElement(DelegatingContentHandler.java:182)
> > at
> > org.apache.fop.util.DOMBuilderContentHandlerFactory$Handler.startElement(DOMBuilderContentHandlerFactory.java:124)
> > at
> > org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:163)
> > at
> > org.apache.xalan.transformer.TransformerIdentityImpl.startElement(TransformerIdentityImpl.java:1072)
> > at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown
> > Source)
> > at org.apache.xerces.xinclude.XIncludeHandler.startElement(Unknown
> > Source)
> > at
> > org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
> > Source)
> > at
> > org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
> > Source)
> > at
> > org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
> > Source)
> > at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
> > Source)
> > at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
> > Source)
> > at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
> > at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
> > at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown
> > Source)
> > at
> > org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:484)
> > at
> > org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:214)
> > at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:125)
> > at org.apache.fop.cli.Main.startFOP(Main.java:166)
> > at org.apache.fop.cli.Main.main(Main.java:197)
> >
> >
> > I found a thread in the archives which is exactly what i'm trying to do:
> > http://fop-users.markmail.org/search/?q=flowroot#query:flowroot+page:1+mid:h2oak7zhcds6tvje+state:results
> >
> > Unfortunately, the answer given by Jeremias (writing version="1.2" in the
> > svg root tag) didn't help.
> > Here is the .fo file (the svg part comes from the W3C):
> >
> >
> > <?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-bottom="10mm" margin-top="10mm"
> > margin-right="10mm" margin-left="10mm" page-width="210mm"
> > page-height="297mm" master-name="A4-portrait">
> > <fo:region-body margin-bottom="10mm" margin-top="10mm" />
> > </fo:simple-page-master>
> > </fo:layout-master-set>
> > <fo:page-sequence font-size="10pt" font-family="times"
> > master-reference="A4-portrait">
> > <fo:flow flow-name="xsl-region-body">
> > <fo:block>
> > <fo:instream-foreign-object>
> > <svg xmlns="http://www.w3.org/2000/svg" version="1.2"
> > width="100mm" height="150mm">
> > <flowRoot font-size="16">
> > <flowRegion>
> > <path d="M100,50L50,300L250,300L300,50z"/>
> > </flowRegion>
> > <flowPara>Tomorrow, and tomorrow, and tomorrow; creeps
> > in this
> > petty pace from day to day, until the last syllable
> > of recorded time.
> > And all our yesterdays have lighted fools the way to
> > dusty death.
> > </flowPara>
> > </flowRoot>
> > </svg>
> > </fo:instream-foreign-object>
> > </fo:block>
> > </fo:flow>
> > </fo:page-sequence>
> > </fo:root>
> >
> > However, when i use fo:external-graphic to include the same svg, it "works",
> > or maybe should i say it doesn't crash... The PDF rendering is working, but
> > the result is just a black parallelogram instead of the text (exactly the
> > same result as in Firefox 3 for instance). There is only InkScape which
> > renders the svg correctly.
> > What am I missing here ?
> >
> > Thanks for your help ;)
>
>
>
>
> Jeremias Maerki
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>
Jeremias Maerki
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: SVG1.2 and flowRoot in PDF
Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
I have a pretty good idea why it doesn't work. For i-f-o the basic SVG
1.1 DOMImplementation is currently hard-coded but it actually needs to
be selected based on the version attribute like for the e-g variant. I'm
looking into that.
As for the black parallelogram, I may have to send you over to
batik-users@xmlgraphics.apache.org since the same output appears when
looking at the SVG in Batik's Squiggle Browser. Setting
visibility="false" fixes that problem. Please note that the SVG 1.2
flowText feature is not finalized. The spec is still in draft mode. The
semantics may not be clearly enough defined, yet, and Batik might also
not do everything correctly, yet.
I will report back when I've fixed the first problem above. Shouldn't be
a biggy.
On 21.11.2008 14:48:15 Sebastien wrote:
> Hi,
> I would like to use the flowing text abilities of SVG1.2 with FOP but i
> can't get FOP to "switch" to SVG1.2 mode and i get this error:
>
> GRAVE: Exception
> org.w3c.dom.DOMException: The current document is unable to create an
> element of the requested type (namespace: http://www.w3.org/2000/svg, name:
> flowRoot).
> at
> org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:217)
> at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:125)
> at org.apache.fop.cli.Main.startFOP(Main.java:166)
> at org.apache.fop.cli.Main.main(Main.java:197)
>
> ---------
>
> org.w3c.dom.DOMException: The current document is unable to create an
> element of the requested type (namespace: http://www.w3.org/2000/svg, name:
> flowRoot).
> at org.apache.batik.dom.AbstractNode.createDOMException(Unknown
> Source)
> at
> org.apache.batik.dom.svg.SVGDOMImplementation.createElementNS(Unknown
> Source)
> at org.apache.batik.dom.svg.SVGOMDocument.createElementNS(Unknown
> Source)
> at org.apache.xml.utils.DOMBuilder.startElement(DOMBuilder.java:324)
> at
> org.apache.xalan.transformer.TransformerIdentityImpl.startElement(TransformerIdentityImpl.java:1072)
> at
> org.apache.fop.util.DelegatingContentHandler.startElement(DelegatingContentHandler.java:182)
> at
> org.apache.fop.util.DOMBuilderContentHandlerFactory$Handler.startElement(DOMBuilderContentHandlerFactory.java:124)
> at
> org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:163)
> at
> org.apache.xalan.transformer.TransformerIdentityImpl.startElement(TransformerIdentityImpl.java:1072)
> at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown
> Source)
> at org.apache.xerces.xinclude.XIncludeHandler.startElement(Unknown
> Source)
> at
> org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
> Source)
> at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
> Source)
> at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
> Source)
> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
> Source)
> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
> Source)
> at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
> at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
> at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown
> Source)
> at
> org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:484)
> at
> org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:214)
> at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:125)
> at org.apache.fop.cli.Main.startFOP(Main.java:166)
> at org.apache.fop.cli.Main.main(Main.java:197)
>
>
> I found a thread in the archives which is exactly what i'm trying to do:
> http://fop-users.markmail.org/search/?q=flowroot#query:flowroot+page:1+mid:h2oak7zhcds6tvje+state:results
>
> Unfortunately, the answer given by Jeremias (writing version="1.2" in the
> svg root tag) didn't help.
> Here is the .fo file (the svg part comes from the W3C):
>
>
> <?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-bottom="10mm" margin-top="10mm"
> margin-right="10mm" margin-left="10mm" page-width="210mm"
> page-height="297mm" master-name="A4-portrait">
> <fo:region-body margin-bottom="10mm" margin-top="10mm" />
> </fo:simple-page-master>
> </fo:layout-master-set>
> <fo:page-sequence font-size="10pt" font-family="times"
> master-reference="A4-portrait">
> <fo:flow flow-name="xsl-region-body">
> <fo:block>
> <fo:instream-foreign-object>
> <svg xmlns="http://www.w3.org/2000/svg" version="1.2"
> width="100mm" height="150mm">
> <flowRoot font-size="16">
> <flowRegion>
> <path d="M100,50L50,300L250,300L300,50z"/>
> </flowRegion>
> <flowPara>Tomorrow, and tomorrow, and tomorrow; creeps
> in this
> petty pace from day to day, until the last syllable
> of recorded time.
> And all our yesterdays have lighted fools the way to
> dusty death.
> </flowPara>
> </flowRoot>
> </svg>
> </fo:instream-foreign-object>
> </fo:block>
> </fo:flow>
> </fo:page-sequence>
> </fo:root>
>
> However, when i use fo:external-graphic to include the same svg, it "works",
> or maybe should i say it doesn't crash... The PDF rendering is working, but
> the result is just a black parallelogram instead of the text (exactly the
> same result as in Firefox 3 for instance). There is only InkScape which
> renders the svg correctly.
> What am I missing here ?
>
> Thanks for your help ;)
Jeremias Maerki
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org