Add Text to a PDF file

Adding Text while creating PDF File

To add text to an existing PDF file:

  1. Create a Document object.
  2. Add Page to Pages Collection of created Document.
  3. Create a TextFragment object and Add it to the page.
  4. Save the Document.

Adding Text

The following code snippet shows you how to add text in a PDF file.

Adding Underline Text

The following code snippet shows you how to add Underline text while creating a new PDF file.

Add Text using TextBuilder

The following code snippet shows you how to add text in PDF document using TextBuilder class.

Align Paragraphs

Following code snippet shows you, how to set alignment of text paragraphs inside PDF document.