How to View PDF File in VB.Net

In this tutorial I will teach you how to view pdf file using vb.net. PDF (Portable Document Format) is a popular file format for presenting documents that also includes images, text formatting. In order to read the pdf reader in vb.net you must install pdf and add it into your visual basic studio.

Let’s get started:

Open Microsoft Visual Studio 2015 and create a new windows form application. ps1012 Go to toolbars, right click and select choose items. ps10123 Go to COM Components and check Adobe PDF Reader then hit OK. ps10212 Add PDF Reader, OpenFileDialog and a Button in the form just like shown below. ps1232 Double click the “Open PDF File” Button to fire the click event handler of it. After that do the following code for viewing the pdf file.
  1. Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
  2.         OpenFileDialog1.Filter = "PDF |*.pdf"
  3.         If OpenFileDialog1.ShowDialog = DialogResult.OK Then
  4.             AxAcroPDF1.src = OpenFileDialog1.FileName
  5.         End If
  6.     End Sub
Output: ps10221 For more question about this article. You can contact me @ Email – [email protected] Mobile No. – 09305235027 – TNT FB Account – https://www.facebook.com/onnaj.soicalap

Comments

On 64 bit application it is not working... Is any another solution? Thanks

Add new comment