Platforms to show: All Mac Windows Linux Cross-Platform

Back to DynaPDFMBS class.

DynaPDFMBS.EnumDocFont(Font as DynaPDFFontMBS, FontInfo as DynaPDFFontInfoMBS, Type as Integer, BaseFont as string, Fontname as string, Embedded as boolean, IsFormFont as boolean, Flags as Integer, FontRef as Integer) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
event DynaPDF MBS DynaPDF Plugin 8.0 ✅ Yes ✅ Yes ✅ Yes ❌ No
The event being called if you use the EnumDocFonts function.

Font is deprecated. FontRef is the internal reference to the font.
FontInfo is the new property to use for font details.

DynaPDFMBS.EnumHostFont(FamilyName as string, PostScriptName as string, Style as Integer) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
event DynaPDF MBS DynaPDF Plugin 8.0 ✅ Yes ✅ Yes ✅ Yes ❌ No
The event called by EnumHostFonts.

Some examples using this event:

DynaPDFMBS.EnumHostFontEx(FamilyName as string, PostScriptName as string, Style as Integer, BaseType as Integer, Embeddable as boolean, Flags as Integer, FilePath as string) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
event DynaPDF MBS DynaPDF Plugin 8.0 ✅ Yes ✅ Yes ✅ Yes ❌ No
The event called by EnumHostFontsEx.

Some examples using this event:

DynaPDFMBS.Error(ErrorCode as Integer, ErrorMessage as string, ErrorType as Integer) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
event DynaPDF MBS DynaPDF Plugin 8.0 ✅ Yes ✅ Yes ✅ Yes ❌ No
The error callback.

ErrCode is a positive error number starting at zero; it is an index into the array of error messages. ErrType is a bitmask to determine what kind of error occurred. The following
constants are defined:

const E_WARNING = &h02000000
const E_SYNTAX_ERROR = &h04000000
const E_VALUE_ERROR = &h08000000
const E_FONT_ERROR = &h10000000
const E_FATAL_ERROR = &h20000000
const E_FILE_ERROR = &h40000000

At time of publication only one flag is set at any one time. Future versions may be set multiple flags, e.g. E_SYNTAX_ERROR and E_WARNING. Because of this, it is recommended to mask out the error type with a bitwise and operator.
If the callback function returns a value other than zero (0), processing stops immediately.

You can return kErrorEventRaise (-2), we raise an exception.
We also raise the exception when no Error event is implemented.

DynaPDFMBS.InitProgress(ProgType as Integer, MaxCount as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
event DynaPDF MBS DynaPDF Plugin 8.0 ✅ Yes ✅ Yes ✅ Yes ❌ No
Called when a progress ist starting.

The return value of the progress callback function must be 0, any other return value breaks processing.

See pt* constants for ProgType.

Some examples using this event:

DynaPDFMBS.NextPage(g as graphics)

Type Topic Plugin Version macOS Windows Linux iOS Targets
event DynaPDF MBS DynaPDF Plugin 8.0 ✅ Yes ✅ Yes ✅ Yes ❌ No
The event called for graphics.nextpage method.

If you don't implement this event, the plugin will end the page and append a new page.
You can implement this event to do your own code to import e.g. an existing page as background.

Some examples using this event:

DynaPDFMBS.OnFontNotFound(PDFFontRef as Integer, FontName as string, Style as Integer, StdFontIndex as Integer, IsSymbolFont as boolean) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
event DynaPDF MBS DynaPDF Plugin 8.0 ✅ Yes ✅ Yes ✅ Yes ❌ No
The events called when a font is not found.

Please call one of the ReplaceFont functions here and return their return code from the callback.
Or return -1 if your code has an error.

Some examples using this event:

See also OnFontNotFound function in DynaPDF manual.

DynaPDFMBS.OnReplaceICCProfile(Type as Integer, ColorSpace as Integer) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
event DynaPDF MBS DynaPDF Plugin 8.0 ✅ Yes ✅ Yes ✅ Yes ❌ No
The event called when an ICC profile is replaced.

Please use various ReplaceICCProfile functions to provide replacement profile.

Some examples using this event:

See also OnReplaceICCProfile function in DynaPDF manual.

DynaPDFMBS.PageBreak(LastPosX as Double, LastPosY as Double, PageBreak as boolean) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
event DynaPDF MBS DynaPDF Plugin 8.0 ✅ Yes ✅ Yes ✅ Yes ❌ No
The event called on every pagebreak.

The parameter PageBreak of the event specifies why the event was called:

  • If true, a page break tag in the string was found (see WriteFText for further information).
  • If false, the output rectangle was filled with text entirely.

The usage of the event is described in detail under WriteFText(). However, the following
return values of the event can be used the change the text alignment:

New Alignment Left1
New Alignment Right2
New Alignment Center3
New Alignment Justify4

A return value of zero indicates that the alignment must not be changed. Negative return values break processing immediately. WriteFText() returns then with a warning.

When the event is called, the coordinate system is always bottom-up, it can be changed to top-down coordinates inside the event if necessary. The current page is still open, the page must be closed with EndPage() before a new page can be added or opened with Append() or EditPage(). To determine the current page number, call GetPageNum().

For example SetFont may fail if you try normal font family names. That is because SetFontSelMode is used with postscript names and you may want to set it to ksmPostScriptName using SetFontSelMode for SetFont to accept family names.

Some examples using this event:

DynaPDFMBS.Progress(ActivePage as Integer) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
event DynaPDF MBS DynaPDF Plugin 8.0 ✅ Yes ✅ Yes ✅ Yes ❌ No
The progress callback.

The return value of the progress callback function must be 0, any other return value breaks processing.

DynaPDFMBS.RasterShowText(MatrixBefore as DynaPDFMatrixMBS, MatrixAfter as DynapdfMatrixMBS, TextBuffers() as DynaPDFTextRecordAMBS, Texts() as String, Width as Double, Vertical as boolean, FontRef as Integer, textScaling as Double)

Type Topic Plugin Version macOS Windows Linux iOS Targets
event DynaPDF MBS DynaPDF Plugin 16.2 ✅ Yes ✅ Yes ✅ Yes ❌ No
Rastering draws text.

This is experimental and will be replaced later with a better API in a future DynaPDF release.
Works only if you have a plugin where this is enabled by us.

If you implement this event, you get an event whenever one of the rasterizers draws some text on a page.
MatrixBefore tells you start position, MatrixAfter end position. TextBuffers provide raw text data. Texts array the matching unicode text. Width is length of text in points. Vertical is true for vertical text. FontRef is the internal font reference. You can query fonts with EnumDocFont before to get a list of all fonts and find it in the array. Do not use font functions in the event as that can confuse the rasterizer.

Do not use with MT methods, please.

The items on this page are in the following plugins: MBS DynaPDF Plugin.


The biggest plugin in space...