Click here to Skip to main content
15,885,760 members
Articles / Programming Languages / Visual Basic

PDF Viewer Control Without Acrobat Reader Installed

Rate me:
Please Sign up or sign in to vote.
4.95/5 (143 votes)
6 Oct 2009CPOL4 min read 1.4M   73.7K   496  
PDF document viewer control that does not require any Acrobat product to be installed
Public Class Form1

    Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
        PdfViewer1.Dispose() 'Necessary to free resources used by the PDF Viewer
    End Sub

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

    End Sub

    Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        PdfViewer1.SelectFile()
        TextBox1.Text = PdfViewer1.FileName
    End Sub

    Private Sub rbXPDF_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rbXPDF.CheckedChanged
        If rbXPDF.Checked Then
            PdfViewer1.UseXPDF = True
        Else
            PdfViewer1.UseXPDF = False
        End If
        PdfViewer1.FileName = PdfViewer1.FileName
    End Sub

  Private Sub btOCR_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btOCR.Click
    MsgBox(PdfViewer1.OCRCurrentPage)
  End Sub
End Class

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions