有没有人从 ABCpdf 得到这个例外?我们在 Server 2008 上运行,只有转换 Office 文件(Word 和 Excel)时出现问题。这在 Server 2003 上运行良好。因为我们只遇到 Office 文件问题,我想知道这是否与 Server 2008 上的 XPS 支持有关?调用此函数的代码作为 Windows 服务运行。
Private Overloads Function ConvertMicrosoftOfficeDocToPdf(ByVal inputFile As Byte(), ByVal fileExt As String) As Byte()
Dim abcDoc As WebSupergoo.ABCpdf7.Doc = Nothing
Try
abcDoc = New WebSupergoo.ABCpdf7.Doc()
Dim xro As New WebSupergoo.ABCpdf7.XReadOptions()
xro.FileExtension = fileExt
Try
abcDoc.Read(inputFile, xro)
Catch ex As Exception
System.Diagnostics.Trace.Write(ex.ToString())
Throw ex
End Try
Dim fileBytes As Byte() = abcDoc.GetData()
Return fileBytes
Finally
If Not abcDoc Is Nothing Then
abcDoc.Clear()
abcDoc.Dispose()
End If
End Try
End Function
WebSupergoo.ABCpdf7.Internal.PDFException:试图读取或写入受保护的内存。这通常表明其他内存已损坏。---> System.AccessViolationException: 试图读取或写入受保护的内存。这通常表明其他内存已损坏。在 WebSupergoo.ABCpdf7.Internal.NDoc._InvokeMethod(IntPtr inDoc, Int32 inMethod, Int32 inIndex, Int32 inFlags, String inParams, String& outErr) 在 WebSupergoo.ABCpdf7.Internal.NDoc.InvokeMethod(IntPtr inDoc, Int32 inMethod, Int32 inIndex, Int32 inFlags, String inParams, String& outErr) at WebSupergoo.ABCpdf7.Doc.PrintToXps(String inputFile, String outputFile, Int32 timeout, String printerName) at WebSupergoo.ABCpdf7.Operations.XpsImportOperation.ImportAny(Doc doc, String path,