Platforms to show: All Mac Windows Linux Cross-Platform

Back to DynaPDFMBS class.

DynaPDFMBS.ActiveFontInfo as DynaPDFFontInfoMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
property DynaPDF MBS DynaPDF Plugin 20.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Queries font info for active font.

Added, so you can see it in debugger.
(Read only property)

DynaPDFMBS.ClearRectMode as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property DynaPDF MBS DynaPDF Plugin 20.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The ClearRect Mode for Graphics class.
Example
dim pdf as new DynaPDFMBS
pdf.ClearRectMode = kClearRectModeIgnoreAll

When graphics class is called with ClearRect method, the area in the PDF page is filled with white color.
If you like to ignore such calls, please set value to ignore all or just big rectangles.
(Read and Write property)

Some examples using this property:

DynaPDFMBS.ErrorCount as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property DynaPDF MBS DynaPDF Plugin 21.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Number of warnings reported by DynaPDF.

Use Error event to track them.
Or catch exceptions.
(Read only property)

DynaPDFMBS.FontSize as Double

Type Topic Plugin Version macOS Windows Linux iOS Targets
property DynaPDF MBS DynaPDF Plugin 22.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Queries the font size of the active font.

The function returns the font size, a value greater zero on success, or a negative error code on failure.

If you set this property, it calls ChangeFontSize internally.
(Read and Write property)

DynaPDFMBS.Handle as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property DynaPDF MBS DynaPDF Plugin 8.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The IPDF handle passed to each API function.

The constructor fills this handle and the destructor frees it.
(Read only property)

DynaPDFMBS.HasLite as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property DynaPDF MBS DynaPDF Plugin 20.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Whether a lite or pro license is in use.

Relevant for some example projects and graphics class support to know whether CreateExtGState is available.
(Read only property)

DynaPDFMBS.ImportFlags as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property DynaPDF MBS DynaPDF Plugin 17.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Get/Set import flags.

Same as using GetImportFlags and SetImportFlags.
(Read and Write property)

Some examples using this property:

DynaPDFMBS.ImportFlags2 as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property DynaPDF MBS DynaPDF Plugin 17.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Get/Set import flags 2.

Same as using GetImportFlags2 and SetImportFlags2.
(Read and Write property)

DynaPDFMBS.PageCoords as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property DynaPDF MBS DynaPDF Plugin 10.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The page coordinate system setting.

The native coordinate system of the Portable Document Format is bottom up.
Also check the dynapdf manual on the pdfGetPageCoords and pdfSetPageCoords functions.
Value can be kpcTopDown or kpcBottomUp. Default is kpcBottomUp.
(Read and Write property)

Some examples using this property:

DynaPDFMBS.PageGraphics as Graphics

Type Topic Plugin Version macOS Windows Linux iOS Targets
property DynaPDF MBS DynaPDF Plugin 19.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The page graphics object.
Example
Dim pdf As New DynapdfMBS
// please subclass DynapdfMBS to implement error event

Dim f As FolderItem = SpecialFolder.Desktop.Child("DynaPDF Graphics.pdf")

'pdf.SetLicenseKey "Starter"
// For this example you can use a Starter, Lite, Pro or Enterprise License

// Create new PDF. Use f = nil for in-memory PDF
Call pdf.CreateNewPDF(f)

// append a new page, so we have an open page
Call pdf.Append

// get graphics object to draw on the page
Dim g As Graphics = pdf.PageGraphics

// draw as usual
g.DrawString "Hello World", 105, 100
g.DrawRect 100, 80, 100, 100

// close page and file
Call pdf.EndPage
Call pdf.CloseFile

// for in-memory PDF, use GetBuffer here to grab it.
'Dim PDFData As String = pdf.GetBuffer

We create a temporary picture and subclass the graphics to reproduce all drawing commands called on this graphics object to the current PDF Page.

For every drawing command, we apply the following properties from graphics object to DynaPDF:

  • ForeColor
  • Bold
  • Italic
  • Underline
  • TextUnit
  • TextFont
  • TextSize
  • ScaleX
  • ScaleY
  • PenHeight
  • PenWidth
  • CharacterSpacing

Supports the following graphics commands:
  • Draw/Fill Oval/Rect/RoundRect/Line/Polygon
  • DrawString
  • StringHeight and StringWidth
  • DrawPicture
  • NextPage
  • Get/Set Pixel.
  • Clip
  • Supports vector graphics classes (Object2D)
  • Supports report engine

