Print a document and create PDF in C #

I have information that I would like to print to a printer, but also like a PDF. It would be great if the PDF and print would look the same. As I understand it, reading and creating PDFs is not supported in C #.

I can easily create PDF files using external libraries such as iTextSharp, but I don’t know how to print them without using another application such as Adobe Acrobat.

What are my options?

+4
source share
3 answers

You can use a third-party PDF printer driver; such as PDFCreator or CutePDF.

CutePDF has a free developer version (for purchase) with programmatic access through the registry.

The only other option I came across is to use MigraDOC + PDFSharp, but you must authorize the document through MigraDOC / PDFSharp directly, it cannot be "pre-made" PrintDocument.

+2
source

WPF has tools for viewing PDF files. I'm not sure if you are using WPF, but if you want to view PDF inside your application, this might be the solution. Check it out .

0
source

Sending PDF directly to the printer requires a library to interpret the PDF file. You can probably use Acrobat directly, but something like GhostScript will be more efficient.

0
source

Source: https://habr.com/ru/post/1301267/


All Articles