Embedding fonts in pdf?

Dear experts,

Is it possible to tell TPDF to embed all fonts into a PDF file? I’d like to be able to get all fonts embedded into the resulting file when I do a TCanvas::Print(“blah.pdf”). I don’t see anything resembling font embedding in the code. Did I miss something?

Thanks,
Jeroen

Nothing like that is provided right now. The available fonts are listed in TPDF::FontEncode(). What do you have in mind exactly ?

Hi Olivier,

You’re fast :wink:

The listed fonts are the base14 fonts, yes. I’ve got nothing special in mind, just wanted to have these fonts embedded into the PDF files if possible. I think I can embed them with gs but I’m not sure if that leaves the rest of the PDF untouched.

Jeroen

I am afraid I do not know how to do that … :frowning:

Found it (Google is my friend):

gs -dSAFER -dNOPLATFONTS -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sPAPERSIZE=letter -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -dCompatibilityLevel=1.4 -dMaxSubsetPct=100 -dSubsetFonts=true -dEmbedAllFonts=true -sOutputFile=new.pdf original.pdf

It looks like this mucks up some of the PDF keywords (title, creator) and somehow the new file is smaller than the original, but otherwise things look fine.

Jeroen

Yes… I understand gs can do that. But I have no idea how to code it in TPDF … that is what I meant.