Home

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  |  CONTACTS  |  TESTIMONIALS 

PDFDoc Scout library - Sample

Download Free Trial See Licensing Options More Information

Quick Start Guide: 
How to create PDF document from Visual Basic: "Hello, World!" PDF document
 

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

This guide will teach you how to create simple PDF document using PDFDoc Scout library and Visual Basic

1) Install PDF Scout library on your computer and run Visual Basic. Go to File and click New
 
Visual Basic file menu new command
 
The Project Wizard will appear:
New Visual Basic project wizard
2) Select Standard EXE project type and click Open to create a new project.
Visual Basic will generate new project called Project1 and will automatically open the main form of the generated project:

New project generated by Visual Basic
 
3) Click on Form1 surface and Visual Basic will show the code window for Form_Load event:
Visual Basic form load event code handler auto generated
 
4) Now you have to add the code that will create PDF document using PDF Scout library. 
 
Here is the source code that you can simply copy and paste into Visual Basic:
 

Set PDFDoc = CreateObject("PDFDocScout.PDFDocument")
PDFDoc.InitLibrary "demo", "demo"

PDFDoc.OutputFileName = "HelloWorld.pdf"
PDFDoc.AutoOpenGeneratedPDF = true ' automatically open generated PDF document in default PDF viewer application

PDFDoc.BeginDocument

' add text to current page
PDFDoc.Page.AddText "Hello, World!", 100, 100, 15

PDFDoc.EndDocument ' close document

This function will create PDF file "HelloWorld.PDF" pdf document on drive C:\
 
Hint:
You can simply copy the source code from the snippet above and then paste it in the Visual Basic code editor as it's shown on the screenshot below:
 
5) Press F5 to run the application (you can also use "Run" | "Start" menu command). 
 
Run project button on toolbar
 
6) Visual Basic will run the application and application will generate PDF file "c:\HelloWorld.PDF".
 
You can view generated pdf document file (.PDF) using Adobe Reader or another application that is capable of viewing   pdf documents.
 
Generated pdf document in Adobe Reader
 
 
You can download the source code of this example here: pdfdocscout_vb.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:


PRODUCTS  |  DOWNLOAD  |  PURCHASE  |  SUPPORT  |  CONTACTS  |  TESTIMONIALS  |  NEWS

Copyright © ByteScout, 2003-2009. 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.