有沒有人可以從ABCpdf中刪除這個異常?我們在Server 2008上運行,只有轉換Office文件(Word和Excel)的問題。這一切都在Server 2003上運行良好。因爲我們只有Office文件的問題,我想知道它是否與Server 2008上的XPS支持有關?調用此函數的代碼作爲Windows服務運行。使用Windows Server 2008上的ABCpdf.NET將Office文件轉換爲PDF的異常
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,字符串inParams, 字符串& outErr) 在WebSupergoo.ABCpdf7.Internal.NDoc.InvokeMethod(IntPtr的 inDoc, INT32 inMethod,INT32 inIndex, INT32 inFlags,字符串inParams, 字符串& outErr) 在WebSupergoo.ABCpdf7.Doc.PrintToXps(字符串 INPUTFILE,字符串OUTPUTFILE,INT32 超時,字符串PRINTERNAME) 在WebSupergoo.ABCpdf7.Operations。 XpsImportOperation.ImportAny(Doc doc,字符串路徑,Int32超時) 在WebSupergoo.ABCpdf7.XReadOptions.ImportXpsAny(文件 DOC,字符串路徑,布爾清除) 在WebSupergoo.ABCpdf7.XReadOptions.Read(文件 DOC,字節[]數據,ReadModuleType 模塊) 在WebSupergoo.ABCpdf7.XReadOptions .Read(文件 DOC,字節[]數據)
沒有爲我工作。此外,該鏈接被破壞,所以不可能說明爲什麼要添加該文件夾。 – dave 2018-02-01 15:55:49