Home

Bytescout.PDF for .NET



Bytescout.PDF library for .NET - hightlight text in PDF document

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

Highlighting text in a PDF document generated using Bytescout.PDF library

This example provides a VB.NET (for .NET) to add hightlighted text in PDF generated using Bytescout.PDF library for NET

Download example source code: bytescoutpdf_highlighted_text_effect.zip (10 KB)

PDF with hightlighted text  added using Bytescout.PDF library for .NET

Imports Bytescout.PDF

Module Module1

Sub Main()
' Create main PDF Doc Engine
Dim engine As New PDFDocEngine("", "")

' Add new document
Dim document As Document = engine.AddDocument()

' Append new page to the document
Dim page As Page = document.AddPage(PageSizeType.A3, PageOrientationType.LandScape)

' Create new drawing
Dim drawing As Drawing = page.AddDrawing()

' Add standard font
Dim font As UInteger = document.AddFontStandard(StandardFontType.Courier, FontEncodingType.WinAnsi)

' Set Active Font
drawing.SetActiveFont(font, 50, False, False)

drawing.SetFillColor(Bytescout.PDF.Drawing.RGBToColor(127, 127, 127))

'Draw rectangle
drawing.rectangle(100, 100, 500, 150)

drawing.Fill()

drawing.SetFillColor(Bytescout.PDF.Drawing.RGBToColor(200, 140, 170))

' Draw Text
drawing.PlaceText(100, 100, 0, "Hello World!")

drawing.Fill()

' Closing drawing on the page
drawing.Close()

' Save document
document.Save("HighLightedText.pdf")

' open PDF document in default PDF reader
Process.Start("HighlightedText.pdf")
End Sub

End Module

Download example source code: bytescoutpdf_highlighted_text_effect.zip (10 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:
Products  |  Download  |  Purchase  |  Support  |  Contacts  |  Testimonials |  

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