Skip to main content



      Home
Home » Modeling » Graphiti » Problem with SVG(SVG error)
Problem with SVG [message #1837035] Thu, 21 January 2021 04:33 Go to next message
Eclipse UserFriend
Hi all,

I use batik and canvas class to load and display an svg image .
Here my java code and please find attached the xml code of my svg image
.
mainFrame = new JFrame("Task Graph");
mainFrame.setSize(800,600);

mainFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
mainFrame.setVisible(true);

Container pane = mainFrame.getContentPane();
pane.setLayout(new BorderLayout());
JSVGCanvas canvas = new JSVGCanvas();
canvas.setURI("output.xml");
pane.add(canvas, BorderLayout.CENTER);
pane.setVisible(true);

My problem is when I run the code:, I get this error:

"svg error: content is not allowed in prolog.

Could you help me please!!
Thank you in advance
  • Attachment: output.xml
    (Size: 4.81KB, Downloaded 126 times)
Re: Problem with SVG [message #1837116 is a reply to message #1837035] Fri, 22 January 2021 06:22 Go to previous messageGo to next message
Eclipse UserFriend
Hi Mariem,

I'm not a SVG expert, but it seems that your xml file is somehow incorrect. From the error I think it might be the tags 'width="1967pt" height="76pt"
viewBox="0.00 0.00 1967.04 76.00"' within the svg tag, not sure if that is allowed.

Maybe you should reach out in a Batik or SVG specific group, this forum is mainly about Graphiti, we just use it as one export possibility.

Michael
Re: Problem with SVG [message #1837117 is a reply to message #1837116] Fri, 22 January 2021 06:48 Go to previous message
Eclipse UserFriend
HI Michael,

Thank you for your response.
OK I will try with the other specific groups.

Mariem

[Updated on: Fri, 22 January 2021 06:49] by Moderator

Previous Topic:Detecting boundaries of the target container
Next Topic:delete
Goto Forum:
  


Current Time: Wed Jun 25 00:33:25 EDT 2025

Powered by FUDForum. Page generated in 0.08002 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top