Home
Suggestion or Comment?

PDFDoc Scout

PDFDoc Scout screenshot (click to enlarge)


Subscribe to Our Bi-Monthly Newsletter (tips, new releases, specials):
 Subscribe in a reader
 PRODUCTS  |  DOWNLOAD  |  PURCHASE  |  SUPPORT  |  TESTIMONIALS   |  NEWS  | 

PDFDoc Scout library - Sample

Download Free Trial See Licensing Options More Information

Getting started with PDFDoc Scout library and Visual Basic.NET: 
"Hello, World!" example

You can download the source code of this example here: pdfdocscout_vb_net.zip

This page contains step-by-step tutorial that will teach you how to create PDF document file in Visual Basic.NET application using PDFDoc Scout library.

1) Install PDFDoc Scout library on your computer and run Microsoft Visual Studio .NET
 
Go to New menu and click Project... to create new project as shown on screenshot below:
 
File menu in VB net IDE
 
You will see New Project Wizard. Select Windows Application in Visual Basic Projects group:
 
New project wizard
 
2) VB.NET will create a new project:
 
New project generated by wizard
 
3) To use PDFDoc Scout in Visual Basic.NET we have to add reference to PDFDoc Scout library for current VB.NET project. Select Project in the main menu and click Add Reference command:
 
Add reference menu command
 
Switch to COM tab and find PDFDoc Scout library in the list of available COM objects:
 
Add reference dialog
 
Now click on Select button to add reference to PDFDoc Scout and click OK
 
Click OK button
 
4) Now add the code that will create "Hello, World!" PDF document. Double-click Form1 to create Form1_Load event procedure:
 
VB.NET project form
 
The source code editor window will be appear:
 
Source code editor window
 
5) The code that generate "Hello, World!" PDF document is below. Generated pdf document file will be saved into "c:\HelloWorld.PDF" file. You can simply copy-and-paste this code into your project.
          

Dim PDFDoc As PDFDocScout.PDFDocument
PDFDoc = New PDFDocScout.PDFDocument ' create new PDFDoc object

PDFDoc.InitLibrary("demo", "demo") ' init library

PDFDoc.OutputFileName = "c:\HelloWorld.pdf" ' set output filename for generated PDF document
PDFDoc.AutoOpenGeneratedPDF = true ' set to True to automatically open generated PDF document in default PDF viewer application


PDFDoc.BeginDocument ' begin PDF document generation
' add text to current page
PDFDoc.Page.AddText "Hello, World!", 100, 100, 15
PDFDoc.EndDocument ' close PDF document

 
Hint:
You can simply copy the source code from the snippet above and paste into Visual Basic.NET code editor window:
 
6) Press F5 to run the application (you can also use "Debug" | "Start" menu command) and Visual Basic.NET will run the application:
 
Run project menu command
 
The application will generate pdf document file and will save it as "HelloWorld.PDF" file in root folder of C:\ drive. 
 
You can view generated PDF document using Adobe Reader or another application that is able to open and display PDF documents.

PDF document generated by VB.NET project

You can download the source code of this example here: pdfdocscout_vb_net.zip

Download Free Trial See Licensing Options More Information


See also: Bytescout.PDF - native .NET library to write/read/sign/
modify/merge/split PDF documents (but no HTML2PDF support)



On-line documentation (HTML format)


"Hello, World!" quick start step-by-step tutorials:


HOME  |  CONTACT US

Copyright © ByteScout, 2003-2010. Privacy Statement
Microsoft®, Windows®, Windows 2000®, Windows Server®, Windows Vista®, Internet Explorer®, .NET Framework®, ActiveX®, Visual Basic®, Visual C#®, ASP®, ASP.NET®, Excel®, PowerPoint®, are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries. Adobe®, Flash® and Acrobat® are registered trademarks of Adobe Systems, Incorporated. Mozilla®, Firefox® and the Mozilla and Firefox Logos are registered trademarks of the Mozilla Foundation. Other product names or brandnames used herein are for identification purposes only and might be trademarks or registered trademarks of their respective companies. We disclaim any and all rights to those marks.