DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21946>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21946

[ERROR] svg graphic could not be built: null when running fop embedded

           Summary: [ERROR] svg graphic could not be built: null when
                    running fop embedded
           Product: Fop
           Version: 0.20.4
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: Major
          Priority: Other
         Component: svg
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


I am having a big problem with fop when trying to use the code below. Whenever
I run it with this code, I get the exceptions listed at the bottom of the
message. Whenever I run it with the commented code instead (using Fop.main), it
runs fine. I figured the problem is because my svg has references such as
'url(#clipPath2)' inside, and the way I am running below is not allowing fop to
resolve these uri's properly, or not finding the path to the input source
either. Is there something I am  missing?

Thanks,
Igor.

  /**
   * Creates the final pdf document
   * @throws Exception in case something goes wrong
   */
  protected void createPDF() throws Exception
  {
    Logger logger = new ConsoleLogger(ConsoleLogger.LEVEL_INFO);
    org.apache.fop.messaging.MessageHandler.setScreenLogger(logger);

    InputHandler inputHandler = new FOInputHandler( new File(
fTempOut.getAbsolutePath() ) );

    XMLReader parser = inputHandler.getParser();
   
    Driver driver = new Driver();

    driver.setLogger(logger);
   
    driver.setRenderer(Driver.RENDER_PDF);
    driver.setErrorDump(true);

    driver.setOutputStream( osDest );

    driver.render( parser, inputHandler.getInputSource() );

    /*
    String args[] = new String[4];
    args[0] = "-fo";
    args[1] = fTempOut.getAbsolutePath();
    args[2] = "-pdf";
    args[3] = "/tmp/test.pdf";
    org.apache.fop.apps.Fop.main( args );*/
  }

Error dump:

[INFO] building formatting object tree
[INFO] [1]
[INFO] [2]
[INFO] [3]
[INFO] [4]
[INFO] [5]
[ERROR] svg graphic could not be built: null
java.lang.NullPointerException
        at java.net.URL.<init>(URL.java:328)
        at java.net.URL.<init>(URL.java:253)
        at java.net.URL.<init>(URL.java:276)
        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)
        ... a lot more exceptions

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

Reply via email to