www.gnostice.com 

Microsoft Visual Basic 6

Top  Previous  Next

Steps for Microsoft Visual Basic 6

 

 

 

1.Start Microsoft Visual Basic and create a new project.

 

2.On Project menu, choose Components or press Ctrl+T from the keyboard.

 

VisualBasic_Project and Components - Fig 1

 

3.Select Control tab from the dialog, check "Gnostice eDocEngine ActiveX Control" check box from the list and click OK.

 

GettingStarted_Components - Fig 2

 

 

4.The "Gnostice eDocEngine" control gets installed and appears on the toolbox.

 

5.Drop the control on the user form; you can start writing code.

 

VisualBasic_Drop control - Fig 3

 

6.The following sample code will create Hello World in the document:

 

 

With gtEngineX1 'gtEngineX1 can be replaced with any of the engines eg., gtPDFEngineX1.

 

       .FileName = "D:\\testdoc"

 

       .ActivateLicense "Enter The Licensekey String Here"

 

       .BeginDoc

 

       .TextOutXY 1, 1, "Hello World"

 

       .EndDoc

 

End With

 

 

 

7.The properties and functions required to write a basic code is FileName, BeginDoc and EndDoc.

 

round bulletFileName is used to identify the file to be created.

 

ActivateLicense is used activate the License for Gnostice eDocEngine ActiveX Control.

 

round bulletBeginDoc is used to begin the document creation.
 
round bulletEndDoc is used to end the document creation.

 

You can add tables, Header, Footer and many properties in between BeginDoc and EndDoc which can be viewed in the required format eg., PDF format.

 

8.By default, all eDocEngine ActiveX/.NET control pops up a setup dialog where you can set various properties of the output document. To control this option, use PrefShowSetupDialog property. If the PrefShowSetupDialog property is set to "True", then you are allowed to set the Preferences, Content, Background, Advanced, and Viewing Preferences OR the PrefShowSetupDialog can be controlled through the code as follows:

 

GettingStarted_code sample for basic doc creation

round bulletPreference provides Page, Range and Embed Used True Type Fonts.
 
round bulletContent provides Items to Render, Image and Document Information.
 
round bulletBackground provides Background Image and Background Color.
 
round bulletAdvanced provides Compress Document, Encrypt Document, User Permissions and Font Encoding.
 
round bulletView Preference provides Page Layout, Page Mode, Hide UI Elements and Presentation Mode.

 

 

9.Click "OK", document is created in the required format.

 

10.Follow the same procedure for all the controls and code samples for few controls are provided in the samples section.

 

 

top of the page hyperlink