Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# PDF Control & Library

Tags:

c#

pdf

I'm looking for a way to display a PDF (similar to a picture box), in a Windows Form. After that I need to be able to create a PDF. What's the best library for the job for creating the PDF (from simple text)? I've taken a look at several and I'm not sure which one is the best. Preferably open source. As for the control, I tried the COM object Adobe provides... I can't seem to get it working. At all. I've tried loading several files, there are no errors. It simply fails to load.

like image 987
cam Avatar asked Mar 25 '10 14:03

cam


2 Answers

PDF Sharp, Sharp PDF and iTextSharp are excellent. They are all OpenSource.

like image 129
Will Marcouiller Avatar answered Sep 27 '22 18:09

Will Marcouiller


To answer your question about getting the PDF to render, you could use a WebBrowser Control on your form as long as the client workstation has Adobe Reader installed. The browser will automatically pick up the MIME type and load the in-browser Adobe Reader.

For rendering, I echo Will Marcouiller and SLaks. We have had good success with PDFSharp.

like image 27
AJ. Avatar answered Sep 27 '22 18:09

AJ.