-2

I use this code to print pdf to default printer.

 public static void PrintPDFByProcess()
    {
        try
        {
            using (Process p = new Process())
            {
                p.StartInfo = new ProcessStartInfo()
                {
                    CreateNoWindow = true,
                    Verb = "print",
                    FileName = fileName
                };

                p.Start();

                p.Dispose();
            }
        }
        catch (Exception ex)
        {
            MessageBox.Show(ex.Message);
        }


    }

Now i want to print by showing Print Dialog Control Like This :

enter image description here

bigtheo
  • 624
  • 9
  • 16

1 Answers1

1

There is an existing C# DLL Library called iTextsharp that you can use to create a custom PDF docs and can easily print to printer or save to file.

Here is the URL to check out.

https://forums.asp.net/t/1954208.aspx?PRINT+WITH+PDF+USING+iTextsharp https://www.codeproject.com/Articles/686994/Create-Read-Advance-PDF-Report-using-iTextSharp-in

Good luck.

Thomson Mixab
  • 657
  • 4
  • 8
  • thank you for trying to help me. i use itext 7 and not itextcharp 5, itextcharp has a PdfAction class wich can be used to print a document. – bigtheo Jun 13 '21 at 19:39