Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6609995
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:47:04+00:00 2026-05-25T19:47:04+00:00

The image is chopping off when i am trying to convert svg file to

  • 0

The image is chopping off when i am trying to convert svg file to png image using org.apache.batik.apps.rasterizer.SVGConverter. The java code is mentioned below.

SVGConverter svgConverter = new SVGConverter();
svgConverter.setDestinationType(DestinationType.PNG);
svgConverter.setSources(new String[]{ new File(svgsource).toURL().toString() });
svgConverter.setDst(new File(imgDest));
svgConverter.execute();

Also please find the code for SVG file.

<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
 <line x1="10" y1="0" x2="10" y2="500" style="stroke: #000000; stroke-width: 1;" />
 <line x1="10" y1="500" x2="500" y2="500" style="stroke: #000000; stroke-width: 1;" />

<text x="0" y="520"  style="stroke: none; fill: #000000; font-family: Arial; font-size: 10px;" >3PA</text>
<line x1="100" y1="0" x2="100" y2="500" style="stroke: darkgray; stroke-width: 0.2" />
<text x="100" y="520"  style="stroke: none; fill: #000000; font-family: Arial; font-size: 10px;" >3PB</text>
<line x1="200" y1="0" x2="200" y2="500" style="stroke: darkgray; stroke-width: 0.2" />
<text x="200" y="520"  style="stroke: none; fill: #000000; font-family: Arial; font-size: 10px;" >3PC</text>
<line x1="300" y1="0" x2="300" y2="500" style="stroke: darkgray; stroke-width: 0.2" />
<text x="300" y="520"  style="stroke: none; fill: #000000; font-family: Arial; font-size: 10px;" >4PA</text>
<line x1="400" y1="0" x2="400" y2="500" style="stroke: darkgray; stroke-width: 0.2" />
<text x="400" y="520"  style="stroke: none; fill: #000000; font-family: Arial; font-size: 10px;" >4PB</text>

<line x1="10" y1="100" x2="500" y2="100" style="stroke: darkgray; stroke-width: 0.2" />
<line x1="10" y1="200" x2="500" y2="200" style="stroke: darkgray; stroke-width: 0.2" />
<line x1="10" y1="300" x2="500" y2="300" style="stroke: darkgray; stroke-width: 0.2" />
<line x1="10" y1="400" x2="500" y2="400" style="stroke: darkgray; stroke-width: 0.2" />


<line x1="10" y1="450" x2="100" y2="450" 
      style="stroke:yellow; stroke-width:5; stroke-linejoin:miter" />


<line x1="100" y1="450" x2="200" y2="330" 
      style="stroke:yellow; stroke-width:5; stroke-linejoin:miter" />


<line x1="200" y1="330" x2="300" y2="380" 
      style="stroke:yellow; stroke-width:5; stroke-linejoin:miter" />



<polygon points="300,380 400,320 400,360 300,380"
    style="fill:paleturquoise; stroke: darkturquoise; stroke-width:1" />


<line x1="100" y1="420" x2="100" y2="460" 
    style="fill:darkturquoise; stroke: darkturquoise; stroke-width:7" />


<line x1="200" y1="340" x2="200" y2="380" 
      style="stroke:darkturquoise; stroke: darkturquoise; stroke-width:7" />

<line x1="300" y1="310" x2="300" y2="350" 
      style="stroke:darkturquoise; stroke: darkturquoise; stroke-width:7" />


<line x1="400" y1="320" x2="400" y2="360" 
      style="stroke:darkturquoise; stroke: darkturquoise; stroke-width:7" />


<text x="400" y="320"  style="stroke: none; fill: #000000; font-family: Arial; font-size: 10px;" >320</text>
<text x="400" y="360"  style="stroke: none; fill: #000000; font-family: Arial; font-size: 10px;" >360</text>




</svg>

Please also find the online editor image Online_Editor_image.JPG and png file which is generated by the Java code enter image description here.

Please help me to get the full image as online image editor.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T19:47:05+00:00Added an answer on May 25, 2026 at 7:47 pm

    Mention the height and width in svg tag like

    <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="600" height="600">

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Image Dummy = Image.FromFile(image.png); Dummy.Save(image.bmp, ImageFormat.Bmp); what the question says i have these using
I am using jcrop to implement image cropping in my site. After clicking on
I am trying to understand why after cropping an image in .NET i end
I am having an issue I have yet to see elsewhere using the image
I'm trying to remove all white or transparent pixels from an image, leaving the
Basicly i'm trying to create image cropping script, and it's almost done, here is
I'm using the latest version of jquery.jcrop. When invoking jcrop() on an image, the
I'm trying to use the IMagick PHP wrapper to assist in chopping a specified
I am using Imagemagick for resizing and cropping image. Test Image : I need
Ok, what I'm trying to achieve is to load an image as a single

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.