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.

<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN" 
<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" />

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: 

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?

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

Reply via email to