We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

SVG image not rendered correctly

Hi Team,

SVG is not rendered as expected. Please open attached image in IE or Firefox and then compare it with Word or PDF document generated using AsposeWordForJava 13.5. Find the sample code below.

Thanks,
Kumar

public static void main(String[] args) {
try {
System.out
.println("Aspose version is " + BuildVersionInfo.getProduct() + " - " + BuildVersionInfo.getVersion()); //$NON-NLS-1$ //$NON-NLS-2$
License license = new License();
InputStream licFile = new FileInputStream(
“D:\ks\work\RPE_2012\Aspose.Words.lic”); //$NON-NLS-1$
license.setLicense(licFile);
licFile.close();
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.insertImage(“D:\SVG.svg”); //$NON-NLS-1$
doc.save(“D:\SVG.doc”); //$NON-NLS-1$
doc.save(“D:\SVG.pdf”); //$NON-NLS-1$
System.out.println(“done”);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}

Hi Kumar,


Thanks for your inquiry. Please note that Aspose.Words tries to mimic the same behaviour as MS Word do. The SVG is not directly supported in Microsoft Word document, so during inserting SVG image, it will be converted to a format supported by Microsoft Word document and then inserted. Also, Microsoft Word natively supports image formats like Wmf, Emf, Jpeg, Png, Pict.

Hope this answers your query. Please let us know if you have any more queries.

Hi Tahir,

That is what I’m trying to say. There is some issue during SVG conversion to a format supported by MS Word.

I download this SVG from http://upload.wikimedia.org/wikipedia/en/c/ce/SVG-logo.svg. See the difference between the SVG in the above link with the one generated using Aspose library.

Thanks,
Kumar

Hi Kumar,


Thanks for sharing the detail. I have managed to reproduce the same issue at my side. I have logged this issue as WORDSNET-8353 in our issue tracking system. I have linked this forum thread to the same issue and you will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

Hi Tahir,

I want to raise an RFE (enhancement) to have the conversion made from SVG to EMF instead of PNG. Do you already have any such plan?

EMF is a vector graphic format supported by Word. So the image embedded
in the document would scale & look nice while the PNG one doesn’t.

Thanks,
Kumar

Hi Kumar,


Thanks for your inquiry.

Yes, the SVG is converted to PNG when a document is converted to Pdf. I have logged the requested feature as WORDSNET-8655 in our issue tracking system. You will be notified via this forum thread once this feature is available.

The issues you have found earlier (filed as WORDSNET-8353) have been fixed in this .NET update and this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.

The issues you have found earlier (filed as WORDSNET-8655) have been fixed in this .NET update and this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.
(6)

Hi Tahir,

There is still some minor distortion in the SVG image within the Word and PDF. Check out the image in the browser vs the image generated by Aspose.Words for Java for Word and PDF output.

Use the artifacts that I had shared in the first thread of this issue.

Thanks,
Kumar

Hi Kumar,


Thanks for your inquiry. I have managed to reproduce the same issue at my side. I have logged this issue as WORDSJAVA-911 in
our issue tracking system. I have linked this forum thread to the same
issue and you will be notified via this forum thread once this issue is
resolved.

We apologize for your inconvenience.

The issues you have found earlier (filed as WORDSJAVA-911) have been fixed in this .NET update and this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.