0

Generating a report in c# using a wonderful tool NReco.PdfGenerator (with PhantomJs as engine) bumped into an issue with arabic symbols. HTML layout is normally rendered in browser. But generating a PDF I got http://image.prntscr.com/image/73feca61ced346a094e2c652da4fea59.png

HTML has

Any ideas are welcomed

Lagoda Denis
  • 235
  • 5
  • 13

1 Answers1

0

First of all ensure that you have the following meta tag in your HTML <head> section:

<meta http-equiv="content-type" content="text/html; charset=utf-8" />
Vitaliy Fedorchenko
  • 8,447
  • 3
  • 37
  • 34
  • Yes - I have it for sure. If I remove this tag I have other non-arabic symbols. – Lagoda Denis Apr 11 '17 at 04:21
  • 1
    @AngryDev how do you provide content to the wrapper? Maybe Arabic characters are encoded incorrectly at the point when content is written to the file or smth like that? In general phantomjs is able to render non-English content and nothing special is needed. – Vitaliy Fedorchenko Apr 11 '17 at 04:54
  • BINGO: there was var htmlContent = Encoding.Default.GetString(data); that means ANSI encoding. Updated to var htmlContent = Encoding.UTF8.GetString(data); – Lagoda Denis Apr 11 '17 at 07:55