Unicode & UTF-8 Support

IronPDF provides native support for Unicode to be utilized to render a number of different languages in a PDF, as well as offering support for UTF-8 encoding to make the process of displaying modern letter-based languages on your PDF documents. It should be noted that in order to have this work, your machine must have Unicode fonts installed, which is often done automatically in Windows and Mac systems, but for Linux, fonts may need to be added manually.

This method is commonly used to render languages such as:

  • Hindi
  • Chinese (many variants)
  • Arabic
  • Japanese
  • Thai

5 Steps to IronPDF's Unicode and UTF-8 Support for PDFs

  • var html = @"your-string-here";
  • var renderer = new ChromePdfRenderer();
  • var pdfDocument = renderer.RenderHtmlAsPdf(html);
  • pdfDocument.SaveAs("Unicode.pdf");

The first step to exploring IronPDF's support for UTF-8 and Unicode is to create a new HTML string using your language of choice. This will be used to generate a PDF,document, which will properly render the characters provided. Then, we will create a new ChromePdfRenderer instance, which will give us access to the powerful rendering engine that IronPDF uses to handle its HTML to PDF conversions.

Next, we will use the RenderHtmlAsPdf method to convert our HTML string to PDF format. The resulting PDF document will be saved to the PdfDocument object we created in the same line. Finally, we save the new PDF document to the specified file location and name using the SaveAs method.

Through IronPDF's support of UTF-8 encoding and Unicode, displaying multiple languages on a single PDF document has never been so easy. By adding in a line such as <meta charset="UTF-8"> when rendering files or URLs ensures that this process works of those too.

Click here to view the How-to Guide, including examples, sample code, and files