PdfReport with different Fonts

Posted by: m.lindinger on 27 April 2020, 9:02 pm EST

  • Posted 27 April 2020, 9:02 pm EST

    Hi,

    we create C1PrintDocuments and add them to a C1MultiDocument. Then, we export the C1MultiDocument as a PDF to disk.

    After migrating to Windows10, we observe a strange behaviour. The exported PDF contains pages with different fonts altough we define the same font (name and size) for each C1PrintDocument.

    The behaviour can not be reproduced deterministically. This means, one time the font differs on page 1 and page 3, an other time the font differs only on page 2. And sometimes the font do not differ at all.

    Here is how we create the C1PrintDocument

    C1PrintDocument.UsePrinterForDefaultPageSettings = False

    Dim doc As C1PrintDocument = New C1PrintDocument()
    doc.CreationDpi = dpi
    doc.FontHandling = FontHandling.EmbedFonts
    doc.Style.Font = New Font("Courier New", 9, GraphicsUnit.Point)
    doc.PageLayouts.Default.PageSettings.PaperKind = PaperKind.A4
    doc.PageLayouts.Default.PageSettings.TopMargin = New Unit(0.5, UnitTypeEnum.Cm)
    doc.PageLayouts.Default.PageSettings.BottomMargin = New Unit(1, UnitTypeEnum.Cm)
    doc.PageLayouts.Default.PageSettings.LeftMargin = New Unit(2, UnitTypeEnum.Cm)
    doc.PageLayouts.Default.PageSettings.RightMargin = New Unit(1.3, UnitTypeEnum.Cm)

    Dim cr As RenderText = New RenderText()
    ...
    doc.PageLayouts.Default.Overlay = cr

    Return doc



    Used OS:
    Windows 10
    * version 1709
    * version 1809

    Used ComponentOne:
    * 4.0.20192.697 (Control Library)
    * 4.0.20201.416 (Report Library)
  • Replied 28 April 2020, 2:07 am EST

    Additional Information:

    I found out that some fonts are missing in the exported PDF file altough they are added as embeddedfont in the C1PrintDocuments (FontHandling.EmbedFonts).

    We use the following fonts:

    • Arial

    • Arial Narrow

    • Courier New

    • Courier New, Bold



    It is not deterministic which and how many fonts are missing.

  • Marked as Answer

    Replied 30 April 2020, 4:25 am EST

    Hello,

    I am unable to replicate the issue at my end. COuld you please modify the attached sample and give back to me so that I can able to replicate the issue at my end and assist you accordingly.

    Thanks,
    Mohit

    MultiDocument_PDF.zip
  • Replied 5 May 2020, 3:27 am EST

    Hello Mohit,

    I added a test project with a test class MultiDocumentsTest.

    It generates and exports a higher amount of C1MultiDocuments containing one C1PrintDocument. Each C1PrintDocument consists of RenderTexts and RenderTables. The texts are styled with different fonts.

    Strange is:
    If I copy the test into your application and start it, all pdf look fine. But as soon as I execute the test itself, fonts are missing in some of the exported pdfs.

    Thanks
    Michael

    MultiDocument_PDF.zip
  • Replied 6 May 2020, 11:52 pm EST

    Hello,

    I am able to reproduce the issue at my end. I have escalated the issue to our development team (434479) and will inform you once I get any information from them.

    Thanks,
    Mohit
  • Replied 5 May 2020, 10:57 pm EST

    Hello Mohit,

    thanks for escalating to your development team.
    I hope there will be a fix soon because my customer sends those PDFs to its own customers and therefore requires a universal style for all the PDFs

    Thanks
    Michael
  • Replied 18 May 2020, 6:50 pm EST

    Hello Mohit,

    did you receive any feedback from your developer team so far?
    It is pretty urgent since we want to release within the next month and the non working report generation is a deal-breaker.

    Best regards
    Michael
  • Replied 22 May 2020, 3:48 am EST

    Hello,

    We are very sorry for the inconvenience caused to you. Issue is still with our development team and will inform you once I get any update from them.

    Thanks,
    Mohit
Need extra support?

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

Learn More

Forum Channels