WRONG Persian Character in FAST REPORT

I have problem using FastReport in .net core web api. When export to pdf from this code:
Report fastReport = new Report();
  fastReport.Report.Load($"Report/{installmentReports.ReportName}.frx");

  fastReport.Prepare();
  PDFExport export = new PDFExport();

  using (MemoryStream ms = new MemoryStream())
  {
    export.Export(fastReport, ms);
    ms.Flush();
    return File(ms.ToArray(), "application/pdf", Path.GetFileNameWithoutExtension("test") + ".pdf");
  }

PERSIAN CHARACTER is not show normally!

Normal Report from designer preview:

Comments

  • edited 6:00AM
    dotnet core has a problem with unicode font. i solved this problem with running another webapi (classic dotnet framework) on IIS or windows service (self-hosted webapi)

    from webapi core:
            [HttpGet("Pdf")]
            public async Task<IActionResult> Pdf(string file, string label)
            {
                string page = string.Concat("http://localhost/classic/pdf/", file, "/", label);
                string fileName = string.Concat(Encoding.UTF8.GetString(Convert.FromBase64String(label)), ".pdf");
                using (HttpClient client = _httpClientFactory.CreateClient())
                {
                    byte[] result = await client.GetByteArrayAsync(page);
                    return new FileContentResult(result, "application/pdf") { FileDownloadName = fileName };
                }
            }
    
  • ipong wrote: »
    dotnet core has a problem with unicode font. i solved this problem with running another webapi (classic dotnet framework) on IIS or windows service (self-hosted webapi)

    from webapi core:
            [HttpGet("Pdf")]
            public async Task<IActionResult> Pdf(string file, string label)
            {
                string page = string.Concat("http://localhost/classic/pdf/", file, "/", label);
                string fileName = string.Concat(Encoding.UTF8.GetString(Convert.FromBase64String(label)), ".pdf");
                using (HttpClient client = _httpClientFactory.CreateClient())
                {
                    byte[] result = await client.GetByteArrayAsync(page);
                    return new FileContentResult(result, "application/pdf") { FileDownloadName = fileName };
                }
            }
    

    Thanks, but i used this solution before, you said RIGHT! so do you have any other idea?

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.