SVG to PNG- JPEG- PDF

Hello,
I do test on your product Imaging 16.10 to convert SVG image to other format : png, jpeg or insert in document pdf or docx.
And when I implement or use your sample with my svg images I have nothing.
All my images are white or have a bad display.
I sent my sample in the post (do restore the package in the solution).
What do I do in code that does not allow to do the conversion?
Thanks
Regards
Laurent Albiac

Hi Laurent,

Thank you for your inquiry and sharing sample.

This is to update you that we have investigated the issue at our end. Initial investigation shows that the issue persists. The issue has been logged into our system with ID IMAGINGNET-2148. Our product team will further look into it. We will update with their feedback via this forum thread.

Hello,
Thank you very much for the consideration of my request.
What would be the delay in giving me an answer on this problem?
Whether it was I who did the wrong thing or the product.
Thank you

Hi Laurent,

Thank you for writing us back.

This is to update you that initial findings have been submitted to our product team. Your inquiry is currently in the query along with other quires. Once our product team will share any feedback, we will share those details with you.

Further to update that support for converting SVG to PDF format is not available. A feature request has been logged into our system with ID IMAGINGNET-2150. Our product team will further look into it.

Hello,


I also have issues with transforming SVGs to PNG format.

my environment:
Windows 10
jre1.8.0_74
Aspose imaging 3.9.0

1. My first issue is bad conversion, because the converted PNG (output.png) are not even close to the original SVG.
I attach sample SVG file (input.svg), which you can use for your tests. I also attach PNG which I produced with the sample code below:

String svgFile = “c:/input.svg”;
String pngFile = “c:/output.png”;
com.aspose.imaging.Image image = com.aspose.imaging.Image.load(svgFile);
// Cast image object to SVG image
com.aspose.imaging.fileformats.svg.SvgImage svgImage = (com.aspose.imaging.fileformats.svg.SvgImage) image;
// convert and save PNG file format.
FileOutputStream baos = new FileOutputStream(pngFile);
svgImage.save(baos, new com.aspose.imaging.imageoptions.PngOptions());
baos.close();


2. My second question is how can I load SVG image to com.aspose.imaging.Image class from byteArray in memory, because I have SVG in String, so I don’t want to save SVG file to file system before I can load it into Image class:

Image.load(InputStream, LoadOption);

What kind of LoadOption I must provide to the method above, that the input stream of SVG file will normally load?

Regards
Uros
Hi Uros,

Thank you for your inquiry and sharing sample.

This is to update you that we have investigated your first issue. Initial investigation shows that the issue persists. The issue has been logged into our system with ID IMAGINGNET-2211. Our product team will further look into it and provide feedback.

Furthermore LoadOption only supports following formats.

  • Jpeg2000LoadOptions
  • MetafileLoadOptions
  • PngLoadOptions

SVG format is not supported. You can load the SVG file as stream into Imaging class. Sample code snippet is given below for your reference.

CODE:

java.io.File objFile = new java.io.File("input.svg");
java.io.FileInputStream objFIS = new java.io.FileInputStream(objFile);
byte[] fileSVG = new byte[(int)objFile.length()];
objFIS.read(fileSVG);
objFIS.close();
com.aspose.imaging.fileformats.svg.SvgImage image = (com.aspose.imaging.fileformats.svg.SvgImage)
com.aspose.imaging.Image.load(new java.io.ByteArrayInputStream(fileSVG));
com.aspose.imaging.imageoptions.PngOptions options = new com.aspose.imaging.imageoptions.PngOptions();
image.save("input_svg.png", options);

Hope the above information helps. Feel free to contact us in case of any query or comments.

The issues you have found earlier (filed as IMAGINGNET-2211;IMAGINGNET-2150;IMAGINGNET-2148) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

The issues you have found earlier (filed as ) have been fixed in this Aspose.Words for JasperReports 18.3 update.