Printing WPF Document

Total Post:29

Points:203
WPF 
WPF
 1196  View(s)
Ratings:
Rate this:
Hi Developer!

How to specify the number of copies to be printed before you open the print dialog?

I need to print shipping labels and need to print copies equal to number of boxes.

Currently this is being achieved using the print dialog box but would be nice to achieve this in the code itself.

Any help would be appreciated.

Thanks!

  1. Post:105

    Points:735
    Re: Printing WPF Document

    Hi!

    It is very important that you read the FAQ and post your question.You need to write the code and then ask for any assistance.

    The code here is in C# (Have not been tested)

      PrinterSettings
    settings = new PrinterSettings();//System.Drawing.Printing.PrinterSettings
      PrintDocument printDoc = new PrintDocument();
      settings.Copies =Copiesnumber; //put your number of copies
      printDoc.PrinterSettings = settings;
      PageSettings MyPage = new PageSettings(settings);
      printDoc.DefaultPageSettings = MyPage;


    thanks 

      Modified On Mar-30-2018 11:23:01 PM

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!