System.Xml.XmlException exception

I get System.Xml.XmlException exception during loading word file using Aspose.Words.dll .
My code snippet below
try
{
Document doc = new Document(srcfilepath);/*A first chance exception of type 'System.Xml.XmlException' occurred in Aspose.Words.dll
Additional information: There unblocked constant string. Line 2, position 125 252 097
*/
int docpagecount = doc.PageCount - 1;
if (curpageindex > docpagecount)
{
message = "page are out of range";
return false;
}
PdfSaveOptions pdfOptions = new PdfSaveOptions();
pdfOptions.PageIndex = curpageindex;
pdfOptions.PageCount = 1;
doc.Save(pdfpath, pdfOptions);
return true;
}
catch (Exception ex)
{
message = "error:" + ex.Message;
return false;
}

anyone help?

This is my problem,thanks everyone :slight_smile:

Hi Rico,


Thanks for your inquiry. Could you please attach your input Word document here for testing? We will investigate the issue on our side and provide you more information.

2 posts were split to a new topic: System.Xml.XmlException exception is thrown when document is saved to PDF