How to Print PDFs programmatically without Adobe in .Net

How to Print PDFs programmatically without Adobe in .Net

Posted:
How to Print PDFs programmatically without Adobe in .NetPhoto by Christin Hume

Originally Posted On: https://ironpdf.com/docs/questions/csharp-print-pdf/

 

We can use C# / Visual Basic code to easily print a PDF in .net applications using IronPDF.

WE can send a PDF directly to a printer silently (programatic printing), or create a System.Drawing.Printing.PrintDocument object which can be worked with and sent to GUI print dialogs.

  1. using IronPdf;
  2. // Create a new PDF and print it
  3. IronPdf.HtmlToPdf Renderer = new IronPdf.HtmlToPdf();
  4. PdfDocument Pdf = Renderer.RenderUrlAsPdf(“https://www.nuget.org/packages/IronPdf”);
  5. // Send the PDF to the default printer to print
  6. Pdf.Print();
  7. //For advanced silent real-world printing options, use PdfDocument.GetPrintDocument
  8. //Remember to addan assembly reference to System.Drawing.dll
  9. System.Drawing.Printing.PrintDocument PrintDocYouCanWorkWith = Pdf.GetPrintDocument();

Copy code to clipboardVB C#

Adobe Acrobat Reader not Required

There is no stable way to achieve PDF printing without having a PDF library such as IronPDF installed. Attempts to do this without a C# PDF library rely on hacks involving Adobe Acrobat reader being installed on the client, which is nether reliable nor best paractice.

Information contained on this page is provided by an independent third-party content provider. Frankly and this Site make no warranties or representations in connection therewith. If you are affiliated with this page and would like it removed please contact pressreleases@franklymedia.com

Powered by Frankly
All content © Copyright 2000 - 2020 WNCONTENT. All Rights Reserved.
For more information on this site, please read our Privacy Policy, and Terms of Service, and Ad Choices.