- Home
- Purchase
- Developer Tools
- BarCode Generator SDK
- BarCode Generator SDK for Javascript for Code 128
- BarCode Reader SDK
- PDF Generator SDK for Javascript
- PDF Extractor SDK
- PDF Renderer SDK
- PDF To HTML SDK
- PDF Viewer SDK
- Spreadsheet SDK
- Image To Video SDK
- Screen Video Capturing SDK
- SWF To Video and Images SDK
- Images Watermarking SDK
- Document SDK beta
- Misc Tools
- Desktop Utilities
- Download
- Support
- Company
The PDF SDK for .NET product has been acquired by Sybrex company in January, 2011 and not available on our web-site anymore.
NEW: Check our new rich PDF reports generator for Javascript (completely client side generation): PDF Generator SDK for Javascript: click here to read more details...
For 3rd party server side C# open-source PDF generation library?
Check the blog article: .NET Bear, Do You Know Any Free PDF Generation Libraries For Use In Commercial Applications?
Our commercial products for PDF format:
PDF Extractor SDK - extract tables, text, structured data from PDF files in your apps
PDF Renderer SDK - render PDF files to PNG, BMP, TIFF images in your apps
PDF To HTML SDK - convert PDF to HTML with images and formatting preserved
How to add file attachment to PDF document from buffer into PDF generated with Bytescout.PDF library for .NET
Quick Start with Bytescout.PDF in Visual C#: "Hello, World!" PDF document
You can download the source code of this example here: bytescoutpdf_csharp.zip
This page will show how to use Visual C# and Bytescout.PDF library to create "Hello, World!" PDF document (.PDF)
1) Install Bytescout.PDF library on your computer and run Microsoft Visual Studio.NET
Go to New menu and click Project... to create new Visual C# project

The New Project Wizard will appear. Select Windows Application in Visual C# Projects group:

2) Visual C# will create a new empty project:

3) To use Bytescout.PDF library in Visual C# application we should add the reference to Bytescout.PDF. Select Project in the main menu and then select Add Reference command:

Switch to Browse tab and browse and add "Bytescout.PDF.Demo.dll" (or Bytescout.PDF.dll if you have already purchased full version)
4) Double-click on form Form1 to create the Form1_Load procedure (this procedure will be execute on Form1.OnLoad event):

The source code editor window will appear:

5) Add Using Bytescout.PDF; in the beginning of the code to use Bytescout.PDF namespace in your Hello, World project
6) The following code snippet generates simple "Hello, World!" PDF document and saves it into "HelloWorld.PDF" file:
// Create main PDF Doc Engine
PDFDocEngine engine = new PDFDocEngine("demo", "demo");
// Add new document
Document document = engine.AddDocument();
// Append new page to the document
Page page = document.AddPage(PageSizeType.A3, PageOrientationType.LandScape);
// Create new drawing
Drawing drawing = page.AddDrawing();
// Add standard font
uint font = document.AddFontStandard(StandardFontType.Courier, FontEncodingType.WinAnsi);
// Set Active Font
drawing.SetActiveFont(font, 50, false, false);
// Draw Text
drawing.PlaceText(100, 100, 0, "Hello World!");
// Closing drawing on the page
drawing.Close();
// Save document
document.Save("HelloWorld.pdf");
PDFDocEngine engine = new PDFDocEngine("demo", "demo");
// Add new document
Document document = engine.AddDocument();
// Append new page to the document
Page page = document.AddPage(PageSizeType.A3, PageOrientationType.LandScape);
// Create new drawing
Drawing drawing = page.AddDrawing();
// Add standard font
uint font = document.AddFontStandard(StandardFontType.Courier, FontEncodingType.WinAnsi);
// Set Active Font
drawing.SetActiveFont(font, 50, false, false);
// Draw Text
drawing.PlaceText(100, 100, 0, "Hello World!");
// Closing drawing on the page
drawing.Close();
// Save document
document.Save("HelloWorld.pdf");
Hint: you can simply copy the source code from the snippet above and paste into Visual C# source code editor
6) Press F5 to run the application (you can also use "Debug" | "Start" menu command) and Visual C#.NET will run the application:

The application will create "Hello, World!" PDF animation movie and save it into "HelloWorld.PDF" document file.
You can view generated PDF document using any application that can display PDF document: Adobe Reader:

You can download the source code of this example here: bytescoutpdf_csharp.zip
Filed in:
PDF SDK for .NET
Tutorials:


