Change the Font on just the specific Unicode characters while saving to PDF


The following screenshot compares the two output PDFs generated by the sample code below.

One is generated without setting PdfSaveOptions.IsFontSubstitutionCharGranularity property and the other was generated after setting the PdfSaveOptions.IsFontSubstitutionCharGranularity property to true.

As you can see in the first Pdf, the font of entire sentence has changed from Times New Roman to Arial Unicode MS because of Non-Breaking Hyphen. While in the second Pdf, only the font of Non-Breaking Hyphen has changed.

First Pdf File
Second Pdf File

Sample Code