0

I'm having problems with generating a PDF with Chinese chars in it. I download the html as a string from "pageurl" and I use NRECO.Pdfgenerator to generate bytes for pdf from it.

On the pdf, I can see latin characters correctly but not chinese ones. I assume it's an encoding problem but i cannot seem to understand where the mistake is. Heres the code i'm using:

    WebClient client = new WebClient();
    string htmlstring = client.DownloadString(PageUrl);

    //Nreco
    HtmlToPdfConverter converter = new HtmlToPdfConverter();

    converter.CustomWkHtmlArgs = "--encoding UTF-8";
    converter.GeneratePdf(htmlstring);

    byte[] result = converter.GeneratePdf(htmlstring);

    Response.Clear();
    Response.ContentType = "application/pdf";
    Response.BinaryWrite(result);
    Response.Flush();
Filburt
  • 17,626
  • 12
  • 64
  • 115
Matteo Devi
  • 103
  • 4

2 Answers2

0

you can use itextPdf! Look at this posts: How to display chinese characters in pdf file created with iTextSharp

http://itextpdf.com/examples/iia.php?id=201

Community
  • 1
  • 1
Paolo Zaia
  • 218
  • 3
  • 14
0

You can use pdfclown which is free and can write almost all languages in pdf

You can download it here

You can use any type of font which supports unicode characters