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