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

Free Support Forum - aspose.com

Adding SVG to PDF doesn't preserve vector

I am trying to add an SVG image to a PDF using Aspose PDF. The image is added but it isnt preserved as a vector in the PDF. It seems to be converted to more of a bitmap type image. Is there any way to achieve this?

        new Aspose.Pdf.License().SetLicense(@"Aspose.Total.lic");

        var pdfDoc = new Document();
        var pdfPage = pdfDoc.Pages.Add();
        
        using (var fileStream = File.OpenRead(@"C:\Users\Paul\Desktop\GoogleLogo.svg"))
        {
            var image = new Image
                {
                    ImageStream = fileStream,
                    FileType = ImageFileType.Svg,
                    FixWidth = 200,
                    FixHeight = 200
                };

            pdfPage.Paragraphs.Add(image);

            pdfDoc.Save(@"C:\Users\Paul\Desktop\VectorX.pdf");
        }

The SVG file can be found here: https://commons.wikimedia.org/wiki/File:Google_"G"_Logo.svg

@paul.dell

Thank you for contacting support.

We have attached generated PDF document. Would you please elaborate further while sharing some screenshots for our reference.VectorX.pdf

If you zoom into the PDF you attached you can see its not a vector. You can also tell from the file size of the PDF that its too large to be a vector. Here is an image of it zoomed in:
Zoomed.png (64.6 KB)

If it was a vector it would look more like this:
Correct.png (73.3 KB)

@paul.dell

Thank you for elaborating it further.

We have been able to notice the difference in our environment. A ticket with ID PDFNET-46350 has been logged in our issue management system for further investigation and resolution. The ticket ID has been linked with this thread so that you will receive notification as soon as the ticket is resolved.

We are sorry for the inconvenience.