gpt4 book ai didi

windows-server-2008 - 在 Windows Server 2008 上使用 ABCpdf.NET 将 Office 文件转换为 PDF 的异常

转载 作者:行者123 更新时间:2023-12-04 08:07:32 24 4
gpt4 key购买 nike

有没有人对 ABCpdf 的这个异常(exception)感到不满?我们在 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: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. ---> System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. at WebSupergoo.ABCpdf7.Internal.NDoc._InvokeMethod(IntPtr inDoc, Int32 inMethod, Int32 inIndex, Int32 inFlags, String inParams, String& outErr) at 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, Int32 timeout) at WebSupergoo.ABCpdf7.XReadOptions.ImportXpsAny(Doc doc, String path, Boolean clear) at WebSupergoo.ABCpdf7.XReadOptions.Read(Doc doc, Byte[] data, ReadModuleType module) at WebSupergoo.ABCpdf7.XReadOptions.Read(Doc doc, Byte[] data)

最佳答案

在此处添加了一个名为“Desktop”的文件夹:

C:\Windows\SysWOW64\config\系统配置文件\

http://social.msdn.microsoft.com/Forums/en/innovateonoffice/thread/b81a3c4e-62db-488b-af06-44421818ef91

关于windows-server-2008 - 在 Windows Server 2008 上使用 ABCpdf.NET 将 Office 文件转换为 PDF 的异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1521486/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com