StrataFrame Forum

Viewing PDF in VB .NET

http://forum.strataframe.net/Topic7732.aspx

By StarkMike - 3/27/2007

I'm just curious how labor intensive it is to view PDFs in VB .NET, whether by purchasing a component or writing code.



Thanks
By Trent L. Taylor - 3/27/2007

You will definitely want to purchase a tool in order to do this.  Writing your own reader using the Adobe SDK is a grueling task!  If you have the need to both create and read PDFs then be careful when looking around because many of the tools will write but not read and vice versa.  We created a wrapper for the Atalasoft PDFEncoder and PDFDecoder...this takes more of an image approach but once we got our wrapper in place works pretty well.  There are others that are easier to use but have speed issues (or at least they did when I was testing them).  The nice thing about Atalasofts is that they also have a viewer control that allows you to implement a reader into you application.  You could do this yourself with other tools as well.  The Atalasoft version may be a bit over-priced if you only have the need for PDF because you have to purchase their imaging tools before you can add in the PDF Encoder/Decoder.

SYncFusion, Adlib SOftware, and more have tools that can help you out here as well.  Do a Google search on ".NET, PDF Writer and Reader" and you can find more tools.

By Keith Chisarik - 3/27/2007

Atalasoft worked great for us.
By StarkMike - 7/9/2007

I finally found a solution and I wanted to share it with the StrataFrame community.



For viewing a PDF in VB.NET you can use the Adobe Acrobat Control for ActiveX.



Hope this helps someone else! ;-)
By Ben Hayat - 7/9/2007

For viewing a PDF in VB.NET you can use the Adobe Acrobat Control for ActiveX.


I read somewhere that it is not advisable to mix unmanaged and manged code in the same executable due to the way garbage collection works. Although, MS is still using a lot of old unmanaged code written in C (not even in C++) that are still being used in .Net apps. For example, the vector graphic engine that is used in Expression Design, is from 12 years ago, when MS bought it from another company. This was said by the lead developer of Expression Design, however, all that stuff has been wrapped with managed code.
By Trent L. Taylor - 7/9/2007

Ben, you are correct.  But it also depends on how much usage the interop will get.  If your entire application is hinged around it, then yeah, bad idea for sure Smile  But just for a minor viewer it shoulnd't cause too many issues...if any.  One thing that .NET does really well is create an interop interface to the COM and Ax... classes.  The only downside that I see with using an ActiveX control is that you either have to distribute it, or in this case make sure Adobe Reader is installed.  But you are correct, certain ActiveX controls do notplay nice with .NET...but the more popular ones, such as this Adobe Acrobat control or the Flash ActiveX shouldn't cause too many issues.  I will agree with Ben, though, that if part of your application relies heavily on opening and viewing PDF documents, then this may cause some memory and interopability issues once the volume is increased.
By StarkMike - 7/10/2007

Wow! Thanks guys for such great advice. My entire application wont be hinged on the use of this control so I think I'll be ok.
By Ralph Rutschmann - 7/11/2007

Hi,



maybe you should have a look at this too:



http://www.vbdotnetheaven.com/UploadFile/scottlysle/PdfGenVB06162007031634AM/PdfGenVB.aspx

http://sourceforge.net/projects/itextsharp/





HTH, Ralph