P.K.
P.K.

Reputation: 1772

Does MigraDoc support national characters/ unicode characters?

I’m using MigraDoc for generating PDF documents. It works very well but I have 2 problems:

  1. I cannot add Polish characters (especially ł) to text like.
  2. I cannot add pound character (₤) to text.

I tried to change font, but no result.

Upvotes: 4

Views: 3967

Answers (1)

P.K.
P.K.

Reputation: 1772

I solved this on my own:)

Using Unicode fonts can be set in 2 ways:

1) by PdfDocumentRenderer constructor:

PdfDocumentRenderer pdfRenderer = new PdfDocumentRenderer(true, PdfFontEmbedding.Always);

2) by options;

PdfDocument document = new PdfDocument();

    XPdfFontOptions options = new XPdfFontOptions(PdfFontEncoding.Unicode, PdfFontEmbedding.Always);

Additional example here: http://www.pdfsharp.net/wiki/Unicode-sample.ashx

Upvotes: 7

Related Questions