4

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?

3 Answers 3

2

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.

Sign up to request clarification or add additional context in comments.

Comments

0

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.

2 Comments

This app seems to use Acrobat dll, though I get an error when I try to use it: Retrieving the COM class factory for component with CLSID failed due to the following error: 80040154. Tried with some solution changing platform to X86, but without success.
seems some COM class hasn't been registered with the system it seems. Not sure how to resolve :(
0

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.

1 Comment

I don't want to be forced to install other applications. External dll-files is ok though.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.