Monday, 4 January 2016

Make your own pdf reader in visual studio 2008

Open visual studio 2008

File->New project
Select project type has visual Basic
select windows ->windows Form Application
in toolbox we   must import Adobe PDF reader in toolbox select any tool and Right-click and select  choose items



it shows choose tool items box select COM components tab




under select the adobe pdf Reader and click OK
paste adobe pdf reader in your  form
paste button and openfile dialogbox in  your form
using your open file dialog and select file and load file to adobe pdf reader

double click your  button  paste the following code
        OpenFileDialog1.Filter = "Pdf |*.pdf"
                  OpenFileDialog1.ShowDialog()

                   AxAcroPDF1.LoadFile(OpenFileDialog1.FileName)
Debug your coding.

Download

Coding:

Public Class Form1
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)        Handles MyBase.Load
    End Sub

    Private Sub Open_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Open.Click

        OpenFileDialog1.Filter = "Pdf |*.pdf"
        OpenFileDialog1.ShowDialog()
         AxAcroPDF1.LoadFile(OpenFileDialog1.FileName)
    End Sub
End Class


Output screen:



No comments:

Post a Comment