Perplexing PDF SVG question

2003-06-23 Thread Irving Salisbury III
I have embedded an SVG image into my xsl:fo document.  It renders fine 
when using command line fop.  However, when I put it in a cocoon 
pipeline, I am getting the following error:

ERROR   (2003-06-23) 08:02.42:903   [sitemap.serializer.fo2pdf.fop] 
(/medicaid/sequence/first/pdf) Thread-10/PDFRenderer: svg graphic could 
not be built: null
java.lang.NullPointerException
   at java.net.URL.init(URL.java:366)
   at java.net.URL.init(URL.java:329)
   at java.net.URL.init(URL.java:321)
   at java.net.URL.init(URL.java:252)
   at java.net.URL.init(URL.java:275)
   at org.apache.batik.util.ParsedURLData.buildURL(Unknown Source)
   at org.apache.batik.util.ParsedURLData.openStreamInternal(Unknown 
Source)
   at org.apache.batik.util.ParsedURLData.openStream(Unknown Source)
   at org.apache.batik.util.ParsedURL.openStream(Unknown Source)
   at 
org.apache.batik.dom.svg.SAXSVGDocumentFactory.createDocument(Unknown 
Source)
   at org.apache.batik.bridge.DocumentLoader.loadDocument(Unknown Source)
   at org.apache.batik.bridge.URIResolver.getNode(Unknown Source)
   at org.apache.batik.bridge.URIResolver.getElement(Unknown Source)
   at 
org.apache.batik.bridge.BridgeContext.getReferencedElement(Unknown Source)
   at org.apache.batik.bridge.CSSUtilities.convertClipPath(Unknown Source)
   at 
org.apache.batik.bridge.AbstractGraphicsNodeBridge.buildGraphicsNode(Unknown 
Source)
   at 
org.apache.batik.bridge.SVGShapeElementBridge.buildGraphicsNode(Unknown 
Source)
   at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(Unknown Source)
   at org.apache.batik.bridge.GVTBuilder.buildComposite(Unknown Source)
   at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(Unknown Source)
   at org.apache.batik.bridge.GVTBuilder.buildComposite(Unknown Source)
   at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(Unknown Source)
   at org.apache.batik.bridge.GVTBuilder.buildComposite(Unknown Source)
   at org.apache.batik.bridge.GVTBuilder.build(Unknown Source)
   at org.apache.fop.render.pdf.PDFRenderer.renderSVGDocument(Unknown 
Source)
   at org.apache.fop.render.pdf.PDFRenderer.renderSVGArea(Unknown Source)
   at org.apache.fop.svg.SVGArea.render(Unknown Source)
   at 
org.apache.fop.render.pdf.PDFRenderer.renderForeignObjectArea(Unknown 
Source)
   at org.apache.fop.layout.inline.ForeignObjectArea.render(Unknown Source)
   at org.apache.fop.render.AbstractRenderer.renderLineArea(Unknown Source)
   at org.apache.fop.layout.LineArea.render(Unknown Source)
   at org.apache.fop.render.AbstractRenderer.renderBlockArea(Unknown 
Source)
   at org.apache.fop.layout.BlockArea.render(Unknown Source)
   at 
org.apache.fop.render.AbstractRenderer.renderAreaContainer(Unknown Source)
   at org.apache.fop.layout.ColumnArea.render(Unknown Source)
   at org.apache.fop.render.AbstractRenderer.renderSpanArea(Unknown Source)
   at org.apache.fop.layout.SpanArea.render(Unknown Source)
   at 
org.apache.fop.render.AbstractRenderer.renderBodyAreaContainer(Unknown 
Source)
   at org.apache.fop.render.pdf.PDFRenderer.renderPage(Unknown Source)
   at org.apache.fop.render.pdf.PDFRenderer.render(Unknown Source)
   at org.apache.fop.apps.StreamRenderer.queuePage(Unknown Source)
   at org.apache.fop.layout.AreaTree.addPage(Unknown Source)
   at org.apache.fop.fo.pagination.PageSequence.format(Unknown Source)
   at org.apache.fop.apps.StreamRenderer.render(Unknown Source)
   at org.apache.fop.fo.FOTreeBuilder.endElement(Unknown Source)
   at 
org.apache.cocoon.xml.AbstractXMLPipe.endElement(AbstractXMLPipe.java:147)
   at 
org.apache.xalan.transformer.ResultTreeHandler.endElement(ResultTreeHandler.java:307)
   at 
org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:684)
   at 
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2182)
   at 
org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:678)
   at 
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2182)
   at 
org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2008)
   at 
org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1171)
   at 
org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:3135)
   at java.lang.Thread.run(Thread.java:536)

Here is the start of the SVG element:

fo:block
   fo:instream-foreign-object height=480px width=640px
   svg fill-opacity=1 color-rendering=auto 
color-interpolation=auto stroke=black text-rendering=auto 
stroke-linecap=square width=640 stroke-miterlimit=10 
shape-rendering=auto stroke-opacity=1 fill=black 
stroke-dasharray=none font-weight=normal stroke-width=1 
height=480 font-family='sansserif' font-style=normal 
stroke-linejoin=miter font-size=12 stroke-dashoffset=0 
image-rendering=auto
defs id=genericDefs/
   g
   defs id=defs1
   clipPath clipPathUnits=userSpaceOnUse id=clipPath1
path d=M0 0 L640 0 L640 480 L0 480 L0 0 Z/
/clipPath
   clipPath 

RE: Perplexing PDF SVG question

2003-06-23 Thread Schaper, Christoph
Just guessing: You are on Unix and you don't have the display variable set
when you run  cocoon? 
If this is the case, either point the display variable to your X environment
or, if you don't have one search in the cocoon docu for headless.


Christoph

-Original Message-
From: Irving Salisbury III [mailto:[EMAIL PROTECTED]
Sent: 23 June 2003 15:27
To: [EMAIL PROTECTED]
Subject: Perplexing PDF SVG question


I have embedded an SVG image into my xsl:fo document.  It renders fine 
when using command line fop.  However, when I put it in a cocoon 
pipeline, I am getting the following error:

ERROR   (2003-06-23) 08:02.42:903   [sitemap.serializer.fo2pdf.fop] 
(/medicaid/sequence/first/pdf) Thread-10/PDFRenderer: svg graphic could 
not be built: null
java.lang.NullPointerException
at java.net.URL.init(URL.java:366)
at java.net.URL.init(URL.java:329)
at java.net.URL.init(URL.java:321)
at java.net.URL.init(URL.java:252)
at java.net.URL.init(URL.java:275)
at org.apache.batik.util.ParsedURLData.buildURL(Unknown Source)
at org.apache.batik.util.ParsedURLData.openStreamInternal(Unknown 
Source)
at org.apache.batik.util.ParsedURLData.openStream(Unknown Source)
at org.apache.batik.util.ParsedURL.openStream(Unknown Source)
at 
org.apache.batik.dom.svg.SAXSVGDocumentFactory.createDocument(Unknown 
Source)
at org.apache.batik.bridge.DocumentLoader.loadDocument(Unknown Source)
at org.apache.batik.bridge.URIResolver.getNode(Unknown Source)
at org.apache.batik.bridge.URIResolver.getElement(Unknown Source)
at 
org.apache.batik.bridge.BridgeContext.getReferencedElement(Unknown Source)
at org.apache.batik.bridge.CSSUtilities.convertClipPath(Unknown Source)
at 
org.apache.batik.bridge.AbstractGraphicsNodeBridge.buildGraphicsNode(Unknown

Source)
at 
org.apache.batik.bridge.SVGShapeElementBridge.buildGraphicsNode(Unknown 
Source)
at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(Unknown Source)
at org.apache.batik.bridge.GVTBuilder.buildComposite(Unknown Source)
at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(Unknown Source)
at org.apache.batik.bridge.GVTBuilder.buildComposite(Unknown Source)
at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(Unknown Source)
at org.apache.batik.bridge.GVTBuilder.buildComposite(Unknown Source)
at org.apache.batik.bridge.GVTBuilder.build(Unknown Source)
at org.apache.fop.render.pdf.PDFRenderer.renderSVGDocument(Unknown 
Source)
at org.apache.fop.render.pdf.PDFRenderer.renderSVGArea(Unknown Source)
at org.apache.fop.svg.SVGArea.render(Unknown Source)
at 
org.apache.fop.render.pdf.PDFRenderer.renderForeignObjectArea(Unknown 
Source)
at org.apache.fop.layout.inline.ForeignObjectArea.render(Unknown Source)
at org.apache.fop.render.AbstractRenderer.renderLineArea(Unknown Source)
at org.apache.fop.layout.LineArea.render(Unknown Source)
at org.apache.fop.render.AbstractRenderer.renderBlockArea(Unknown 
Source)
at org.apache.fop.layout.BlockArea.render(Unknown Source)
at 
org.apache.fop.render.AbstractRenderer.renderAreaContainer(Unknown Source)
at org.apache.fop.layout.ColumnArea.render(Unknown Source)
at org.apache.fop.render.AbstractRenderer.renderSpanArea(Unknown Source)
at org.apache.fop.layout.SpanArea.render(Unknown Source)
at 
org.apache.fop.render.AbstractRenderer.renderBodyAreaContainer(Unknown 
Source)
at org.apache.fop.render.pdf.PDFRenderer.renderPage(Unknown Source)
at org.apache.fop.render.pdf.PDFRenderer.render(Unknown Source)
at org.apache.fop.apps.StreamRenderer.queuePage(Unknown Source)
at org.apache.fop.layout.AreaTree.addPage(Unknown Source)
at org.apache.fop.fo.pagination.PageSequence.format(Unknown Source)
at org.apache.fop.apps.StreamRenderer.render(Unknown Source)
at org.apache.fop.fo.FOTreeBuilder.endElement(Unknown Source)
at 
org.apache.cocoon.xml.AbstractXMLPipe.endElement(AbstractXMLPipe.java:147)
at 
org.apache.xalan.transformer.ResultTreeHandler.endElement(ResultTreeHandler.
java:307)
at 
org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:
684)
at 
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(Transform
erImpl.java:2182)
at 
org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:
678)
at 
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(Transform
erImpl.java:2182)
at 
org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(Transformer
Impl.java:2008)
at 
org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.j
ava:1171)
at 
org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:3135)
at java.lang.Thread.run(Thread.java:536)

