Introduction of PDF viewer-:For creating a PDF viewer it is necessary what is the PDF viewer PDF is a file format. It full name is the Portable Document Format. It was developed by the Adobe In 1990. PDF files may contain a variety of content besides flat text and graphics. In the PDF file has a logical structuring elements, interactive elements like annotations and form-fields, layers, rich media (In media has a video content also) and three dimensional objects.
How to create pdf viewer software-: For creating a PDF Viewer Software we know that a programming language must be necessary. First we select the programming language. Here we are selecting Visual Basic (VB) programming language for creating a software.
We are using Microsoft Visual Studio here for Create PDF Viewer Software. Microsoft Visual Studio is an integrated development environment (IDE) from Microsoft. It is used to develop computer programs, as Window application, websites application, web apps, web services and mobile apps.
For creating software follow these process-:
1-: First download the visual studio. there are many version available . you can download and install it. There are many version available of Visual Studio
2-: After Installing Visual Studio you can open the visual studio.
3-: Create a New Folder on the desktop and give the folder name PDF Viewer.
4-: Now click the File Menu option in the visual studio. In the File Menu You can select the New Project. When we get a dialogue box open here as like
5-: We here clicked Installed button in the left side. There are many language list will show here. here we select the Visual Basic . Now We select .Net framework which is the latest in our Visual studio. here I am using .Net framework 4.5 it is the latest in my visual studio. You can choose according your Visual studio. Here we select Window form application .
6-: After selecting window form application we give the Name of the window form according us. Now we are creating a PDF viewer software then we give the name of form PDF Viewer. Now select Location where you want to save this .We have create a New folder on desktop. Give the application name here. If you don’t give the name it takes automatic as like window application and its saved into “C ” drive where the Visual studio are Installed.
File —-> New Project—-> Installed —>Visual Basic—->Window Form application —->Name—–> Select Location ——> OK
7-: After clicking a OK button we get a form here. Visual studio provide many facility.This Is divided in 3 portion.
- First portion is the tool box list where the tool are available in the list
- Second is the our workplace where we work here. It is called the form
- Third part is the property and solution explorer are available here.As like here
8-: In the above Image the form1 is showing here. We right click the form then we get a menu here. Here we select the property option then the form property will open here. In the property menu we give the name of text property here PDF viewer software created by netnic team .
Here are the default icon available here. You can give the your icon for selecting the icon property of the form. Click the icon property and choose the logo here .that must be saved in the folder (PDF Viewer). Here are many Form property available here as like
9-:Now we comes our form where we design our PDF Viewer software.First we design the menu of PDF software.For design the menu we select ToolStrip Tool from the tool box. We can add this tool double click or drag and drop by the help of mouse. There are Multiple Option available in the ToolStrip as like Label, Button, SplitButton, DropDownButton, Seprator , ComboBox,TextBox and ProgressBar .
10. in the ToolStrip we click the mouse then a list will open here. In the list has many button we select Button here. After selecting button we go to the ToolStrip Button property. In the Property of Text we give the Text Name Open File and another property name Display Style where are the default is image. Here if we have a image then give the image otherwise you can select here text. You can select here both text and image.
In the Microsoft Word there are many images has been given there. You can create this type menu also. We are taking here only text for creating PDF viewer menu.Now this way we can add more button here We give the Next button, Previous button, Print Button. Our menu has been created. You can give here more button for adding menu.
11-: Now we add OpenFileDialog Box from the tool box. It is use for selecting the PDF file or Opening a PDF file. In the Property menu we delete the File Name not for a name and select the Filter option in the property menu.
Reason for selecting the Filter option -: Filter will show which file we want to see. Here we are creating a PDF viewer software then we write this code here in the Filter Property of OpenFileDialog tools. We write this code PDF file | *.pdf | All Files |*.*
12-: Now we add the PDF Viewer in our form for seeing the pdf file because all pdf file swill show in this. We don’t have the PDF viewer in our tool box list but we can add this pdf viewer. For adding the pdf viewer follow these process
- First Right click the mouse button on the tool box place.
- Now a menu will open here in the menu we select Choose Item button. Now a Window will open here. In the window click the “COM components” .
- Now You get the Adobe PDF Reader it is unchecked you can checked it. And click OK button .
- Adobe PDF Reader is added in Your Tool box. Now drag and drop Adobe PDF Reader in the form.
13-: Now we select the adobe pdf reader tool box property here. Here we select Dock property in the property menu. here we select Middle option in the Dock property Then it will looks like this way.
14-: Now double Click the form getting the programming part. here we write the code here for showing the pdf file. In this programming all the class which is starting must be close. If we don’t close then the error comes.
Public Class Form1Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
End Sub
End Class
15-: Now we go to the design part and double click on open file button here we do the coding in the form1.vb page. we write the code here.
Private Sub ToolStripButton1_Click(sender As Object, e As EventArgs) Handles ToolStripButton1.Click
OpenFileDialog1.ShowDialog() // for selecting the file
End Sub
16-: Now go tho the design parts and double click OpenFileDialog button and write the code here in form1.vb page
Private Sub OpenFileDialog1_FileOk(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles OpenFileDialog1.FileOk
AxAcroPDF1.LoadFile(OpenFileDialog1.FileName.Tostring) // for connecting the pdf file
End Sub
17-: Now we go to the design parts and double click Next Button and write this code here as like
Private Sub ToolStripButton2_Click(sender As Object, e As EventArgs) Handles ToolStripButton2.Click
AxAcroPDF1.LoadFile .gotoNextpage() // for going next page
End Sub
18-: Now we go to the again design parts and double click Previous Button and then we write this code here for going the previous page
Private Sub ToolStripButton3_Click(sender As Object, e As EventArgs) Handles ToolStripButton3.Click
AxAcroPDF1.LoadFile.gotoPreviouspage()
End Sub
19-: Now we go to the design part and double click the print button and write this code here.
Private Sub ToolStripButton4_Click(sender As Object, e As EventArgs) Handles ToolStripButton4.Click
AxAcroPDF1.LoadFile.Print()
End Sub
Our program is ready to convert into the software. Now we can run this program and see the result. Full coding is here
Public Class Form1
Private Sub ToolStripButton1_Click(sender As Object, e As EventArgs) Handles ToolStripButton1.Click
OpenFileDialog1.ShowDialog()
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
End Sub
Private Sub OpenFileDialog1_FileOk(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles OpenFileDialog1.FileOk
AxAcroPDF1.LoadFile(OpenFileDialog1.FileName.Tostring)
End Sub
Private Sub ToolStripButton2_Click(sender As Object, e As EventArgs) Handles ToolStripButton2.Click
AxAcroPDF1.LoadFile .gotoNextpage()
End Sub
Private Sub ToolStripButton3_Click(sender As Object, e As EventArgs) Handles ToolStripButton3.Click
AxAcroPDF1.LoadFile.gotoPreviouspage()
End Sub
Private Sub ToolStripButton4_Click(sender As Object, e As EventArgs) Handles ToolStripButton4.Click
AxAcroPDF1.LoadFile.Print()
End Sub
End Class
Now Our software is ready for creating the software. For creating software or .exe file click here