ArgumentException thrown converting PDF to PPTX

Hello.


I’m using Aspose.PDF .NET 17.2.0.0.
When converting a particular PDF to pptx I receive and exception.

I have attached the PDF document for your reference. (User Manual Page 01.pdf)

Our code is as follows:-

using (var document = new Document(pptSourcePath)
{
document.Save(exportOutputPath, SaveFormat.pptx);
}

It exceptions on the Save call as follows:-

Exception thrown: ‘System.ArgumentException’ in System.Xml.dll
System.ArgumentException: ‘.’, hexadecimal value 0x00, is an invalid character.
at System.Xml.XmlUtf8RawTextWriter.InvalidXmlChar(Int32 ch, Byte* pDst, Boolean entitize)
at System.Xml.XmlUtf8RawTextWriter.WriteElementTextBlock(Char* pSrc, Char* pSrcEnd)
at System.Xml.XmlUtf8RawTextWriter.WriteString(String text)
at System.Xml.QueryOutputWriter.WriteString(String text)
at System.Xml.Xsl.Runtime.XmlQueryOutput.WriteStringUnchecked(String text)
at System.Xml.Xsl.CompiledQuery.Query.<xsl:template match=“r”>(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator {urn:schemas-microsoft-com:xslt-debug}current, Double {urn:schemas-microsoft-com:xslt-debug}position, Double {urn:schemas-microsoft-com:xslt-debug}last, IList1 {urn:schemas-microsoft-com:xslt-debug}namespaces) in :line 193</font></div><div><font size="2"> at System.Xml.Xsl.CompiledQuery.Query.<xsl:apply-templates>(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator , Double , Double )</font></div><div><font size="2"> at System.Xml.Xsl.CompiledQuery.Query.<xsl:template match="pr">(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator {urn:schemas-microsoft-com:xslt-debug}current, Double {urn:schemas-microsoft-com:xslt-debug}position, Double {urn:schemas-microsoft-com:xslt-debug}last, IList1 {urn:schemas-microsoft-com:xslt-debug}namespaces) in :line 137
at System.Xml.Xsl.CompiledQuery.Query.xsl:apply-templates(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator , Double , Double )
at System.Xml.Xsl.CompiledQuery.Query.<xsl:template match=“tb”>(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator {urn:schemas-microsoft-com:xslt-debug}current, Double {urn:schemas-microsoft-com:xslt-debug}position, Double {urn:schemas-microsoft-com:xslt-debug}last, IList1 {urn:schemas-microsoft-com:xslt-debug}namespaces) in :line 78</font></div><div><font size="2"> at System.Xml.Xsl.CompiledQuery.Query.<xsl:apply-templates>(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator , Double , Double )</font></div><div><font size="2"> at System.Xml.Xsl.CompiledQuery.Query.<xsl:template match="section">(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator {urn:schemas-microsoft-com:xslt-debug}current, Double {urn:schemas-microsoft-com:xslt-debug}position, Double {urn:schemas-microsoft-com:xslt-debug}last, IList1 {urn:schemas-microsoft-com:xslt-debug}namespaces) in :line 26
at System.Xml.Xsl.CompiledQuery.Query.xsl:apply-templates(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator , Double , Double )
at System.Xml.Xsl.CompiledQuery.Query.xsl:apply-templates(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator , Double , Double )
at System.Xml.Xsl.CompiledQuery.Query.Root(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
at System.Xml.Xsl.CompiledQuery.Query.Execute(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlSequenceWriter results)
at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter writer)
at System.Xml.Xsl.XslCompiledTransform.Transform(XmlReader input, XmlWriter results)
at Aspose.Pptx.SlideWriter.Save(XslCompiledTransform xslt, OpcPackagePart slidePart)
at Aspose.Pptx.PptxDocumentVisitor.Visit(Document document)
at .(List`1 , Stream )
at .(Document , Stream , PptxSaveOptions )
at Aspose.Pdf.Document.Save(Stream outputStream, SaveOptions options)
at Aspose.Pdf.Document.Save(Stream outputStream, SaveFormat format)
at Aspose.Pdf.Document.Save(String outputFileName, SaveFormat format)

Hi Neil,


Thanks for contacting support.

p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Arial; -webkit-text-stroke: #000000} span.s1 {font-kerning: none}

I have tested the scenario and have managed to reproduce the problem that ArgumentException is thrown while converting your provided PDF file to PPTX. For the sake of correction, I have logged it as PDFNET-42416 in our issue tracking system. We will further look into the details of this problem and will keep you posted on the status of correction. Please be patient and spare us little time.


We are sorry for this inconvenience.


Best Regards,

I am also having this exact issue using Aspose 18.9. Was this ever resolved?

@amani7

Thanks for contacting support.

We regret to share that earlier logged issue is not yet resolved due to other high priority issues in the queue. However, we have recorded your concerns and will definitely let you know as soon as some significant progress is made towards its resolution. Please be patient and spare us little time.

We are sorry for the inconvenience.