Issues with print in PDF Viewer. Print is not working when we send the document to the available printer.

0
When we are using PDFViewer.Print(true) method, we are able to see the print dialog with options and print works fine when we select “Microsoft Print to PDF” option as it saves the document as a PDF. But we are receiving an exception when we select the available printer for a hard copy. The exception we are receiving is: “The data area passed to a system call is too small”. We added the document by checking if the document is null and even then we are receiving the same exception. Can you please help us in fixing this issue or let us know if we are missing anything. If any sample is available where the print is working fine when we select the available printer. The following is the code snippet that we have written, var pdfViewer = new ComponentPro.Windows.UI.PdfViewer(); if (pdfViewer.Document == null) { pdfViewer.LoadDocument(path); } pdfViewer.Print(true);
 
asked 3/11/2020 5:45:27 AM
add a comment

1 Answers

0
We send the job info to .NET printer class. We have added this issue to our back log for testing.
 
answered 3/16/2020 5:03:01 PM
  Any update on the issue? The following is the stack trace for the exception we are receiving, System.ComponentModel.Win32Exception: The data area passed to a system call is too small Stack Trace: at System.Drawing.Printing.StandardPrintController.OnStartPrint(PrintDocument document, PrintEventArgs e) at System.Windows.Forms.PrintControllerWithStatusDialog.OnStartPrint(PrintDocument document, PrintEventArgs e) at System.Drawing.Printing.PrintController.Print(PrintDocument document) at System.Drawing.Printing.PrintDocument.Print() at ComponentPro.Windows.UI.PdfViewerElement.Print(Boolean showPrinterSettings, ProPrintDocument document) at ComponentPro.Windows.UI.PdfViewerNavigator.c_FPJA(Object c_J, MouseEventArgs c_K) at ComponentPro.Windows.ProElement.OnMouseUp(MouseEventArgs e) at ComponentPro.Windows.ProItem.OnMouseUp(MouseEventArgs e) at ComponentPro.Windows.ProElement.OnCLREventsRise(RoutedEventArgs args) at ComponentPro.Windows.ProElement.OnBubbleEvent(ProElement sender, RoutedEventArgs args) at ComponentPro.Windows.ProItem.OnBubbleEvent(ProElement sender, RoutedEventArgs args) at ComponentPro.Windows.ProElement.RaiseBubbleEvent(ProElement sender, RoutedEventArgs args) at ComponentPro.Windows.ProItem.RaiseBubbleEvent(ProElement sender, RoutedEventArgs args) at ComponentPro.Windows.ProElement.RaiseRoutedEvent(ProElement sender, RoutedEventArgs args) at ComponentPro.Windows.ProElement.DoMouseUp(MouseEventArgs e) at ComponentPro.Windows.ComponentInputBehavior.OnMouseUp(MouseEventArgs e) at ComponentPro.Windows.ProControl.OnMouseUp(MouseEventArgs e) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ScrollableControl.WndProc(Message& m) at ComponentPro.Windows.ProControl.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) ERIC MEHN 3/24/2020 5:53:17 AM
add a comment

Your Answer

Not the answer you're looking for? Browse other questions tagged pdf-viewer or ask your own question.