Hi and thanks for the help.

I tried your suggestions but am still having problems.

I have new.jpg in my c:\inetpub\wwwroot directory and it is accessible in my
browser with:
http://localhost/new.jpg

I have new.svg in my c:\inetpub\wwwroot directory and it is accessible in my
browser with:
http://localhost/new.svg

this JPG works in my fo file:
<fo:block>
        <fo:external-graphic src="http://localhost/new.jpg"/>
</fo:block>

this SVG doesn't:
<fo:block>
        <fo:external-graphic src="http://localhost/new.svg"/>
</fo:block>

if I try all these workarounds...I get a java error (see below)

<fo:instream-foreign-object>
        <image width="100" height="100">
                <xsl:attribute
name="xlink:href">http://localhost/new.svg</xsl:attribute>
        </image>
</fo:instream-foreign-object>

<fo:instream-foreign-object>
        <image width="100" height="100">
                <xsl:attribute
name="xlink:href">C:\inetpub\wwwroot\new.svg</xsl:attribute>
        </image>
</fo:instream-foreign-object>

<fo:instream-foreign-object>
        <image width="100" height="100">
                <xsl:attribute
name="xlink:href">file:///c:/inetpub/wwwroot/new.svg</xsl:attribute>
        </image>
</fo:instream-foreign-object>

if I substitute new.jpg for new.svg in the above examples it doesn't work
either.  I think I have the syntax wrong.  What exactly should
PathToImage.svg be?

here is the java error I get in my browser based on the above tries...

500 Internal Server Error

/servlet/FopServlet:

null
java.lang.AbstractMethodError
        at org.apache.fop.fo.XMLObj.addGraphic(XMLObj.java:51)
        at org.apache.fop.fo.XMLObj.addChild(XMLObj.java:126)
        at org.apache.fop.fo.UnknownXMLObj.addChild(UnknownXMLObj.java:80)
        at
org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:276)
        at
org.apache.xerces.parsers.SAXParser.startElement(SAXParser.java:1371)
        at
org.apache.xerces.validators.common.XMLValidator.callStartElement(XMLValidat
or.java:840)
        at
org.apache.xerces.framework.XMLDocumentScanner.scanElement(XMLDocumentScanne
r.java:1853)
        at
org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XM
LDocumentScanner.java:1234)
        at
org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.
java:381)
        at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:948)
        at org.apache.fop.apps.Driver.render(Driver.java:481)
        at org.apache.fop.apps.Driver.run(Driver.java:554)
        at FopServlet.renderFO(FopServlet.java:102)
        at FopServlet.doGet(FopServlet.java:64)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at allaire.jrun.servlet.JRunSE.service(JRunSE.java:1417)
        at
allaire.jrun.session.JRunSessionService.service(JRunSessionService.java:1088
)
        at allaire.jrun.servlet.JRunSE.runServlet(JRunSE.java:1271)
        at
allaire.jrun.servlet.JRunNamedDispatcher.forward(JRunNamedDispatcher.java:39
)
        at allaire.jrun.servlet.Invoker.service(Invoker.java:84)
        at allaire.jrun.servlet.JRunSE.service(JRunSE.java:1417)
        at
allaire.jrun.session.JRunSessionService.service(JRunSessionService.java:1088
)
        at allaire.jrun.servlet.JRunSE.runServlet(JRunSE.java:1271)
        at
allaire.jrun.servlet.JRunRequestDispatcher.forward(JRunRequestDispatcher.jav
a:89)
        at allaire.jrun.servlet.JRunSE.service(JRunSE.java:1557)
        at allaire.jrun.servlet.JRunSE.service(JRunSE.java:1547)
        at allaire.jrun.servlet.JvmContext.dispatch(JvmContext.java:364)
        at allaire.jrun.http.WebEndpoint.run(WebEndpoint.java:115)
        at allaire.jrun.ThreadPool.run(ThreadPool.java:272)
        at allaire.jrun.WorkerThread.run(WorkerThread.java:75)

  

-----Original Message-----
From: Sam Prokop [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 04, 2002 5:54 AM
To: [EMAIL PROTECTED]
Subject: AW: JPEG external graphic works, but SVG external graphic
doesn't.



i use the following workaround:

<fo:instream-foreign-object>
        <image width="xxx" height="xxx">
                <xsl:attribute
name="xlink:href">PathToImage.svg</xsl:attribute>
        </image>
</fo:instream-foreign-object>


> -----Ursprüngliche Nachricht-----
> Von: Carter, Will [mailto:[EMAIL PROTECTED]
> Gesendet: Donnerstag, 4. April 2002 01:17
> An: '[EMAIL PROTECTED]'
> Betreff: JPEG external graphic works, but SVG external 
> graphic doesn't.
> 
> 
> Hi,
> 
> I am having problems with external svg files in my fo file 
> when generating
> PDFs using FopServlet.
> 
> I am using fop-0.20.3
> 
> specifically, I have these refs to external graphics in my fo file.
> 
> This works:
> <fo:block>
>       <fo:external-graphic
> src="file:C:\Progra~1\Allaire\JRun\servers\default\default-app
> \WEB-INF\class
> es\generatedjpg.jpg"/>
> </fo:block>
> 
> This doesn't work....generatedsvg.svg is in the same directory as
> generatedjpg.jpg.  the resulting pdf has a blank space where 
> the svg should
> be.
> <fo:block>
>       <fo:external-graphic
> src="file:C:\Progra~1\Allaire\JRun\servers\default\default-app
> \WEB-INF\class
> es\generatedsvg.svg"/>
> </fo:block>
> 
> This doesn't work....generatedsvg.svg is in the same directory as
> generatedjpg.jpg.  the resulting pdf has a blank space where 
> the svg should
> be.
> <fo:block>
>       <fo:external-graphic
> src="file:///c:/Progra~1/Allaire/JRun/servers/default/default-
> app/WEB-INF/cl
> asses/generatedsvg.svg"/>
> </fo:block>
> 
> any help would be greatly appreciated.
> Will Carter
> 

Reply via email to