Examples

Using Character Shaping in PDF (.NET Core/Framework)

Using Character Shaping in PDF using DynamicPDF Generator is simple and easy. Character Shaping or Complex Text Layout (CTL) is the selection of the required shape of a character based on that character’s position within a word and its surrounding characters.

How to use Character Shaping in PDF in C#

Below are the steps and sample code illustrating using Character Shaping in a PDF document using DynamicPDF Core Suite.

Steps for Using Character Shaping in a PDF Document

  1. Create a Document object.
  2. Create a Page object and add it to the Document instance.
  3. Create a OpenTypeFont object and provide the font file name with complete path in the constructor.
  4. Create a TextArea object and assign the font.
  5. Add the TextArea page element to the Page object.
  6. Save the PDF document.

Sample Code - C#

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

OpenTypeFont charShapingFont = new OpenTypeFont("MyFont.ttf", true); // path to .ttf or .otf file
TextArea area = new TextArea("Text requiring character shaping", 0, 0, 300, 30, charShapingFont, 18);
page.Elements.Add(area);

document.Draw(@"C:\Output.pdf");        

Over 75 Page Elements

DynamicPDF Core Suite contains over 75 page elements you can use to add rich content to the PDFs you create. DynamicPDF Core suite includes elements for:

  • Images,
  • Text Objects (TextArea and Label),
  • HTML,
  • Barcodes (47 types),
  • Form Fields,
  • and Charts.

Getting Started

NuGet Package

DynamicPDF Core Suite is available on NuGet and is part of the ceTe.DynamicPDF.CoreSuite.NET package. The easiest way to install is through the Visual Studio Package Manager, but you can also download directly if preferred.

NuGet Package ID: ceTe.DynamicPDF.CoreSuite.NET

DynamicPDF Core Suite Information

More information can be found at the DynamicPDF Core Suite website.

Available on Other Platforms

DynamicPDF Core Suite is also available for the following platforms. Refer to the respective product pages for more details.

Why Choose DynamicPDF?

  • Transparent Pricing
  • Lots of Features
  • Easy to Use
  • Great Support
  • Efficient Performance
  • Product Maturity (Over 18 Years)
  • Free Evaluation
  • .NET Core Support (Most Products)
  • Flexible Licensing

We’re Not The Only Ones That Think We’re Great!