- 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 text to existing PDF document using Bytescout.PDF library for .NET applications
Add text to the existing PDF document using Bytescout.PDF library for .NET
In this example Bytescout.PDF library for .NET is used to add text to the first page of the existing PDF document (HelloWorld.pdf) and save new document as HelloWorldAgain.pdf
Download example source code: bytescoutpdf_example_add_text_to_existing_document.zip (6 KB)


// Create main PDF Doc Engine
PDFDocEngine engine = new PDFDocEngine("", "");
// Open existing document
Document document = engine.AddDocument("HelloWorld.pdf");
// Get first page
Page page = document.GetPage(0);
// 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, 150, 0, "Hello again, World!");
drawing.PlaceText(100, 200, 0, "(was added to the existing page)");
// Closing drawing on the page
drawing.Close();
// Save document
document.Save("HelloWorldAgain.pdf");
PDFDocEngine engine = new PDFDocEngine("", "");
// Open existing document
Document document = engine.AddDocument("HelloWorld.pdf");
// Get first page
Page page = document.GetPage(0);
// 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, 150, 0, "Hello again, World!");
drawing.PlaceText(100, 200, 0, "(was added to the existing page)");
// Closing drawing on the page
drawing.Close();
// Save document
document.Save("HelloWorldAgain.pdf");
Download example source code: bytescoutpdf_example_add_text_to_existing_document.zip (6 KB)
Filed in:
PDF SDK for .NET
Tutorials:


