Search code examples
c#pdfprintinggembox-documentgembox-pdf

When printing a pdf with Gembox.Pdf in C# the documentName in the print queue is always 'XPS Document'


I am trying to print a pdf document using Gembox.Pdf in C# (.NET Framework 4.8). This is the code I use:

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
        });
      }
    }

It doesn't matter what I pass as jobName, when I look at the print queue I always see Xps Document. I am using the free version of Gembox.Pdf for now.

print queue

I already reached out to the Gembox.Pdf team and posted on the forum of Gembox but I have received no response so far.


Solution

  • This issue was resolved with this latest bugfix version:
    https://www.gemboxsoftware.com/pdf/nightlybuilds/GBA15v1156.zip

    Or this latest pre-released NuGet package:
    Install-Package GemBox.Pdf -Version 15.0.1156-hotfix