SLIDE to PDF problem

MemoryStream xmlDoc = new MemoryStream();
presentationDoc.SaveToPdf(xmlDoc);

Aspose.Pdf.Pdf pdf = new Aspose.Pdf.Pdf();
pdf.BindXML(xmlDoc, null);

Here I am getting the exception on the fourth line.
{pdf.BindXML(xmlDoc,null)}
The data at the root level is invalid. Line 1, position 1:
https://forum.aspose.com/t/the-data-at-the-root-level-is-invalid-line-1-position-1/116101

Here presentationDoc is Aspose.Slides.Presentation type.

Dear Ujju,

Thanks for considering Aspose.Slides.

Presentation.SaveToPdf does not generate XML, it generates pdf document that is the reason, you are getting exception.

Thanks for Reply, MSfiaz
Can you suggest a way in which .ppt file in sharepoint library can be converted to a pdf.