Home > Net > Printersettings gives some printer setup options, for some advanced printers, print the properties d
Printersettings gives some printer setup options, for some advanced printers, print the properties d
Time:09-27
Printersettings gives some printer setup options, for some advanced printers, print the properties dialog box there are many types of the printer to print configuration, the configuration can be print properties dialog box is configured,
Question: how to use c # program to configure these attributes? Such as: (1) a piece of paper to print more pages, a page or two, a three page, a four pages, a six pages, a piece of eight pages, a nine pages; (2) brochure; (3) cross border lines; (4) the staplers,
CodePudding user response:
[System. The Runtime. InteropServices. DllImport (" winspool. DRV SetLastError=true)] Public extern static int OpenPrinter (string pPrinterName, ref IntPtr hPrinter, ref IntPtr pDefault);
[System. The Runtime. InteropServices. DllImport (" winspool. DRV SetLastError=true)] Public extern static int DocumentProperties (IntPtr hWnd, IntPtr hPrinter, string pDeviceName, ref IntPtr pDevModeOutput, ref IntPtr pDevModeInput, int fMode);
[System. The Runtime. InteropServices. DllImport (" winspool. DRV SetLastError=true)] Public static extern int ClosePrinter (IntPtr phPrinter);