I am using PoDoFo library to generate a PDF document. All fonts except Base14 ones ("Courier", "Helvetica", "Times", "Symbol", "ZapfDingbats") are embedded. How to embed these 4 Base14 fonts?
Asked
Active
Viewed 512 times
1 Answers
0
By default the CreateFont()
function uses the EFontCreationFlags::eFontCreationFlags_AutoSelectBase14
attribute (so it doesn't have to be given).
PoDoFo::PdfDocument *pDocument;
...
pDocument->CreateFont("Times", false, false, false,
PoDoFo::PdfEncodingFactory::GlobalIdentityEncodingInstance(),
PoDoFo::PdfFontCache::eFontCreationFlags_AutoSelectBase14
);
This attribute makes the function automatically check if the font is a Base14 one, and if it is, then PoDoFo doesn't embed the font. Use the PdfFontCache::eFontCreationFlags_None flag to embed the font.
PoDoFo::PdfDocument *pDocument;
...
pDocument->CreateFont("Times", false, false, false,
PoDoFo::PdfEncodingFactory::GlobalIdentityEncodingInstance(),
PoDoFo::PdfFontCache::eFontCreationFlags_None
);

Olivier Pons
- 15,363
- 26
- 117
- 213

Victor.V
- 177
- 1
- 9