Microsoft Visual Studio .NET

Top  Previous  Next

Steps for Microsoft Visual Studio .NET

 

 

 

1.Start Visual Studio .NET and on File menu, choose New, then choose Project.

 

 

 

 

 

 

2.Select Visual VB Projects for VB application and Visual C# Projects for Visual C# application from the Project Types list and Windows Application from the Templates list. Enter the project Name, select the Location and click OK.

 

 

 

Visual Basic

 

 

 

 

 

 

 

Visual C#

 

 

 

 

 

 

 

 

3.        As per the selection of the application, the User Form dialog is displayed.

 

 

 

Visual Basic

 

 

 

 

 

 

 

Visual C#

 

 

 

 

 

 

4.Select Toolbox from View menu.

 

 

 

 

 

 

5.        To insert PDFtoolkit ActiveX control(s), there are two ways:

 

 

 

i) To insert controls through the Toolbox:

 

 

 

a)Secondary click (right click) and select Add Tab from the list. A textbox appears at the bottom of the Toolbox wherein you can enter the name for the tab. Name the tab as Gnostice PDFtoolkit.

 

 

 

 

 

 

b)Secondary click the tab Gnostice PDFtoolkit.  Select Add/Remove Items option from the list. A Customize Toolbox dialog is displayed. If you need to utilize the .ocx select COM Components tab from the options. Select Gnostice PDFtoolkit control from the list and click OK.

 

Depending on the package purchased you will see one or more of the controls displayed. For more information see Editions Of PDFtoolkit ActiveX.

 

 

 

If you need to utilize the .NET Interop DLLs select the .NET Framework Components tab. Browse to the folder where the DLLs are located and select it (PDFtoolkitNET.dll). Click on the Open button.

 

Note: Depending on the package purchased you will see one or more of the controls displayed. For more information see Editions Of PDFtoolkit ActiveX.

 

 

 

c)The Toolbox contains the list of "Gnostice PDFtoolkit" control(s).

 

 

 

d)Drop the control which you need to use on the user form.  You can start writing code as per the selection of the application.

 

 

 

 

Visual Basic

 

 

 

 

 

 

 

 

 

 

 

Visual C#

 

 

 

 

 

 

 

 

 

e)The following sample code will load a PDF file and make a copy of it using the method SaveToFile.

 

 

 

Visual Basic

 

 

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

       With AxgtPDFDocumentX1

           .LoadFromFile("Sample.pdf")

           .SaveToFile("Output.pdf")

       End With

End Sub

 

 

 

Visual C#

 

 

private void button1_Click(object sender, System.EventArgs e)

{

axgtPDFDocumentX1.LoadFromFile("Sample.pdf");

axgtPDFDocumentX1.SaveToFile("Output.pdf");

                  }

 

 

OR

 

ii) To insert controls through Code:

 

a)To add Gnostice PDFtoolkit controls through code secondary click (right click) the Solution Explorer - WindowsApplication1. Select Add Reference from options.

 

 

 

 

b)Select .Net tab from Add Reference dialog. Browse and select the .dll from <PDFtoolkit InstallDir>\Bin\.Net\PDFtoolkitX.dll.

 

 

 

 

 

 

c) You can start writing code. The following sample code will load a PDF document and make a copy of it.

 

 

Visual Basic

 

 

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)Handles Button1.Click

Dim AxgtPDFDocumentX1 As New gtPDFDocumentXClass()

AxgtPDFDocumentX1.LoadFromFile("Sample.pdf")

AxgtPDFDocumentX1.SaveToFile("Output.pdf")

End Sub

 

 

 

Visual C#

 

 

private void button1_Click(object sender, System.EventArgs e)

{        

gtPDFDocumentX axgtPDFDocumentX1 = new gtPDFDocumentXClass();                        

axgtPDFDocumentX1.LoadFromFile("Sample.pdf");

axgtPDFDocumentX1.SaveToFile("Output.pdf");

}