Simple PDF Reader

By @riyo.s941/5/2018utopian-io

Simple PDF reader is a desktop application to viewing and printing on PDF documents. It's only PDF viewer to open and interact with all types of pdf content. This application is very simple and easy to use, small and fast. I have this application can make contribution to small pdf viewer, in the future this application will probably adding some features. or you can make contribution to this projects.

https://res.cloudinary.com/hpiynhbhq/image/upload/v1515123499/qa7dsbw1qzxkuyflueri.png

Prototype

https://res.cloudinary.com/hpiynhbhq/image/upload/v1515123513/zyqo5xua2wssqmftedfn.png
This application have three main component:

  • Header: header is main window, in the header have a logo, title and 3 button for minimize, maximize and close the application.
  • Toolbars: in this section consists of toolbar to open and manage pdf document.
  • Entire area: Entire area to viewing content of pdf document.

How to install?

To install this project have a requirements:

Screenshot

https://res.cloudinary.com/hpiynhbhq/image/upload/v1515124660/quw33yhhaydxlwae2y8a.png
https://res.cloudinary.com/hpiynhbhq/image/upload/v1515124720/mjnni4m9urz3yecctfwd.png
https://res.cloudinary.com/hpiynhbhq/image/upload/v1515124671/ppmcz7u7pvfidyzs3dgp.png

Codes

And here is some screenshot of code:
Open file and set pdf document default zoom
This code defined to get and open pdf document and show to the entire area. And set default zoom to 75% and view to first page of pdf document.
https://res.cloudinary.com/hpiynhbhq/image/upload/v1515124926/shcopx2is5cccwtaahsa.png

    Private Sub btnOpenFile_Click(sender As Object, e As EventArgs) Handles btnOpenFile.Click
        ofdFile.Filter = "PDF File (*.pdf)|*.pdf"
        ofdFile.Multiselect = False
        ofdFile.FileName = ""
        ofdFile.ShowDialog()
        lblTitle.Text = ofdFile.SafeFileName + " - Simple PDF Reader"
        cboSize.Enabled = True
        btnPrint.Enabled = True
        txtPage.Text = 1
    End Sub
    Private Sub ofdFile_FileOk(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles ofdFile.FileOk
        AxAcroPDF1.src = ofdFile.FileName
        AxAcroPDF1.setZoom(75)
        cboSize.SelectedIndex = 3
    End Sub

Toolbars codes
This codes defined some toolbar function to zoom in and zoom out pdf document and goto previous or next page. And code to print the pdf document.
https://res.cloudinary.com/hpiynhbhq/image/upload/v1515125052/cywi0mdnxoyybvtgb47k.png

    Private Sub btnPrint_Click(sender As Object, e As EventArgs) Handles btnPrint.Click
        AxAcroPDF1.printWithDialog()
    End Sub
    Private Sub txtPage_TextChanged(sender As Object, e As EventArgs) Handles txtPage.TextChanged
        If txtPage.Text < 0 Then
            txtPage.Text = 1
        End If
        AxAcroPDF1.setCurrentPage(txtPage.Text)
    End Sub
    Private Sub btnPreviousPage_Click(sender As Object, e As EventArgs) Handles btnPreviousPage.Click
        AxAcroPDF1.gotoPreviousPage()
    End Sub
    Private Sub btnNextPage_Click(sender As Object, e As EventArgs) Handles btnNextPage.Click
        AxAcroPDF1.gotoNextPage()
    End Sub
    Private Sub btnSizeMinus_Click(sender As Object, e As EventArgs) Handles btnSizeMinus.Click
        Dim size As Int16 = Replace(cboSize.SelectedItem, "%", "") - 20
        If size < 1 Then
            size = 10
        End If
        AxAcroPDF1.setZoom(size)
    End Sub
    Private Sub btnSizePlus_Click(sender As Object, e As EventArgs) Handles btnSizePlus.Click
        Dim size As Int16 = Replace(cboSize.SelectedItem, "%", "") + 20
        If size < 1 Then
            size = 10
        End If
        AxAcroPDF1.setZoom(size)
    End Sub

Thank you



Posted on Utopian.io - Rewarding Open Source Contributors

7

comments