Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

DynaPDF.Parser.SetAltFont

Sets the alternative font.

Component Version macOS Windows Linux Server iOS SDK
DynaPDF 14.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "DynaPDF.Parser.SetAltFont"; PDF; Name { ; Style; Size; Embed; CodePage } )   More

Parameters

Parameter Description Example Flags
PDF The PDF reference. $pdf
Name Font name for new font to set or empty text to deactivate current font. "Arial"
Style Font style value.
Can be a combination of values 1 for italic, 2 for bold, 4 for underlined and 8 for striked.
With version 12.0 or newer, this can be passed as text.
3 Optional
Size Font size in points. 12 Optional
Embed Whether to embed font in PDF.
Can be 1 to embed or 0 to not embed.

Default is 1.
1 Optional
CodePage The code page to use.
Code page can be 1250, 1251, 1252, 1253, 1254, 1255, 1256, 1257, 1258, 8859-2, 8859-3, 8859-4, 8859-5, 8859-6, 8859-7, 8859-8, 8859-9, 8859-10, 8859-13, 8859-14, 8859-15, 8859-16, Symbol, 437, 737, 775, 850, 852, 855, 857, 860, 861, 862, 863, 864, 865, 866, 869, 874, Unicode.
Default is unicode since v12.3, but was 1252 for Windows ANSI before.
"Unicode" Optional

Result

Returns OK or error.

Description

Sets the alternative font.
Sets the font as alternate font that is used by DynaPDF.Parser.ReplaceSelText if the original font is not available.

Although the parameter Size must be greater zero, the value is in fact not used when replacing text. The parameter is reserved for future use.
Please note that the replacement text must be defined in the code page with which the font was loaded.

To effiently change the font whenever needed, call DynaPDF.Parser.ChangeAltFont. It is also possible to call DynaPDF.Parser.SetAltFont but this would require more processing time.

If the function succeeds the return value is the font handle, a value greater of equal zero. If the function fails the return value is 0.

Examples

Set alternative font:

Set Variable [ $r ; Value: MBS( "DynaPDF.Parser.SetAltFont"; $pdf; "Helvetica"; 0; 12) ]

See also

Release notes

Example Databases

Blog Entries

This function checks for a license.

Created 23th November 2023, last changed 23th November 2023


DynaPDF.Parser.SelectionText - DynaPDF.Parser.TextMatrix