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?

CodePudding user response:

reference 4 floor cs516623814 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?


,,, print driver is installed on your system, you want to develop print saved as PNG, write drive, install to system calls,
But save images, you need to call to print? Direct menu click event - & gt; Bitmap. The Save process

CodePudding user response:

Ever done a printing component, menu to add some other way, it is ok to perform different operations, under reference

CodePudding user response:

reference 5 floor desperaso reply:
Quote: refer to 4th floor cs516623814 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?


,,, print driver is installed on your system, you want to develop print saved as PNG, write drive, install to system calls,
But save images, you need to call to print? Direct menu click event - & gt; Bitmap. Save over


Complicated, I just want to know, Microsoft print to PDF is the driver save type PDF, did this method is available?

CodePudding user response:

According to the drive name to match,

CodePudding user response:

no,


Think human is how to solve -- if there is no ready-made people give their answers, just for my own use to understand the brain, program also is such, if there is no data structure, to match their results,

CodePudding user response:

refer to 7th floor cs516623814 response:
complicated, I just want to know, Microsoft print to PDF is the driver save type PDF, this is there any method to get to the,


Well,

 
Public class Printer_List
{
Public string printerName;
Public Printer_List (string _printer)
{
PrinterName=_printer;
}
}
Public static List
Public void Initialize_Printer ()
{
Printers. The Clear ();
Foreach (string sprint in PrinterSettings. InstalledPrinters)
{
Printers. The Add (new Printer_List (sprint));
}

Var PDF=printers. Where (p=& gt; P.p rinterName. The Contains (" to PDF ")) FirstOrDefault ();

/////this is you want to
MessageBox. Show (PDF. PrinterName);
}

CodePudding user response:

references to the tenth floor desperaso response:
Quote: refer to 7th floor cs516623814 response:

Complicated, I just want to know, Microsoft print to PDF is the driver save type PDF, this is there any method to get to the,


Well,

 
Public class Printer_List
{
Public string printerName;
Public Printer_List (string _printer)
{
PrinterName=_printer;
}
}
Public static List
Public void Initialize_Printer ()
{
Printers. The Clear ();
Foreach (string sprint in PrinterSettings. InstalledPrinters)
{
Printers. The Add (new Printer_List (sprint));
}

Var PDF=printers. Where (p=& gt; P.p rinterName. The Contains (" to PDF ")) FirstOrDefault ();

/////this is you want to
MessageBox. Show (PDF. PrinterName);
}


Brother, you this is to pass judgment in the name of judging whether there is the word to PDF, this is not common, is only by the name of the printer to do mapping relation,

CodePudding user response:

11 references cs516623814 response:
yes, this is by whether the name you have the word to PDF to judge ah, this is not common, is only by the name of the printer to do mapping,


So is Microsoft Windows inside what else Print driver name Print to PDF, function is so-and-so brand of printer or scanner driver?
If the analysis driver types, this can't help you,nullnull
  •  Tags:  
  • C#
  • Related