Domino To PDF - How To Control Font Embedding With DominoPDF

When creating PDF files from your Notes / Domino content it's important to consider how to include fonts as it affects both the size and appearance of the final PDF document.

If a font is not embedded in a PDF file and the user who opens a file does not have access to the original font, the PDF reader will temporarily substitute the font with a serif or san serif typeface.

With the font metrics included in the PDF, the fonts are stretched or condensed to ensure no reflow, but this could make the document look different than intended, particularly with unconventional or script face fonts.

Embedding Fonts

By default, when DominoPDF creates a PDF document it automatically embeds fonts into the document and typically in 90% of cases this is always the best approach for the following reasons.

- the PDF is being used for proofing (appearance, not text)

- the PDF contains text, such as part of a logo, that must be a certain font

- the fonts are decorative, graphical, or symbol-based (such as Dingbats)

- the PDF needs to be used as a substitute for the original document

- the PDF is being sent to a third-party for final output

Not Embedding Fonts

The above points are all valid reasons for embedding fonts in a PDF document, however there may be times when you don't want to embed all or specific fonts.

- the size of the PDF needs to be kept to a minimum; embedded fonts don't add too much overhead, however many embedded fonts can quickly add up in size

- only the Base 14 fonts are used in the PDF primarily intended for screen viewing, so no additional fonts are needed

- the font is an unconventional, script face or custom font and does not embed correctly

Domino to PDF - Controlling Font Embedding With DominoPDF

By default when creating PDF files DominoPDF embeds any used fonts into the PDF. DominoPDF it takes it from the source document/machine when creating the pdf. once embedded anyone can see it ok even if they don't have the font

To specify whether all or specific fonts should NOT be embedded in the PDF file DominoPDF provides the NoEmbedFonts setting.

NoEmbedFonts allows a list of font names to be specified which will not be embedded in the PDF.

The fonts will still display correctly when the PDF is viewed, however the font must exist on the appropriate machine or a substitution will be made.

Multiple font names are separated with an asterisk (*).

For example; NoEmbedFonts=Arial*Times New Roman

If no fonts at all are to be embedded in the PDF file the value "ALL" can be passed to the setting.

For example; NoEmbedFonts=ALL

Sample Code

Option Public

Declare Function DoPDF Lib "DOMINOPDF.DLL" (Byval szInput As String,
 Byval szOutput As String, Byval szOptions As String) As Long

Sub Initialize	
	Dim oSession As New NotesSession
	Dim oDB As NotesDatabase
	Dim sOptions As String
	
	Set oDB = oSession.CurrentDatabase
	
	sOptions = "Database=" & oDB.FileName & ";"
	sOptions = sOptions & "AutoLaunch=True;"
	sOptions = sOptions & "LeftMargin=10;"
	sOptions = sOptions & "RightMargin=10;"
	sOptions = sOptions & "TopMargin=10;"
	sOptions = sOptions & "BottomMargin=10;"
	sOptions = sOptions & "PageSize=Letter;"
	sOptions = sOptions & "Orientation=Portrait;"
	sOptions = sOptions & "HTMLHeader=oDB.Title;"
	sOptions = sOptions & "HTMLFooter=Page {$PAGE} of {$PAGECOUNT};"
	sOptions = sOptions & "ForceSectionExpand=True;"
	sOptions = sOptions & "ForceOutlineExpand=True;"
	sOptions = sOptions & "RowAtATimeTableAlt=True;"	

	sOptions = sOptions & "NoEmbedFonts=Arial*Times New Roman*Verdana;"
	
	Call DoPDF(|Select Form = "Memo"|, "memo.pdf", sOptions)	
End Sub

JoomShaper