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.
Go to toolbars, right click and select
choose items.
Go to
COM Components and
check Adobe PDF Reader then hit
OK.
Add
PDF Reader, OpenFileDialog and a
Button in the form just like shown below.
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.
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
OpenFileDialog1.Filter = "PDF |*.pdf"
If OpenFileDialog1.ShowDialog = DialogResult.OK Then
AxAcroPDF1.src = OpenFileDialog1.FileName
End If
End Sub
Output:
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