1

I have a PDF file I want to print through my program by bringing up the print dialog. Is there a way to do this without using external programs such as Adobe Reader?

Thanks, Richard

EDIT: For the time being I'm using Adobe as the most common place 3rd party program available that is also free. I'd still like to find other solutions though.

EDIT: Anyone down voting could you please explain why - it helps learning.

probably at the beach
  • 14,489
  • 16
  • 75
  • 116
  • There are dozens of questions on Stack Overflow about PDF libraries for .NET applications. Did you try any of those? Do they not provide printing functionality? – Cody Gray - on strike Jan 13 '12 at 12:22
  • @Cody not yet, I only wanted to provide similar functionality to the 'print' command which is built into windows command prompt so didn't think a 3rd party library would be needed. – probably at the beach Jan 13 '12 at 12:24
  • 1
    Hmm, well you can show the Print dialog easily if that's all you want. But that dialog doesn't do anything by itself, it just provides a common way of obtaining printing preferences from the user. Once they "OK" the dialog, you'll have to actually do the printing yourself from your application (using a PDF reader library), or call the user's installed PDF reader (like Adobe Acrobat) to do the printing. – Cody Gray - on strike Jan 13 '12 at 12:25
  • 1
    see this http://stackoverflow.com/a/273729/138071 – andres descalzo Jan 13 '12 at 13:17
  • 1
    http://www.codeproject.com/KB/showcase/pdfrasterizer.aspx I found this link that also can help you. Also your can search for a library to convert pdf to html and then print it – andres descalzo Jan 13 '12 at 13:22
  • 1
    Have you tried Aspose.Pdf for .NET? Please see the [PDF printing related topics](http://www.aspose.com/documentation/.net-components/aspose.pdf-for-.net/working-with-printing.html) in the documentation. Disclosure: I work as a developer evangelist at Aspose. – Shahzad Latif Jan 16 '12 at 13:57

1 Answers1

2

Your best bet would be to use a 3rd party library like the PDF Component from Aspose. There isn't anything natively in .NET that could do this.

Adrian Thompson Phillips
  • 6,893
  • 6
  • 38
  • 69