Here is the start of the SVG element:

fo:block
fo:instream-foreign-object height=480px width=640px
svg fill-opacity=1 color-rendering=auto 
color-interpolation=auto stroke

Re: Perplexing PDF SVG question

2003-06-23 Thread Irving Salisbury III
I am on windows XP using cocoon-2.0.4.  I understand the headless issue 
and that is not my problem. 

On the same box, I use the same version of fop (0.20.4), and the command 
line fop.bat file renders it perfectly.  Running inisde cocoon gives me 
the error that I outlined below.

Irv

Schaper, Christoph wrote:

Just guessing: You are on Unix and you don't have the display variable set
when you run  cocoon? 
If this is the case, either point the display variable to your X environment
or, if you don't have one search in the cocoon docu for headless.

Christoph

-Original Message-
From: Irving Salisbury III [mailto:[EMAIL PROTECTED]
Sent: 23 June 2003 15:27
To: [EMAIL PROTECTED]
Subject: Perplexing PDF SVG question
I have embedded an SVG image into my xsl:fo document.  It renders fine 
when using command line fop.  However, when I put it in a cocoon 
pipeline, I am getting the following error:

ERROR   (2003-06-23) 08:02.42:903   [sitemap.serializer.fo2pdf.fop] 
(/medicaid/sequence/first/pdf) Thread-10/PDFRenderer: svg graphic could 
not be built: null
java.lang.NullPointerException
   at java.net.URL.init(URL.java:366)
   at java.net.URL.init(URL.java:329)
   at java.net.URL.init(URL.java:321)
   at java.net.URL.init(URL.java:252)
   at java.net.URL.init(URL.java:275)
   at org.apache.batik.util.ParsedURLData.buildURL(Unknown Source)
   at org.apache.batik.util.ParsedURLData.openStreamInternal(Unknown 
Source)
   at org.apache.batik.util.ParsedURLData.openStream(Unknown Source)
   at org.apache.batik.util.ParsedURL.openStream(Unknown Source)
   at 
org.apache.batik.dom.svg.SAXSVGDocumentFactory.createDocument(Unknown 
Source)
   at org.apache.batik.bridge.DocumentLoader.loadDocument(Unknown Source)
   at org.apache.batik.bridge.URIResolver.getNode(Unknown Source)
   at org.apache.batik.bridge.URIResolver.getElement(Unknown Source)
   at 
org.apache.batik.bridge.BridgeContext.getReferencedElement(Unknown Source)
   at org.apache.batik.bridge.CSSUtilities.convertClipPath(Unknown Source)
   at 
org.apache.batik.bridge.AbstractGraphicsNodeBridge.buildGraphicsNode(Unknown

Source)
   at 
org.apache.batik.bridge.SVGShapeElementBridge.buildGraphicsNode(Unknown 
Source)
   at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(Unknown Source)
   at org.apache.batik.bridge.GVTBuilder.buildComposite(Unknown Source)
   at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(Unknown Source)
   at org.apache.batik.bridge.GVTBuilder.buildComposite(Unknown Source)
   at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(Unknown Source)
   at org.apache.batik.bridge.GVTBuilder.buildComposite(Unknown Source)
   at org.apache.batik.bridge.GVTBuilder.build(Unknown Source)
   at org.apache.fop.render.pdf.PDFRenderer.renderSVGDocument(Unknown 
Source)
   at org.apache.fop.render.pdf.PDFRenderer.renderSVGArea(Unknown Source)
   at org.apache.fop.svg.SVGArea.render(Unknown Source)
   at 
org.apache.fop.render.pdf.PDFRenderer.renderForeignObjectArea(Unknown 
Source)
   at org.apache.fop.layout.inline.ForeignObjectArea.render(Unknown Source)
   at org.apache.fop.render.AbstractRenderer.renderLineArea(Unknown Source)
   at org.apache.fop.layout.LineArea.render(Unknown Source)
   at org.apache.fop.render.AbstractRenderer.renderBlockArea(Unknown 
Source)
   at org.apache.fop.layout.BlockArea.render(Unknown Source)
   at 
org.apache.fop.render.AbstractRenderer.renderAreaContainer(Unknown Source)
   at org.apache.fop.layout.ColumnArea.render(Unknown Source)
   at org.apache.fop.render.AbstractRenderer.renderSpanArea(Unknown Source)
   at org.apache.fop.layout.SpanArea.render(Unknown Source)
   at 
org.apache.fop.render.AbstractRenderer.renderBodyAreaContainer(Unknown 
Source)
   at org.apache.fop.render.pdf.PDFRenderer.renderPage(Unknown Source)
   at org.apache.fop.render.pdf.PDFRenderer.render(Unknown Source)
   at org.apache.fop.apps.StreamRenderer.queuePage(Unknown Source)
   at org.apache.fop.layout.AreaTree.addPage(Unknown Source)
   at org.apache.fop.fo.pagination.PageSequence.format(Unknown Source)
   at org.apache.fop.apps.StreamRenderer.render(Unknown Source)
   at org.apache.fop.fo.FOTreeBuilder.endElement(Unknown Source)
   at 
org.apache.cocoon.xml.AbstractXMLPipe.endElement(AbstractXMLPipe.java:147)
   at 
org.apache.xalan.transformer.ResultTreeHandler.endElement(ResultTreeHandler.
java:307)
   at 
org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:
684)
   at 
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(Transform
erImpl.java:2182)
   at 
