Bytescout.PDF for .NET |
Bytescout.PDF library for .NET
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"); Download example source code: bytescoutpdf_example_add_text_to_existing_document.zip (6 KB)
"Hello, World!" quick start step-by-step tutorials: "Hello, World!" quick start step-by-step tutorials: |
|
|
||