首页 > 解决方案 > 在 C# 中使用 Gembox.Pdf 打印 pdf 时,打印队列中的 documentName 始终为“XPS Document”

问题描述

我正在尝试在 C#(.NET Framework 4.8)中使用 Gembox.Pdf 打印 pdf 文档。这是我使用的代码:

public void PrintPdf(string fileToPrint, string printerName, string jobName)
    {
      ComponentInfo.SetLicense("FREE-LIMITED-KEY");
      using (var document = PdfDocument.Load(fileToPrint))
      {
        document.Print(printerName, new PrintOptions
        {
          DocumentName = jobName
        });
      }
    }

我作为 jobName 传递的内容并不重要,当我查看打印队列时,我总是会看到 Xps 文档。我现在正在使用 Gembox.Pdf 的免费版本。

打印队列

我已经联系了 Gembox.Pdf 团队并在 Gembox 论坛上发帖,但到目前为止我没有收到任何回复。

标签: c#pdfprintinggembox-documentgembox-pdf

解决方案


使用此最新的错误修复版本解决了此问题:
https ://www.gemboxsoftware.com/pdf/nightlybuilds/GBA15v1156.zip

或者这个最新的预发布 NuGet 包:
Install-Package GemBox.Pdf -Version 15.0.1156-hotfix


推荐阅读