# Displaying Glyph Characters when Using PDFViewer

## Environment

<table>
 <tr>
  <td>Product</td>
  <td>Telerik UI for ASP.NET MVC PDFViewer</td>
 </tr>
 <tr>
  <td>Progress Telerik UI for ASP.NET MVC version</td>
  <td>Created with the 2023.2.718 version</td>
 </tr>
</table>

## Description

How can I load and display a PDF file that contains glyph characters in the Telerik UI for ASP.NET MVC PDFViewer?

## Solution

The PDF standard fonts cover only the basic ASCII character set. By design, if no alternate fonts are specified, [Kendo UI will bundle the DejaVu font family](https://docs.telerik.com/kendo-ui/framework/pdf/embedded-fonts#font-substitution). For this reason, if the PDF file contains glyph characters, they will not be rendered correctly when loading the file into the PDFViewer.

The following example showcases how to proceed when the PDF file contains Simplified Chinese characters.

1. Include the ['SimSun' font family](https://learn.microsoft.com/en-us/typography/font-list/simsun) by using the CSS `font-face` declaration.

   ```
       <style>
           @@font-face {
               font-family: 'SimSun';
                   src: url('/SimSun-01.ttf') format('truetype');
               }

           #example {
               font-family: 'SimSun'; // Use the SimSun font for displaying and embedding in the PDF file.
           }
       </style>
   ```

2. Specify the `Character Mapping files (CMap)` in the PDFViewer declaration, which are used in the PDF.js library to map the 'SimSun' characters to their corresponding Unicode code points. Use the [`CMapUrl()`](https://docs.telerik.com/aspnet-mvc/api/kendo.mvc.ui.fluent/pdfviewerpdfjsprocessingfilesettingsbuilder#cmapurlsystemstring) and [`CMapPacked()`](https://docs.telerik.com/aspnet-mvc/api/kendo.mvc.ui.fluent/pdfviewerpdfjsprocessingfilesettingsbuilder#cmappackedsystemboolean) opions.

   ```Razor HtmlHelper
       <script src="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.2.2/pdf.js"></script>
       <script>
           window.pdfjsLib.GlobalWorkerOptions.workerSrc = 'https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.2.2/pdf.worker.js';
       </script>

       <div id="example">
           @(Html.Kendo().PDFViewer()
               .Name("pdfviewer")
               .PdfjsProcessing(pdf => pdf
                   .File(c => c
                       .CMapUrl("https://cdn.jsdelivr.net/npm/pdfjs-dist@2.2.228/cmaps/")
                       .CMapPacked(true)
                       .Url(Url.Content("~/Example.pdf"))
                   )
               )
               .Height(1200)
           )
       </div>
   ```

## More ASP.NET MVC PDFViewer Resources

* [ASP.NET MVC PDFViewer Documentation](https://www.telerik.com/aspnet-mvc/documentation/html-helpers/pdf/pdfviewer/overview)

* [ASP.NET MVC PDFViewer Demos](https://demos.telerik.com/aspnet-mvc/pdfviewer/index)

* [ASP.NET MVC PDFViewer Product Page](https://www.telerik.com/aspnet-mvc/pdf-viewer)

* [Telerik UI for ASP.NET MVC Video Onboarding Course (Free for trial users and license holders)](https://www.telerik.com/aspnet-mvc/documentation/getting-started/video-onboarding)

* [Telerik UI for ASP.NET MVC Forums](https://www.telerik.com/forums/aspnet-mvc)

## See Also

* [Client-Side API Reference of the PDFViewer for ASP.NET MVC](https://docs.telerik.com/kendo-ui/api/ui/pdfviewer)
* [Server-Side API Reference of the PDFViewer for ASP.NET MVC](https://docs.telerik.com/aspnet-mvc/api/pdfviewer)
* [Telerik UI for ASP.NET MVC Breaking Changes](https://www.telerik.com/aspnet-mvc/documentation/backwards-compatibility/2023-backwards-compatibility)
* [Telerik UI for ASP.NET MVC Knowledge Base](https://docs.telerik.com/aspnet-mvc/knowledge-base)
