PDFRasterizer.NET 4.0 is now available. Supports .NET Core. Renders pixel-perfectly.

Add single-line text to PDF

TextShape allows you to add single-line text to a PDF document.

Example Of Single Line Text To Pdf

Document document = new Document();
Page page = new Page( PageSize.Letter );
document.Pages.Add(page);

// Create a text shape to draw text
TextShape textShape = new TextShape(50, 750, "Hello World!", new TallComponents.PDF.Fonts.Font(), 16);
            
// Add the text to the page
page.Overlay.Add(textShape);
Dim document As New Document()
Dim page As New Page(PageSize.Letter)
document.Pages.Add(page)

' Create a text shape to draw text
Dim textShape As New TextShape(50, 750, "Hello World!", New TallComponents.PDF.Fonts.Font(), 16)

' Add the text to the page
page.Overlay.Add(textShape)

Since it is inherited from Shape, TextShapes can be drawn onto all kinds of canvas such as Page.Overlay, Page.Underlay, Page.VisualOverlay and Page.VisualUnderlay. In addition, the location of all kinds of Shapes can only be set in constructor. After that, the only way to change the location is through transformation. The following statement shows how to move the TextShape to (30, 700):

textShape.Transform = new TallComponents.PDF.Transforms.TranslateTransform(30, 700);
textShape.Transform = New TallComponents.PDF.Transforms.TranslateTransform(30, 700)
Download PDFKit.NET 5.0
We will send you a download link

  • This field is for validation purposes and should be left unchanged.
Why do we ask your email address?
We send tips that speed up your evaluation
We let you know about bug fixes
You can always unsubscribe with one click
We never share your address with a 3rd party
Thank you for your download

We have sent an email with a download link.