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 |
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 |
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 |
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 |
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 |
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 |
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 |
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:
- /DynaPDF/PDF-A/Combine PDF files to PDFA
- /DynaPDF/PDF-A/Create PDFA
- /DynaPDF/PDF-A/Normalize PDF
- /DynaPDF/ZUGFeRD 2.0/Create PDF with existing pdf
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 |
Please use various ReplaceICCProfile functions to provide replacement profile.
Some examples using this event:
- /DynaPDF/PDF-A/Combine PDF files to PDFA
- /DynaPDF/PDF-A/Create PDFA
- /DynaPDF/PDF-A/Normalize PDF
- /DynaPDF/signed pdfa/signed pdfa
- /DynaPDF/ZUGFeRD 2.0/Create PDF with existing pdf
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 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 Left | 1 |
New Alignment Right | 2 |
New Alignment Center | 3 |
New Alignment Justify | 4 |
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:
- /DynaPDF/Create PDF with DPart Metadata
- /DynaPDF/Create PDF with page wrap
- /DynaPDF/Create PDF with text block2
- /DynaPDF/DynaPDF Graphics/DynaPDF GraphicsPath
- /DynaPDF/DynaPDF Graphics/Reporting/GasReport/GasReport
- /DynaPDF/DynaPDF Graphics/Reporting/ListBoxReport
- /DynaPDF/Letter/Letter with AddContinueText and two pages template
- /DynaPDF/Letter/Letter with writeftext
- /DynaPDF/StyledText Editor
- /DynaPDF/text formatting/text formatting Unicode
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 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 |
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.