Some notes:
  • Handle() function returns handle for picture.
  • Pixel reads from temporary picture
  • ClearRect draws white rectangle
  • DrawCautionIcon, DrawNoteIcon and DrawStopIcon are not supported.
  • NextPage method calls NextPage event. If missing, we end page and create a new one. In the event, please call EndPage and maybe Append or import an existing PDF page from import PDF.
  • If CMYK, Gray or Lab colorspace is set, the plugin will keep them for white/black colors, but switch to RGB for all other colors.

StyledTextPrinter is not supported, but you can do similar things via WriteStyledText or WriteStyledTextEx methods in DynaPDFMBS class.

If no page is open, call this may append a new page. If no document is open, we call CreateNewPDF for you with nil folderitem, so an in memory PDF get's created.

Seems like reports on Windows may not work for v19.2 of our plugins. This is fixed for 19.3.
(Read only property)

Some examples using this property:

DynaPDFMBS.PageGraphicsPicture as Picture

Type Topic Plugin Version macOS Windows Linux iOS Targets
property DynaPDF MBS DynaPDF Plugin 19.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The temporary picture for page graphics.

For debugging it may be useful to see the temporary picture with all the draws made on the PDF page.
This is not 1 to 1 what you will see in rendered PDF Page.

This can be viewed even when graphics object is cleared.
(Read only property)

Some examples using this property:

DynaPDFMBS.PrintCancelled as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property DynaPDF MBS DynaPDF Plugin 20.5 ❌ No ✅ Yes ❌ No ❌ No All
Whether last print operation was cancelled.

Set by PrintPDFFileWithDialog and PrintPDFPageWithDialog methods if user presses cancel button.
Otherwise will be false.
(Read and Write property)

DynaPDFMBS.SpaceWidthFactor as Single

Type Topic Plugin Version macOS Windows Linux iOS Targets
property DynaPDF MBS DynaPDF Plugin 22.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The space width factor.

Sets the space width factor that is used by DynaPDF.ExtractText to determine whether the distance between two text records or glyphs should be interpreted as space character.
PDF files do often not contain space characters. Depending on the font type, i.e. fixed pitch or proportional fonts, different default widths are used during text extraction. However, the full space width is mostly too large to find spaces. Therefore, the text extraction algorithm multiplies the default space width with the space width factor to find suitable values.
The default value is 0.7. Increase the value if too many spaces occur in extracted text and decrease the value if too few spaces were found.
The value must be large zero. Although the upper bound is not restricted, values larger than 2 are mostly not meaningful.
(Read and Write property)

DynaPDFMBS.TraceFile as FolderItem

Type Topic Plugin Version macOS Windows Linux iOS Targets
property DynaPDF MBS DynaPDF Plugin 10.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The trace file.

The plugin writes debug messages to this file so you can check what functions you called.

Improved with 16.2 plugin to really cover over 99% of all calls with parameters and result. Please report if you miss something.

See also AppendTraceFile method to append the log file.
(Read and Write property)

Some examples using this property:

DynaPDFMBS.TraceHandle as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property DynaPDF MBS DynaPDF Plugin 10.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The internal file handle for the trace file.

If this is not zero, the tracing option is turned on.
You can set this value indirectly by using the TraceFile property.
(Read only property)

DynaPDFMBS.ValidateTextEncodings as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property DynaPDF MBS DynaPDF Plugin 13.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Whether to validate text encodings.
Example
dim pdf as new DynaPDFMBS

call pdf.CreateNewPDF nil
call pdf.Append

// enable validating
pdf.ValidateTextEncodings = true

// make text without text encoding
dim s as string = "Hello World"
s = DefineEncoding(s, nil) // remove encoding

call pdf.SetFont "Times", pdf.kfsItalic, 20.0, true, pdf.kcp1252
// now cause exception
call pdf.WriteText 50.0, 580.0, s

call pdf.EndPage
call pdf.CloseFile

You should enable this for debugging to find bugs with text encodings.
(Read and Write property)

DynaPDFMBS.WarningCount as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property DynaPDF MBS DynaPDF Plugin 21.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Number of errors reported by DynaPDF.

Use Error event to track them.
Or catch exceptions.
(Read only property)

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


The biggest plugin in space...