aspose.pdf для состояния сетевого принтера всегда null - PullRequest
0 голосов
/ 03 сентября 2018

Вот мой код:

   public string PrintPdfAspose(string printerName)
        {
            // For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-.NET
            // The path to the documents directory.
            string dataDir = filePath;

            // Create PdfViewer object
            PdfViewer viewer = new PdfViewer();

            // Open input PDF file
            viewer.BindPdf(dataDir);


            viewer.PrintDocumentWithSettings(pgs, ps);
            // Check the print status
            if (viewer.PrintStatus != null)
            {
                // An exception was thrown
                Exception ex = viewer.PrintStatus as Exception;
                if (ex != null)
                {
                    return ex.ToString();
                }
            }
            else
            {
                // No errors were found. Printing job has completed successfully
                viewer.Close();
                return "printing completed without any issue..";

            }

        }

Я всегда получаю для PrintStatus значение NULL, я должен получить какую-то ошибку, когда принтер по какой-то причине не печатает. Любая помощь?

...