You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 2, 2019. It is now read-only.
I have an application that is building a PDF and attempting to send it to a network printer. I am at a point now where some PDFs print and some do not. The PDFs that don't are not corrupt and can be printed manually, so the file is fine. And when they do not print, an exception is being thrown, but the Message is not fulpful at all; "The operation completed successfully." This is happening when the .Print() method is being called below.
// Set printer objects
var printerSettings = new PrinterSettings
{
PrinterName = printerName,
Copies = 1
};
// Create page settings
var pageSettings = new PageSettings(printerSettings)
{
Margins = new Margins(0, 0, 0, 0)
};
// Now print the PDF document
using (var document = PdfiumViewer.PdfDocument.Load(combinedFilePath))
{
using (var printDocument = document.CreatePrintDocument())
{
printDocument.PrinterSettings = printerSettings;
printDocument.DefaultPageSettings = pageSettings;
printDocument.PrintController = new StandardPrintController();
printDocument.Print();
}
}
Also here is most of the stack of where the error is happening. Error: System.ComponentModel.Win32Exception (0x80004005): The operation completed successfully at System.Drawing.Printing.PrinterSettings.GetHdevmodeInternal(String printer) at System.Drawing.Printing.PrinterSettings.GetHdevmodeInternal() at System.Drawing.Printing.PrinterSettings.GetHdevmode(PageSettings pageSettings) at System.Drawing.Printing.PrintController.OnStartPrint(PrintDocument document, PrintEventArgs e) at System.Drawing.Printing.StandardPrintController.OnStartPrint(PrintDocument document, PrintEventArgs e) at System.Drawing.Printing.PrintController.Print(PrintDocument document) at System.Drawing.Printing.PrintDocument.Print()
Has anyone encountered this before and know how to fix it?
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I have an application that is building a PDF and attempting to send it to a network printer. I am at a point now where some PDFs print and some do not. The PDFs that don't are not corrupt and can be printed manually, so the file is fine. And when they do not print, an exception is being thrown, but the Message is not fulpful at all; "The operation completed successfully." This is happening when the .Print() method is being called below.
Also here is most of the stack of where the error is happening.
Error: System.ComponentModel.Win32Exception (0x80004005): The operation completed successfully at System.Drawing.Printing.PrinterSettings.GetHdevmodeInternal(String printer) at System.Drawing.Printing.PrinterSettings.GetHdevmodeInternal() at System.Drawing.Printing.PrinterSettings.GetHdevmode(PageSettings pageSettings) at System.Drawing.Printing.PrintController.OnStartPrint(PrintDocument document, PrintEventArgs e) at System.Drawing.Printing.StandardPrintController.OnStartPrint(PrintDocument document, PrintEventArgs e) at System.Drawing.Printing.PrintController.Print(PrintDocument document) at System.Drawing.Printing.PrintDocument.Print()
Has anyone encountered this before and know how to fix it?
The text was updated successfully, but these errors were encountered: