Home

Bytescout.PDF for .NET


 Products  |  Download  |  Purchase  |  Support  |  Contacts  |  Testimonials |  
Bytescout.PDF library for .NET

Download Free Trial Buy Now More Information
For HTML2PDF and XML2PDF solution check our PDFDoc Scout ActiveX library instead

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)

Source PDF document which is taken as source to modify (add text) and save as new document file

PDF document with text added to the first page

            // 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, 50falsefalse);

            
// Draw Text
            
drawing.PlaceText(1001500"Hello again, World!");
            
drawing.PlaceText(1002000"(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)

Download Free Trial Buy Now More Information
For HTML2PDF and XML2PDF solution check our PDFDoc Scout ActiveX library instead

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

Advanced Examples:

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

Advanced Examples:
Products  |  Download  |  Purchase  |  Support  |  Contacts  |  Testimonials |  

ByteScout, 2003-2008. All other company and product names may be trademarks of their respective companies. Privacy Statement