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

标签 windows-server-2008 office-2007 xps abcpdf

有没有人对 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/

相关文章:

sql-server-2008 - 如何确定通信链路故障 TCP 提供程序 : The specified network name is no longer available? 的根本原因

asp.net - 如何跟踪生产环境中偶发的 ASP.NET 性能问题?

visual-studio - 我可以使用VS 2012创建Office 2007加载项吗?

printing - 从 Windows 服务进行 XPS 打印

windows - Server 2008 VPS 供应商

c# - .Net 应用程序根据传递的时区语言读取时区注册表

.net - 你可以在没有办公室的情况下安装 Office 2007 PIA

c# - 获取表格上方的文本 MS Word

c# - GetPrintJobInfoCollection() 有时会出现异常

pdf - 如何使用Ghostscript将XPS转换为PDF或XPS转换为DOC?