org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:
678)
   at 
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(Transform
erImpl.java:2182)
   at 
org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(Transformer
Impl.java:2008)
   at 
org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.j
ava:1171

Re: Perplexing PDF SVG question

2003-06-23 Thread Torsten Spindler
On Mon, 2003-06-23 at 15:27, Irving Salisbury III wrote:
 ERROR   (2003-06-23) 08:02.42:903   [sitemap.serializer.fo2pdf.fop] 
 (/medicaid/sequence/first/pdf) Thread-10/PDFRenderer: svg graphic could 
 not be built: null

If you use batik for rendering SVGs you need an X-Server running or Java
configured to run headless (java.awt.headless=true). As the latter may
introduce some problems (according to
http://wiki.cocoondev.org/Wiki.jsp?page=Cocoon2.1m2SetupLinuxredhat8.0) 

I start Xvfb from a start script (on RedHat 7.3):

export DISPLAY=:1
if [ ! -f /tmp/.X1-lock ]; then
/usr/X11R6/bin/Xvfb $DISPLAY -screen 0 800x600x8 
else
echo X-Server already running
fi

Bye,
Torsten


signature.asc
Description: This is a digitally signed message part


Re: Perplexing PDF SVG question

2003-06-23 Thread Irving Salisbury III




I am running this on windows XP. Do I still need to do this?

Irv

Torsten Spindler wrote:

  On Mon, 2003-06-23 at 15:27, Irving Salisbury III wrote:
  
  
ERROR   (2003-06-23) 08:02.42:903   [sitemap.serializer.fo2pdf.fop] 
(/medicaid/sequence/first/pdf) Thread-10/PDFRenderer: svg graphic could 
not be built: null

  
  
If you use batik for rendering SVGs you need an X-Server running or Java
configured to run headless (java.awt.headless=true). As the latter may
introduce some problems (according to
http://wiki.cocoondev.org/Wiki.jsp?page=Cocoon2.1m2SetupLinuxredhat8.0) 

I start Xvfb from a start script (on RedHat 7.3):

export DISPLAY=:1
if [ ! -f /tmp/.X1-lock ]; then
/usr/X11R6/bin/Xvfb $DISPLAY -screen 0 800x600x8 
else
echo "X-Server already running"
fi

Bye,
Torsten
  





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Perplexing PDF SVG question

2003-06-23 Thread J.Pietschmann
Irving Salisbury III wrote:

I have embedded an SVG image into my xsl:fo document.  It renders fine 
when using command line fop.  However, when I put it in a cocoon 
pipeline, I am getting the following error:

ERROR   (2003-06-23) 08:02.42:903   [sitemap.serializer.fo2pdf.fop] 
...
java.lang.NullPointerException
   at java.net.URL.init(URL.java:366)
...
   at org.apache.batik.util.ParsedURLData.buildURL(Unknown Source)
You seem to have an internal reference like gradient id=#foo
in an inlined SVG. Don't do this, it wont work. And no, strictly
spoken this is not even a bug. Either reference the SVG as external
graphic, or use a full absolute URL to an external URL for the
reference.
J.Pietschmann



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Perplexing PDF SVG question

2003-06-23 Thread Irving Salisbury III
I am using a third partly library that does things like  url( 
#someReference), so I can't get around it. 

Why is this not a bug, it seems like something that should be supported, 
and batik even has a bug fix in 1.5b4 (that happens to break the library 
code for me)

Irv

J.Pietschmann wrote:

Irving Salisbury III wrote:

I have embedded an SVG image into my xsl:fo document.  It renders 
fine when using command line fop.  However, when I put it in a cocoon 
pipeline, I am getting the following error:

ERROR   (2003-06-23) 08:02.42:903   [sitemap.serializer.fo2pdf.fop] 
...

java.lang.NullPointerException
   at java.net.URL.init(URL.java:366)
...

   at org.apache.batik.util.ParsedURLData.buildURL(Unknown Source)


You seem to have an internal reference like gradient id=#foo
in an inlined SVG. Don't do this, it wont work. And no, strictly
spoken this is not even a bug. Either reference the SVG as external
graphic, or use a full absolute URL to an external URL for the
reference.
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: Perplexing PDF SVG question

2003-06-23 Thread J.Pietschmann
Irving Salisbury III wrote:

I am using a third partly library that does things like  url( 
#someReference), so I can't get around it.
Why is this not a bug, it seems like something that should be supported, 
and batik even has a bug fix in 1.5b4 (that happens to break the library 
code for me)
Both the SVG and FO spec avoid even talking on how url(#stuff) should
be interpreted if the SVG is embedded in a FO document. Actually,
the whole semantic of embedded content is processor dependent, in
other words we could do what we see fit. Therefore, as I said, this
is spec conformant, read: no bug. I agree that it violates user
assumptions on how the whole mess ought to be resolved. There are a
few hurdles on the way which prevent simple fixes on the FOP side
though.
J.Pietschmann



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Perplexing PDF SVG question

2003-06-23 Thread Irving Salisbury III
Thanks for the info.  I will go down another path with this. 

Irv

J.Pietschmann wrote:

Irving Salisbury III wrote:

I am using a third partly library that does things like  url( 
#someReference), so I can't get around it.
Why is this not a bug, it seems like something that should be 
supported, and batik even has a bug fix in 1.5b4 (that happens to 
break the library code for me)


Both the SVG and FO spec avoid even talking on how url(#stuff) should
be interpreted if the SVG is embedded in a FO document. Actually,
the whole semantic of embedded content is processor dependent, in
other words we could do what we see fit. Therefore, as I said, this
is spec conformant, read: no bug. I agree that it violates user
assumptions on how the whole mess ought to be resolved. There are a
few hurdles on the way which prevent simple fixes on the FOP side
though.
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]