[ 
https://issues.apache.org/jira/browse/FOP-1747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15391844#comment-15391844
 ] 

Simone Rondelli commented on FOP-1747:
--------------------------------------

Hi Glenn, 

I had an issue with SVG and DTD and I'll try to explain better. When ApacheFOP 
have to render SVG images it uses Batik  which, apparently, tries to download 
the DTD definition declared in the SVG file.

{code:xml}
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN" 
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd";>
<svg width="10px" height="10px" xmlns="http://www.w3.org/2000/svg";>
    <circle cx="10px" cy="0" r="9.5px" stroke="black" stroke-width="1px" 
fill="none" />
</svg>
{code}

I'm facing this issue rendering a template that contains 4 SVG each of them 
takes 15 seconds to download the same DTD. The strange thing is that this is 
happening only in Production and not in my local env. (more details here: 
http://stackoverflow.com/questions/38510427/apachefop-svg-background-very-slow)

BTW the class that handle the SVG preloading is 
{{org.apache.fop.image.loader.batik.SVGPreloader}} which uses 
{{SAXSVGDocumentFactory}} to create the SVG Document.  I have created a custom 
{{EntityResolver}} that loads the DTD form the same folder of {{SVGPreloader}}. 
I don't know if this is the right approach, especially because I would prefer 
to not modify ApacheFOP if possible. 

# Is there any way to avoid the DTD fetch without modify ApacheFOP?
# If not, is the right thing top do to bundle the DTD with ApacheFOP and use a 
custom {{EntityResolver}} to read it?
# Is this related to: https://issues.apache.org/jira/browse/BATIK-1018?

Thanks
Simone Rondelli

> FOP should provide SVG DTD
> --------------------------
>
>                 Key: FOP-1747
>                 URL: https://issues.apache.org/jira/browse/FOP-1747
>             Project: FOP
>          Issue Type: Improvement
>          Components: image/svg
>    Affects Versions: trunk
>         Environment: Operating System: All
> Platform: All
>            Reporter: J.Pietschmann
>
> Currently, DTDs in external SVG graphics are loaded from their standard
> location on the Net. This may cause problems for machines not connected
> to the Net.
> FOP should provide an infrastructure which loads the standard SVG DTDs
> (and possibly other standard DTDs) from a local location.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to