git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@194486 13f79535-47bb-0310-9956-ffa450edef68tags/fop-0_20_3
@@ -699,7 +699,13 @@ public class AWTRenderer extends AbstractRenderer implements Printable, Pageable | |||
GVTBuilder builder = new GVTBuilder(); | |||
BridgeContext ctx = new BridgeContext(userAgent); | |||
GraphicsNode root; | |||
root = builder.build(ctx, doc); | |||
try { | |||
root = builder.build(ctx, doc); | |||
} catch (Exception e) { | |||
log.error("svg graphic could not be built: " | |||
+ e.getMessage(), e); | |||
return; | |||
} | |||
float w = (float)ctx.getDocumentSize().getWidth() * 1000f; | |||
float h = (float)ctx.getDocumentSize().getHeight() * 1000f; | |||
@@ -409,7 +409,13 @@ public class PDFRenderer extends PrintRenderer { | |||
GraphicsNode root; | |||
root = builder.build(ctx, doc); | |||
try { | |||
root = builder.build(ctx, doc); | |||
} catch (Exception e) { | |||
log.error("svg graphic could not be built: " | |||
+ e.getMessage(), e); | |||
return; | |||
} | |||
// get the 'width' and 'height' attributes of the SVG document | |||
float w = (float)ctx.getDocumentSize().getWidth() * 1000f; | |||
float h = (float)ctx.getDocumentSize().getHeight() * 1000f; |
@@ -295,13 +295,21 @@ public class PSRenderer extends AbstractRenderer { | |||
int y = this.currentYPosition; | |||
Document doc = area.getSVGDocument(); | |||
UserAgent userAgent = new org.apache.fop.svg.SVGUserAgent(new AffineTransform()); | |||
org.apache.fop.svg.SVGUserAgent userAgent | |||
= new org.apache.fop.svg.SVGUserAgent(new AffineTransform()); | |||
userAgent.setLogger(log); | |||
GVTBuilder builder = new GVTBuilder(); | |||
BridgeContext ctx = new BridgeContext(userAgent); | |||
GraphicsNode root; | |||
root = builder.build(ctx, doc); | |||
try { | |||
root = builder.build(ctx, doc); | |||
} catch (Exception e) { | |||
log.error("svg graphic could not be built: " | |||
+ e.getMessage(), e); | |||
return; | |||
} | |||
// get the 'width' and 'height' attributes of the SVG document | |||
float w = (float)ctx.getDocumentSize().getWidth() * 1000f; | |||
float h = (float)ctx.getDocumentSize().getHeight() * 1000f; |
@@ -138,6 +138,13 @@ public class SVGElement extends SVGObj { | |||
}; | |||
((SVGOMDocument)doc).setSVGContext(dc); | |||
try { | |||
String baseDir = Configuration.getStringValue("baseDir"); | |||
((SVGOMDocument)doc).setURLObject(new URL(baseDir)); | |||
} catch (Exception e) { | |||
log.error("Could not set base URL for svg", e); | |||
} | |||
Element e = ((SVGDocument)doc).getRootElement(); | |||
String s; | |||
SVGUserAgent userAgent = new SVGUserAgent(new AffineTransform()); | |||
@@ -185,13 +192,6 @@ public class SVGElement extends SVGObj { | |||
element = doc.getDocumentElement(); | |||
try { | |||
String baseDir = Configuration.getStringValue("baseDir"); | |||
((SVGOMDocument)doc).setURLObject(new URL(baseDir)); | |||
} catch (Exception e) { | |||
// cannot use log yet | |||
//log.error("Could not set base URL for svg", e); | |||
} | |||
buildTopLevel(doc, element); | |||
} | |||