Introduction
Sometimes when you work on developing a huge application, you may need a PDFViewer control to display an ebook or simply to extract the content of a PDF file.
The first choice that comes to mind as a .NET developer is to use the famous Adobe Reader Active X control. This solution is good and works well but requires Adobe Reader, which is installed on a target PC in order to work. This may be a problem especially when you don‘t want your app users to install a 3rd party application so that your app can work.
There are so many other solutions, where you can search the internet for PDF viewers and you‘ll find plenty, but most of them are hard to use (with coding of course), as it requires so many changes on the end-user's machine.
Background
What we need is an easy-to-use PDFViewer, which gives us full options, as shown below.
- Able to load PDF files easily, like calling a method with file path as parameter, or by using Streams.
- Supports all PDF formats, or at least, supports the most commonly-used ones.
- Able to open encrypted PDF files.
- Able to load all the content of the PDF file (read all texts, images ..etc without glitches).
I searched the internet and found a simple library that can do all the magic and it is called Free Spire.PDFViewer for .NET. You can get it from here. This library is free to download and use, the free version is limited to 10 pages of PDF, when viewing. To exceed the limitation, you‘ll need to purchase the Commercial Edition of Spire.PDFViewer for .NET.
All the stuff,which we need are listed as features of this library-- it supports most PDF formats, it's easy to use, and can open encrypted files. Read more about the features here.
To download, you need to register at e-iceclup. After registering (so easy), a link will be sent to your email, once the account is confirmed you can download the library. The library comes in .msi file format, installation is very easy and it will ask you to install additional things for VS, which is optional and cool.
After installation completes, you can use the library directly and of course, browse the amazing demos and tutorials that are included (in the setup folder) with fully explained and simple code lines in C# and VS.
Using the code
Demos and tutorials are included in the setup folder (after installation, usually at C:\Program Files (x86)\e-iceblue\Spire.PdfViewer-FE\Demos\, or simply visit the website), with fully explained and simple code lines in C# and VS.

This one is the hello world (C:\Program Files (x86)\e-iceblue\Spire.PdfViewer-FE\Demos\CS\WinForms\02_PdfViewer\HelloWorld), simple and easy.

NehaPosted Jan 5, 2017, 5:35 AM
Nice one.........................................................