Export to PDF fails for some fonts

Posted by: marcelovetter on 14 September 2017, 10:01 am EST

    • Post Options:
    • Link

    Posted 14 September 2017, 10:01 am EST

    [activereports_archive]

    We are using AR 8 Reports and save them as a PDF. It works fine unless we use some special fonts:Univers LT 45 Light, Univers LT 55, Univers LT 65 Bold

    We were able to identify that it’s a problem when the fonts are embedded into the PDF. Using the same fonts on the same machine with Microsoft Word and exporting a PDF with embedded fonts works fine. So I think it can’t be a font licensing problem. (Our license.licx is also including all the required components, so it’s neither a AR licensing issue).

    Export just works when we exclude those fonts from embedding (.NeverEmbedFonts += “;Univers LT 45 Light;Univers LT 55;Univers LT 65 Bold;”

    When we export a Report to PDF using Export.Pdf.Section.PdfExport we get the following exception and the file being exported is not removed but (obviously) corrupt.

    System.InvalidOperationException occurred

    HResult=-2146233079

    Message=Failed to read font data

    Source=GrapeCity.ActiveReports.Export.Pdf.v8

    StackTrace:

    bei #lSr.#TGn.#UGn(#4Dn tableId, Int32 offset, Int32 len)

    bei #mqc.#rrc.#zRn(String newFontName, IList

    1 charList, #QGn reader, IDictionary
    2 glyphMap)

    bei #mqc.#Vqc.#U.#Yqc.#nxd(#VOn font, String newFontName, IList
    1 charList, IDictionary
    2 glyphMap)

    bei #mqc.#Vqc.#U.#0qc.#Hvd(#Yqc fmgr)

    bei #mqc.#Vqc.#ivd()

    bei DataDynamics.DDLib.PdfEngine.PsPages.Write(#8qc root, #erc writer, #Cqc documentOptions, Int32 headerOffset)

    bei #mqc.#8qc.#7Zc(Stream stream, #1rc securityInfo)

    bei #mqc.#8qc.#7Zc(Stream stream)

    bei GrapeCity.ActiveReports.Export.Pdf.Section.PdfExport.#7pk(SectionDocument document, Stream stream, String pageRange, Byte& xmpMetadata)

    bei GrapeCity.ActiveReports.Export.Pdf.Section.PdfExport.Export(SectionDocument document, Stream stream, String pageRange)

    bei GrapeCity.ActiveReports.Export.Pdf.Section.PdfExport.Export(SectionDocument document, String filePath, String pageRange)

    bei GrapeCity.ActiveReports.Export.Pdf.Section.PdfExport.Export(SectionDocument document, String filePath)

    bei BW2Technologies.BusinessSuite.Reports.ActiveReport.Reports.ReportBase.SaveAs(String FileName, ReportSaveType Type) in C:\BW2_45\bw2client\BW2BusinessSuite\BusinessSuite\Reports\ActiveReports\Reports\ReportBase.vb:Zeile 2894.

    InnerException:

    [/activereports_archive]

  • Posted 14 September 2017, 10:01 am EST

    [activereports_archive]Here are the fonts again in a zip… hope it works now…[/activereports_archive]

    2015/08/fonts.zip

  • Posted 14 September 2017, 10:01 am EST

    [activereports_archive]Hello,

    We were unable to replicate the issue mentioned by you. We installed the fonts mentioned by you and exported the report to PDF via designer as well as via code and faced no exception at our end.

    We tested the issue with the latest drop of AR8 :

    8.3.634.0

    Attached is the sample and the resultant PDF file for your reference.

    Could you please confirm the version of AR that you are working with.

    Regards,

    Mohita

    [/activereports_archive]

    2015/08/FontIssue.zip

    2015/08/r.pdf

  • Posted 14 September 2017, 10:01 am EST

    [activereports_archive]I tried your sample and indeed, it works also with 8.0.133. I tried out code with version 8.3.634 with same error.

    Now I modified my code to save the report document as .rdf and load it in your sample app.

    I attached the .rdf file. Although it is a very simple document (only first page) it crashed during export. Could you please test on your side and tell me what to do?

    [/activereports_archive]

    2015/08/Font-Issue2.zip

  • Posted 14 September 2017, 10:01 am EST

    [activereports_archive]Have you been able to reproduce the effect with the project “Font-Issue2” above?

    BTW: the r.rdf is included in the archived project as well…

    [/activereports_archive]

  • Posted 14 September 2017, 10:01 am EST

    [activereports_archive]Hello… Is there anyone to answer this issue…? We have customers that need a solution…

    [/activereports_archive]

  • Posted 14 September 2017, 10:01 am EST

    [activereports_archive]Hello,

    First of all accept my sincere apologies for the delay in response. The thread somehow got lost in the loop.

    I could replicate the issue mentioned by you with the rdf shared by you and the issue seems to be specific to this rdf file.

    I tried creating the rdf file of my report and then loaded and exported the same using the code shared by you and was unable to replicate the issue at my end. Please refer to the attached avi and the modified sample.

    Hence request you to try creating a new report and see if you still face the issue with it. Also, you are requested to share with us your report file and we would test the behavior with the same and would escalate it if required.

    Attached are also the rdf and the pdf files for your reference.

    Regards,

    Mohita[/activereports_archive]

    2015/09/FontIssue_modified.zip

    2015/09/FontsIssue.zip

    2015/09/RdfPDF.zip

  • Posted 14 September 2017, 10:01 am EST

    [activereports_archive]I could isolate the problem to the following: Exporting works, if no white-space character is exported. E.g. your example contains only Textboxes with default text “Textbox1”. If you change the text (as in the example attached to this post) to something containing spaces, the export with the font “Univers LT 45 Light” doesn’t work any more.

    Please urgently forward that issue to the developers. We really need a solution for that.[/activereports_archive]

    2015/09/FontIssue3.zip

  • Posted 14 September 2017, 10:01 am EST

    [activereports_archive]Thanks Mohita,

    but the workaround is not a solution, since end customers will receive a pdf by email that will not satisfy the corporate identity of our client…

    Can you tell me until when we will have a bug fix?

    Kind regards[/activereports_archive]

  • Posted 14 September 2017, 10:01 am EST

    [activereports_archive]Hello Mohita. Could I please get a reply on my request. It’s urgent for us to get a solution… So please forward our request to the responsable team. Thanks.

    Regards, Marcelo[/activereports_archive]

  • Posted 14 September 2017, 10:01 am EST

    [activereports_archive]Hello,

    Thank you for sharing the sample application with us. And apologies for the delay in response.

    I could replicate the issue mentioned by you. Hence, I am escalating the issue to the concerned team (tracking id : 185759) and I would get back to you as soon I hear anything from them.

    Regards,

    Mohita[/activereports_archive]

  • Posted 14 September 2017, 10:01 am EST

    [activereports_archive]Hello,

    We have heard from the development team and as per them there is bug in font reading algorithm.

    Hence the suggested workaround is not to embed this font:

    Dim r As New GrapeCity.ActiveReports.Export.Pdf.Section.PdfExport

    r.NeverEmbedFonts = “Univers LT 45 Light”

    Regards[/activereports_archive]

  • Posted 14 September 2017, 10:01 am EST

    [activereports_archive]Hello,

    I have forwarded your comments to the concerned team and would get back to you as soon i hear anything from them.

    Regards,

    Mohita[/activereports_archive]

  • Posted 14 September 2017, 10:01 am EST

    [activereports_archive]Hello,

    We have received an update and since AR8 is no more in active development mode, the fix have been incorporated in AR9 and the same would be available in one of the later releases of AR9.

    Thanks and Regards,

    Mohita[/activereports_archive]

  • Posted 14 September 2017, 10:01 am EST

    [activereports_archive]We are seeing issues with Univers and FSMe fonts. Please confirm if AR10 has this fix? [/activereports_archive]

  • Posted 14 September 2017, 10:01 am EST

    [activereports_archive]Can you confirm the exact version of ActiveReports you’re using? This issue was fixed in AR9 SP4, hence is fixed in AR10 as well. Please download the latest version of AR10 and check. The latest version i.e AR10 SP3 can be downloaded from the following link - http://cdn.grapecity.com/ActiveReports/ar10/ActiveReports-v10.3.9175.0.msi

    [/activereports_archive]

  • Posted 14 September 2017, 10:01 am EST

    [activereports_archive]We are using AR10 VERSION 10.0.5602.0.[/activereports_archive]

  • Posted 14 September 2017, 10:01 am EST

    [activereports_archive]I tried using the fonts Univers LT 45 Light and Univers LT65 Bold font with AR10 SP3 (10.3.9175.0) and the text appears fine in the exported pdf file. I have attached the sample application and the exported pdf file for your reference. Would suggest you to try with AR10 SP3 at your end as well.[/activereports_archive]

    2017/02/AR11_Win_UniversFont.zip

  • Posted 14 September 2017, 10:01 am EST

    [activereports_archive]We upgraded to AR11 and tried this. It is not working for both Univers and FS. Attached please find those fonts for your reference. You can try with multiple words instead of single word for text. This is really critical for our project.[/activereports_archive]

    2017/02/Fonts.zip

  • Posted 14 September 2017, 10:01 am EST

    [activereports_archive]I’m sorry, I still don’t see any issue with the Univers and FS fonts. I have attached screen shots of the output I see at my end. Please check. It’ll be helpful if you could send across your application and screen shots of the output you’re seeing at your end.

    Thanks[/activereports_archive]

  • Posted 14 September 2017, 10:01 am EST

    [activereports_archive]I could reproduce this with one of the sample code that you used/sent earlier. Attached please find the error screen shot and also the code.[/activereports_archive]

    2017/02/SectionReport_SubReport_MultipleColumns.zip

  • Posted 14 September 2017, 10:01 am EST

    [activereports_archive]Forgot to mention that please click on Export to PDF. Issue mainly exporting PDF ( pdfExport.Export(…)[/activereports_archive]

  • Posted 14 September 2017, 10:01 am EST

    [activereports_archive]Thanks for the clarification. I could reproduce the error on exporting the report to Pdf. Let me get in touch with the concerned team regarding this and will update you. Tracking id - 228627[/activereports_archive]

  • Posted 14 September 2017, 10:01 am EST

    [activereports_archive]Font issue is very crucial for my client and this is show a stopper item. Please escalate this issue and let me know how soon this gets resolved/addressed?[/activereports_archive]

  • Posted 14 September 2017, 10:01 am EST

    [activereports_archive]I have escalated it with high priority and will update you as soon as I have any information on this.[/activereports_archive]

  • Posted 14 September 2017, 10:01 am EST

    [activereports_archive]Unfortunately, open type fonts are not supported in ActiveReports. It supports only True type fonts. For preview in Win Viewer ActiveReports uses GDI+ for rendering and its substitution algorithm which substitutes the glyphs that are not found with glyphs from other fonts. So to export the report to Pdf without crashing, you can use the NeverEmbedFonts property of PdfExport and specify the fonts so that it doesn’t try to embed those fonts in pdf and crash.

    [csharp] PdfExport pdfExport = new PdfExport();

    pdfExport.NeverEmbedFonts = “FS Me Heavy”;[/csharp]

    Sorry for the inconvenience[/activereports_archive]

  • Posted 14 September 2017, 10:01 am EST

    [activereports_archive]Disappointed. Now we have to look for other options/approaches to make it work as this is one of the critical requirement for our client. Please let me know if this feature gets added to your product in near future. [/activereports_archive]

  • Posted 14 September 2017, 10:01 am EST

    [activereports_archive]Sorry for not being able to meet your requirement. Will surely let you know if support for OpenType fonts is added in future.[/activereports_archive]

  • Posted 9 November 2019, 4:34 am EST

    Hi,

    Are open type fonts still not supported in Activereports 13?

  • Posted 10 November 2019, 8:21 pm EST

    Hello,

    Sorry to mention that open type font is not supported in ActiveReports 13.

    Thanks,

    Mohit

  • Posted 26 August 2021, 12:05 am EST

    Hi

    Is there a solution for this yet?

    I have an imbedded fonts in my VB.Net app (Gotham.ttf). Everything works fine until PDFEx.Export(…), then the app crash. I am using section report and AR 12.2.13986.0

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels