Embedding Font in a PDF

We are using MBS PDF…

If we create a “very pretty” pdf, and it uses an obscure font: when a user opens it on their PC the font is substituted. As a result it does not look “very pretty”.

We produce the PDF form a .pages document. Then we use Xojo/MBS to fill in the data. How can we ensure the font is embedded!

The BLUE in this is Added programmatically.

Her is what we want: Pages loves Helvetica Neue. The PC genreally ignores it.

You could drop Helvetica Neue on the PC and tell DynaPDF to load it via AddFontSearchPath function.
And pass true for embed parameter on SetFont function.

We do not have access to the user PC. It could be anyone on the internet.

I should have stated its a PDF that is created in web (1.0) and delivered to thousands of users who we do not know.

I think Christian meant that you should put it on the server running your web application and tell DynaPDF to embed it when you call SetFont.

The SetFont method or SetFontAnsi in DynaPDFMBS has an ‘embed’ parameter.
set that to true and it should bundle the font.

call pdf.SetFontAnsi “Arial”, pdf.kfsNormal, 12 , true, pdf.kcp1252

Please don’t use Ansi functions. Don’t use pdf.kcp1252, but use pdf.kcpUnicode.

@Christian_Schmitz
Use what instead?

Instead of SetFontAnsi, please use SetFont function.

call pdf.SetFont “Arial”, pdf.kfsNormal, 12 , true, pdf.kcpUnicode

The difference is that the Ansi functions pass the strings ANSI encoded to DynaPDF. The regular functions use Unicode.

Also don’t use cp1252, but cpUnicode, which is also the default if you don’t specify it.