Dr Mugg
Dr Mugg

Reputation: 41

Print document and create PDF in C#

I've got some information I would like to output to a printer, but also as a PDF. I would be great if the PDF and the printing output would look the same. As what I understand, PDF reading and creating is not supported in C#.

I can create PDF's easily with external librarys like iTextSharp, but I don't know how to print them without using a different application, like Adobe Acrobat.

What are my options?

Upvotes: 4

Views: 3809

Answers (3)

David
David

Reputation: 51

You may consider using a 3rd party PDF printer driver; such as PDFCreator, or CutePDF.

CutePDF has a royalty-free developer version (for purchase) with programmatic access via the Registry.

The only other option that I've come across is using MigraDOC + PDFSharp, but you must author the document via MigraDOC / PDFSharp directly, it can't be a "pre-made" PrintDocument.

Upvotes: 2

Mark Redman
Mark Redman

Reputation: 24515

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

Upvotes: 0

Tony The Lion
Tony The Lion

Reputation: 63190

In WPF there's PDF viewer controls. I'm not sure if you're using WPF, but if you want to view PDF's inside your own app, this could be a solution. Have a look at this.

Upvotes: 0

Related Questions