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

Free Support Forum - aspose.com

SVG images not sizing properly

Hi,


I’m noticed some inconsistencies in behavior when trying to use an svg compared to other image formats with the Aspose.Pdf.Image object. For example, I have this svg file and a png of the size that I actually want.

static void insertSvgIcon()
{
Document doc = new Document();
Page page = doc.Pages.Add();
page.PageInfo.Width = PageSize.PageLetter.Width;
page.PageInfo.Height = PageSize.PageLetter.Height;
page.PageInfo.Margin = new MarginInfo(27, 47, 27, 27);

var pngImage = new Aspose.Pdf.Image();
pngImage.File = @“check.png”;
pngImage.FixHeight = 12;
pngImage.FixWidth = 12;
page.Paragraphs.Add(pngImage);

var svgImage = new Aspose.Pdf.Image();
svgImage.FileType = ImageFileType.Svg;
svgImage.File = @“check.svg”;
svgImage.FixHeight = 12;
svgImage.FixWidth = 12;
page.Paragraphs.Add(svgImage);

doc.Save(“Image.pdf”);
}

Even though I set the same height and width of 12 points, the images are completely different sizes. Also, it looks like the svg icon is drawn off screen and not using the top left corner of the image as an origin point, which causes the image to render off the page boundaries.

Hi Daniel,


Thanks for using our API’s.

I have tested the scenario and have managed to reproduce same problem. For the sake of correction, I have logged it as PDFNET-40924 in our issue tracking system. We will further look into the details of this problem and will keep you posted on the status of correction. Please be patient and spare us little time. We are sorry for this inconvenience.

Hi,


Any updates on this?

Hi Daniel,


Thanks for your patience.

I am afraid the earlier reported issue is not yet resolved. However I have intimated the product team to evaluate the issue and as soon as we have some further updates regarding its resolution, we will let you know. We are sorry for this delay and inconvenience.

Hello Nayyer,

I am also facing similar issue,

Could you please notify me also for any further updates on this?

Hi Sameer,


Thanks for your inquiry. We have recorded your concern and will keep you updated about the issue resolution in this forum thread. However, we will appreciate it if you please share your sample SVG file here. We will test the file during issue investigation and resolution to ensure that the fix addresses your issue as well.

Thanks for your patience and cooperation.

Best Regards,

The issues you have found earlier (filed as PDFNET-40924) have been fixed in Aspose.Pdf for .NET 17.5.


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