Вопрос

I need to print documents to the printer such that the user is required to enter a PIN before the document is printed out.

In my research thus far the only method I have seen accomplish this is to print the document to a PRN file and then edit the file in binar looking for

byte[] searchfor = System.Text.Encoding.ASCII.GetBytes(@"@PJL SET HOLD=OFF" + "\n" + "@PJL SET USERNAME=\"SYSTEM\"");

and replace it with

byte[] new_lines = System.Text.Encoding.ASCII.GetBytes(@"@PJL SET HOLD=ON" + Environment.NewLine + @"@PJL SET HOLDTYPE=PRIVATE" + Environment.NewLine + "@PJL SET HOLDKEY=\"" + User_Pin + "\"" + Environment.NewLine + "@PJL SET USERNAME=\"" + User_Name + "\"");

This seems a little silly to me. I have not found anything within the PrintDocument or PrinterSettings that seems to help.

While this is a solution, we print out large image files and if we then send this directly to the printer via a copy command then the RAM on the printer isn't sufficient to hold the entire document. I would like to have a more elegant way to steam to the document through the print queue so that the queue spool it to the printer as it can handle it.

Any help would be greatly appreciated.

Thank you,

Richard

Это было полезно?

Решение

That's because it's a printer feature, optionally exposed via the driver, and not something Windows can do.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top