Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Embedding true type font in PDF report

edited July 2013 in General
Hi,

I am trying to embed a barcode font in my PDF report.

The font is 'Free 3 of 9 Regular' from
http://www.barcodesinc.com/free-barcode-font/

1) When I use the option :
ppReport1.PDFSettings.EmbedFontOptions := [efAllFonts];
then the font is embedded and displayed properly (even on a PC with that
font not installed).
In the properties/fonts of the PDF file, I see :
Fonts Used in this Document :
...
Free3of9(embedded)
Type=TrueType
Encoding=ANSI
Actual Font= Free3of9
Actual Font Type = TrueType
Disadvantage : the PDF is too big, it has grown from 17 KB to 1.13 MB.



2) So, instead of embedding all fonts, I tried to embed only this font:
ppReport1.PDFSettings.EmbedFontOptions:=[efFontList];
ppReport1.PDFSettings.EmbedFontList.Text:='Free3of9';
then the font is not embedded and the bar code is not displayed properly
(on a PC with that font not installed).
In the properties/fonts of the PDF file, I see :
Fonts Used in this Document :
...
Free3of9
Type=TrueType
Encoding=ANSI
Actual Font= Adobe Serif MM
Actual Font Type = Type 1

Any idea how I can embed this single font correctly ?
I also tried EmbedFontList.Text:='Free 3 of 9 Regular' (as displayed in
the Windows font list), same problem.

Using ReportBuilder Pro 14.08 / Delphi XE2

Thanks,

Herman Bernaerts

Comments

  • edited July 2013
    Hi Herman,

    When using the EmbedFontList, the entries are compared to the TFont.Name
    property. The best method to ensure you have the correct name is to add
    the font name directly in code.

    PDFSettings.EmbedFontList.Add(MyFont.Name);

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited July 2013
    Hi Nico,

    Thanks for the answer.

    In the meantime, I noticed on the forum that there is a ppBarCode
    component, I was not aware of it..
    I will try this, then I do not need to embed the font anymore.

    Regards
    Herman

    Op 25/07/2013 4:45, Nico Cizik (Digital Metaphors) schreef:
This discussion has been closed.