Home > Net > How to get a Windows printer driver save the type?
How to get a Windows printer driver save the type?
Time:11-12
As shown in figure of the driver is converted to PDF, it save the type is PDF I use the PrintDocument prtdoc=new PrintDocument (); Looking for a long time still didn't find how to get the save type,
CodePudding user response:
Access to? For the purpose of this do, access to all printers, and to set the printer is done, you get others selected printer didn't try
CodePudding user response:
Equivalent to do a batch printing tools, users can choose a print driver, Windows on the print driver has a lot of, some into PNG, some converted to PDF, some directly sent to the printer to print, what I want is, to a certain format of the file, I get suffix, the preservation of the path can be set up files, without having to manually in each file name,
CodePudding user response:
Obtain all printers, Set to use inside the PDF printing, SetDefaultPrinter (PDF printer name what);
Public class Printer_List { Public string printerName; Public Printer_List (string _printer) { PrinterName=_printer; } }
//get the printer Public void Initialize_Printer () { Printers. The Clear (); Foreach (string sprint in PrinterSettings. InstalledPrinters) { Printers. The Add (new Printer_List (sprint)); } }
//the current printer String p=printDocument. PrinterSettings. PrinterName;
//set the current printer [DllImport (" winspool. DRV ")] Public static extern bool SetDefaultPrinter (string Name);
SetDefaultPrinter (printer name);
CodePudding user response:
I read your code, or no access to save the type related operations oh, Your code to get all the print driver name a list, but they save the type (such as PDF PNG) this can you get?