3
I am working on a solution where I need to change the default printer for a label printer to print and return to the previous standard printer.
Would anyone have any solution to this?
3
I am working on a solution where I need to change the default printer for a label printer to print and return to the previous standard printer.
Would anyone have any solution to this?
6
It worked that way, follow the code, thank you!
using System.Drawing.Printing;
using System.Runtime.InteropServices;
private void trocarImpressora()
{
ArrayList impressoras = new ArrayList();
int i = 0;
PrintDocument pd = new PrintDocument();
string impressoraPadraoOriginal = pd.PrinterSettings.PrinterName;
myPrinters.SetDefaultPrinter("ZDesigner GC420t (EPL)");
imprimir();
myPrinters.SetDefaultPrinter(impressoraPadraoOriginal);
}
public static class myPrinters
{
[DllImport("winspool.drv", CharSet = CharSet.Auto, SetLastError = true)]
public static extern bool SetDefaultPrinter(string Name);
}
Browser other questions tagged c# impression crystal-reports printer
You are not signed in. Login or sign up in order to post.
Have you tried using the
SetDefaultPrinter
?– Felipe Avelar
I’ll try now, thank you Felipe
– Antonio Gomes