Insert svg into pdf

Hello,

I have been using Aspose.PDF to convert pdf file into svg.I have a couple of questions.

1.Is there a way to import a svg logo in my pdf or at a particular location.I tried this code from a thread in your forum :How to insert vector images (pdf/ai/svg) in Aspose.Pdf.Generator.Image - #3 by FalconAankoop which talked about the ticket PDFNEWNET-39501.

// Instantiate Document Object<o:p></o:p>

Document doc = new Document();

// Add a page to pages collection of document

Aspose.Pdf.Page page = doc.Pages.Add();

// Create an image object

Aspose.Pdf.Image image1 = new Aspose.Pdf.Image();

image1.File = myDir + “sample_car.svg”;

image1.FileType = Aspose.Pdf.ImageFileType.Svg;

// Aspose.Pdf measuring unit is point, 1 inch= 72 point= 2.54 cm

image1.FixWidth = 283.4645669;

image1.FixHeight = 283.4645669;

// Add the image into paragraphs collection of the section

page.Paragraphs.Add(image1);

// Set the image file stream

// Save resultant PDF file

doc.Save(“E:/Data/Image2PDF_DOM.pdf”);

It does adds another page in pdf and adds the svg there.Does it remain a svg after importing into pdf?

2.The pdf to svg produces a very big file size compared to the converted svg in inkscape.Is there any known reason for this?Which properties can be used so that the file size is lesser and more suitable to render on web browser.

Thank You

@arunasrathore

Thank you for contacting support.

You may add Image Stamp in PDF File with XIndent and YIndent properties, at any position on a page. The image will be added as SVG image to page’s resources.

Moreover, would you please share source and generated files along with SSCCE code so that we may try to reproduce and investigate further to help you out. Before sharing requested data, please ensure using Aspose.PDF for .NET 19.6.

Thank You so much .I am trying to implement your suggested approach and will follow your inputs when sharing data next time.

@arunasrathore

Please feel free to contact us if you need any further assistance.