Monday, 21 October 2019

Printing a pdf file on client side printer in asp.net C#?

Printing a pdf file on client side printer in asp.net C#?


using System.Diagnostics;


Process printjob = new Process();

    printjob.StartInfo.FileName = @"D:\R&D\Changes to be made.pdf" //path of your file;

    printjob.StartInfo.Verb = "Print";

    printjob.StartInfo.CreateNoWindow = true;

    printjob.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;

    PrinterSettings setting = new PrinterSettings();

    setting.DefaultPageSettings.Landscape = true;

    printjob.Start();

No comments:

Post a Comment