majorsilence / My-FyiReporting

Majorsilence Reporting, .NET report designer and viewer. Fork of fyireporting,
Apache License 2.0
347 stars 201 forks source link

Output PDF has wrong fonts #138

Closed articx closed 6 years ago

articx commented 8 years ago

My report has Trebuchet MS and Arial, but when I open the exported PDF in Acrobat Reader all fonts are Arial or Arial Bold. I tried changing the font to Verdana but I got the same result.

I'm using this code to export from the RdlViewer: rdlViewer.SaveAs(filename, fyiReporting.RDL.OutputPresentationType.PDF);

I also tried using PDFOldStyle as OutputPresentationType, but it exported with Helvetica, and has some problems with images.

RdlDesigner version is 4.12 (downloaded from the wiki) and my packages from nuget are the same version, also I tried exporting a PDF from the Designer but the result is the same, I get Arial instead of Trebuchet MS. The rendered or preview version in RdlViewer and in the Designer looks fine. My Operating System is Windows 7, .Net Framework is 4.0.

majorsilence commented 8 years ago

https://github.com/majorsilence/My-FyiReporting/blob/master/RdlEngine/Render/RenderPdf.cs#L536

https://github.com/majorsilence/My-FyiReporting/blob/master/RdlEngine/Render/RenderPdf_iTextSharp.cs#L358

Those are the sections that will need to be modified

articx commented 8 years ago

Thanks for the quick reply. I decided to use Arial for now because I'm in a very tight schedule. :-/

I tried to build this project before but I couldn't (using Visual Studio 2015), maybe I will try to do it again when I have more time.

Thanks again for your hard work :-)

daniellor commented 8 years ago

Some time ago I've changed pdfshap's code to work with mono. I've written class to locate proper font and this may be implement in the pdf render class similar like this https://github.com/daniellor/PDFsharp/blob/86f6b9586df6dd2e3b91f9191e98654e8bcc12aa/src/PdfSharp/Fonts/FontLocalizator.cs

majorsilence commented 8 years ago

Would anyone be up to making that change and sending a pull request?

psoares33 commented 6 years ago

It's fixed now.