Failed to convert svg to pptx

I am evaluating the Aspose.Total for .NET before purchasing.

I get exceptions always when trying to convert a svg file to pptx or pdf file.

The following are the codes.

try {
var pdf = new Aspose.Pdf.Document(“cad.svg”);
pdf.Save(“cad.pptx”, Aspose.Pdf.SaveFormat.Pptx);
} catch (Exception e) {
m_stringError = e.ToString();
return;
}

}

Below are the contents of the exception when running the above coed.

Aspose.Pdf.InvalidPdfFileFormatException: Incorect file format
at . (String[] , String[] , Boolean )
at .. ( , & )
at . ( , & )
at ​ …ctor(Stream , String , Boolean )
at ​ …ctor(String )
at .(String )
at …ctor(String )
at .(String )
at . (String )
at …ctor(String )
at Aspose.Pdf.Document.(String , String )
at Aspose.Pdf.Document…ctor(String filename)

@Martin_Qi,

Thanks for the details.

You may follow the following steps in order to convert SVG file to PPTX file format:

  1. SVG --> PDF
  2. PDF --> PPTX

I am also moving your thread to Aspose.PDF forum where we will help you better.

@Martin_Qi

Aspose.Pdf.Document expects PDF document in its constructor in case you are loading existing file. However, you can load different formats by using respective LoadOptions. Concerning to your original requirement i.e. SVG to PPTX, as Amjad has also mentioned, you cannot perform conversion directly. Instead, you can convert SVG to PDF and PDF to PPTX afterwards. Please check following links to achieve what you require:

In case of any further assistance, please feel free to let us know.

Thanks for sharing sample files. It worked.