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.