Uploaded image for project: 'Batik'
  1. Batik
  2. BATIK-560

Problem with converting WMF files to SVG Documents

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Incomplete
    • Affects Version/s: 1.8
    • Fix Version/s: None
    • Component/s: SVGGraphics2D
    • Labels:
      None
    • Environment:
      Operating System: Windows XP
      Platform: PC

      Description

      It seems not possible to convert directly WMF files to SVG Documents. An
      Exception is explicitely raised in WMFTranscoder if trying to do so. Further,
      if trying to removed this Exception raising, the resulting SVG Document has no
      content, appart for the svg root Element.

      The cause of this problem seems in fact to be the getRoot() method in the
      SVGGraphics2D class : the code is simply :
      public Element getRoot()

      { return getRoot(null); }

      which calls in the same class :
      public Element getRoot(Element svgRoot)

      { svgRoot = domTreeManager.getRoot(svgRoot); ... return svgRoot; }

      The DOMTreemanager creates a new svg Element in the tree, even if it already
      exists. I think the code in SVGGraphics2D should be something like that :
      public Element getRoot(){
      Document doc = getDOMFactory();
      Element elt = doc.getDocumentElement();
      if (elt.getTagName().equals(SVGConstants.SVG_SVG_TAG)) return getRoot(elt);
      else

      { NodeList list = elt.getElementsByTagName(SVGConstants.SVG_SVG_TAG); if ((list == null) || (list.getLength() == 0)) return getRoot(null); else return getRoot((Element)(list.item(0))); }

      return getRoot(null);
      }

        Attachments

        1. bug35515.patch
          1 kB
          Hervé Girod

          Issue Links

            Activity

              People

              • Assignee:
                batik-dev@xmlgraphics.apache.org Batik Developer's Mailing list
                Reporter:
                herve.girod@club-internet.fr Hervé Girod
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: