06-27-2022 04:06 PM
Mainly curious if anyone has encountered a similar issue.
I have a panel in my uir file with objects that I populate with data, then set print attributes, then call "PrintPanel". My application sends the panel to the printer, but I get an error in the print spooler that it can't be printed. The printer is indicating that it is receiving and processing data, but hangs there. If I turn the printer off and back on, the page will print. Sometimes my printout will come out as expected, most of the time not. No other issues printing with other applications, machines with different OS, latest driver by Canon.
I'm using CVI version 2020, building a 32-bit application, running in a Windows 10 64-bit machine. My printer is a Canon imageCLASS MF212w, connected to my network via Ethernet cable.
Here are the attributes I'm setting, and calling the Print function.
I initially didn't have the ATTR_EJECT_AFTER there and it would sometimes work, so put it in to try, but it didn't make any difference.
SetPrintAttribute (ATTR_ORIENTATION, VAL_PORTRAIT);
SetPrintAttribute (ATTR_PRINT_AREA_HEIGHT, VAL_USE_ENTIRE_PAPER);
SetPrintAttribute (ATTR_PRINT_AREA_WIDTH, VAL_USE_ENTIRE_PAPER);
SetPrintAttribute (ATTR_XOFFSET, 0);
SetPrintAttribute (ATTR_YOFFSET, 0);
SetPrintAttribute (ATTR_XRESOLUTION, VAL_USE_PRINTER_SETTING);
SetPrintAttribute (ATTR_YRESOLUTION, VAL_USE_PRINTER_SETTING);
SetPrintAttribute (ATTR_SYSTEM_PRINT_DIALOG_ONLY, 0);
SetPrintAttribute (ATTR_EJECT_AFTER, 1);
//
//
PrintPanel (ScreenPrint, "", 1, VAL_FULL_PANEL, 1);