Xojo Conferences
MBSOct2019CologneDE

Platforms to show: All Mac Windows Linux Cross-Platform

DynaPDFMBS.Handle as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property DynaPDF MBS DynaPDF Plugin 8.0 Yes Yes Yes Yes No
Function: The IPDF handle passed to each API function.
Notes:
The constructor fills this handle and the destructor frees it.
(Read only property)

Feedback, Comments & Corrections

DynaPDFMBS.ImportFlags as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property DynaPDF MBS DynaPDF Plugin 17.0 Yes Yes Yes Yes No
Function: Get/Set import flags.
Notes:
Same as using GetImportFlags and SetImportFlags.
(Read and Write property)

Feedback, Comments & Corrections

DynaPDFMBS.ImportFlags2 as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property DynaPDF MBS DynaPDF Plugin 17.0 Yes Yes Yes Yes No
Function: Get/Set import flags 2.
Notes:
Same as using GetImportFlags2 and SetImportFlags2.
(Read and Write property)

Feedback, Comments & Corrections

DynaPDFMBS.PageCoords as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property DynaPDF MBS DynaPDF Plugin 10.4 Yes Yes Yes Yes No
Function: The page coordinate system setting.
Notes:
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)

Feedback, Comments & Corrections

DynaPDFMBS.PageGraphics as Graphics
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property DynaPDF MBS DynaPDF Plugin 19.2 Yes Yes Yes Yes No
Function: 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
Notes:
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.
(Read only property)

Feedback, Comments & Corrections

DynaPDFMBS.PageGraphicsPicture as Picture
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property DynaPDF MBS DynaPDF Plugin 19.2 Yes Yes Yes Yes No
Function: The temporary picture for page graphics.
Notes:
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)

Feedback, Comments & Corrections

DynaPDFMBS.TraceFile as Folderitem
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property DynaPDF MBS DynaPDF Plugin 10.4 Yes Yes Yes Yes No
Function: The trace file.
Notes:
The plugin writes debug messages to this file so you can check what functions you called.
Not all functions are supported for this.
Improved with 16.2 plugin to really cover over 99% of all calls with parameters and result. Please report if you miss something.
(Read and Write property)

Feedback, Comments & Corrections

DynaPDFMBS.TraceHandle as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property DynaPDF MBS DynaPDF Plugin 10.4 Yes Yes Yes Yes No
Function: The internal file handle for the trace file.
Notes:
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)

Feedback, Comments & Corrections

DynaPDFMBS.ValidateTextEncodings as Boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property DynaPDF MBS DynaPDF Plugin 13.2 Yes Yes Yes Yes No
Function: 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
Notes:
You should enable this for debugging to find bugs with text encodings.
(Read and Write property)

Feedback, Comments & Corrections

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




Links
MBS Xojo Plugins