Free Support Forum - aspose.com

AccessViolationException with Aspose.Pdf on Windows Server 2008 R2 x64

Hi,


I’m using Aspose.Pdf to convert Word documents to PDF, which has been working fine on Windows Server 2003 x86. However, on Windows Server 2008 R2 x64, I’m getting the following error:

System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at x3f91538e8c0de749.x7576dadd7c449efa.xeb1273bf491e08c1(Pdf x5510939d5b9dcd91, XmlTextReader xe134235b3526fa75)
at x3f91538e8c0de749.x4c849e0e778e539e.xff87749e7f0b2b9f(xaa36f84dba9d652f xaa03fa4cc68dfe5a, XmlTextReader xe134235b3526fa75)
at x3f91538e8c0de749.xaa36f84dba9d652f.x2681d93a2b0484a6(XmlTextReader x97bf2eeabd4abc7b)
at x3f91538e8c0de749.xaa36f84dba9d652f.xf5c83e8e96d416b7(XmlDocument x5510939d5b9dcd91, XslTransform x3cf26ef95f0d3133)
at Aspose.Pdf.Pdf.BindXML(String xmlFile, String xslFile)
at MyComponent.ConvertWordToPdfDocument()
at MyComponent.GeneratePreview()
at MyApplication.DoProcessing()

This is the code:

private string ConvertWordToPdfDocument()
{
string guid = GetGuid();
Document document = new Document(InputPath);
string tempXmlFile = Path.Combine(Path.GetTempPath(), guid + “.xml”);
document.Save(tempXmlFile, SaveFormat.AsposePdf);
Pdf pdf = new Pdf();
pdf.BindXML(tempXmlFile, null);
string tempPdfFile = Path.Combine(Path.GetTempPath(), guid + “.pdf”);
pdf.Save(tempPdfFile);
File.Delete(tempXmlFile);
return tempPdfFile;
}

It seems like the BindXml is failing for some reason.

The version of Aspose.Pdf being used is 4.3.0.0. The file I’m testing with is a basic document created in Word 2007 with just some text and a few tables.

Is this a known problem, and is there a workaround available?

Thanks.

Mun

Hi Munsifali,

Thanks for your inquiry.

Which version of Aspose.Words are you currently using? The latest verisons of Aspose.Words only alllow the use of direct conversion to PDF. This technique produces the best fidelity. Please see the article here for details.

Thanks,

Hi Adam,


I’m currently using Aspose.Words 9.0.0.0. I’ll download the latest version and try using direct conversion to PDF feature as you recommended to see if that resolves the problem.

Thanks.

Mun

Hi Adam,


Upgrading to the latest Aspose Total suite seems to have resolved this problem with converting Word documents to PDF, though I’m getting another error when trying to set the license for Aspose.Slides, but I’ll post about that separately in the relevant forum.

Thanks for your help.

Mun

Hi Mun,

It's great that you were able to resolve the issue. Please feel to come back and ask anytime if you have any queries.

Thanks,