Platforms to show: All Mac Windows Linux Cross-Platform

Back to DynaPDFMBS class.

Next items

DynaPDFMBS.ImportBookmarks as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method DynaPDF MBS DynaPDF Plugin 8.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
This function imports the outline tree of the currently opened import file (see OpenImportFile() or OpenImportBuffer()).

See also ImportBookmarks function in DynaPDF manual.

DynaPDFMBS.ImportCatalogObjects as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method DynaPDF MBS DynaPDF Plugin 8.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The function imports global objects of the currently opened import file such as bookmarks, JavaScripts, embedded files, open actions, invisible page templates, rendering intents, the document info entries, and certain other global properties such as the page mode or page layout.

See also ImportCatalogObjects function in DynaPDF manual.

DynaPDFMBS.ImportDocInfo as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method DynaPDF MBS DynaPDF Plugin 8.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The function imports the document info entries from the currently opened import file.

See also ImportDocInfo function in DynaPDF manual.

DynaPDFMBS.ImportEncryptionSettings as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method DynaPDF MBS DynaPDF Plugin 17.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Imports the encryption settings from the currently open import file (see OpenImportFile() or OpenImportBuffer() for further information).

If the PDF file is not encrypted, the function does nothing. To determine whether the open PDF file is encrypted call GetInIsEncrypted().
The encryption settings should be imported to make sure that the PDF file can be saved with the same settings after it was edited. The user rights should be considered if the file was opened with the open password, also if the password was just an empty string. See GetUserRights() for further information.
If the file was opened with the owner password, then all editing rights should be grated. The PDF file must be closed with CloseFile() or CloseAndSignFile() for example. Don't use
CloseFileEx() for example since this function would override the encryption settings.
If the file should be saved unencrypted call ResetEncryptionSettings() before closing the file. Return values:
If the function succeeds the return value is true. If the function fails the return value is false.

See also ImportEncryptionSettings function in DynaPDF manual.

DynaPDFMBS.ImportOCProperties as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method DynaPDF MBS DynaPDF Plugin 17.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Imports the global Optional Content Properties of the curent open import file.

OC properties are normally automatically imported by functions like ImportPDFFile() or when importing a page that contains layers. However, a viewer application must be able to access the OC properties right after the PDF file was opened so that the layer configuration and the layer tree can be loaded (see LoadLayerConfig() and GetOCUINode() for further information).
The function can be called multiple times without causing unwanted side effects.

If the function succeeds the return value is true. If the function fails the return value is false.

See also ImportOCProperties function in DynaPDF manual.

DynaPDFMBS.ImportPageEx(PageNum as Integer, ScaleX as Double = 1.0, ScaleY as Double = 1.0) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method DynaPDF MBS DynaPDF Plugin 8.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The function imports a PDF page of an external PDF file incl. interactive objects such as annotations, form fields and so on, if any.

Requires DynaPDF Pro license.

Some examples using this method:

See also ImportPageEx function in DynaPDF manual.

DynaPDFMBS.ImportPDFFile(DestPage as Integer, ScaleX as Double = 1.0, ScaleY as Double = 1.0) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method DynaPDF MBS DynaPDF Plugin 8.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The function imports an external PDF file incl. interactive objects such as annotations, bookmarks, form fields and so on.
Example
// new PDF
Var pdf As New MyDynapdfMBS

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

// create output file
Var outFile As folderitem = SpecialFolder.Desktop.Child("NewPDF.pdf")
Call pdf.CreateNewPDF(outFile)

// set flags to import all
Var flags As Integer = Bitwise.BitOr(pdf.kifImportAsPage, pdf.kifImportAll)
Call pdf.SetImportFlags(flags)

// import PDF
Var inFile As folderitem = SpecialFolder.Desktop.Child("test.pdf")

Call pdf.OpenImportFile(inFile)
Call pdf.ImportPDFFile(1)

// now delete one page
Call pdf.DeletePage(2)

// close output file
Call pdf.closefile

Scaling factor is ignored if importing as pages (not templates).

This function returns the page number of the last page imported. It does not return how many pages are imported. If you need number of imported pages, please use returned value minus DestPage.

Some examples using this method:

See also ImportPDFFile function in DynaPDF manual.

DynaPDFMBS.ImportPDFPage(PageNum as Integer, ScaleX as Double = 1.0, ScaleY as Double = 1.0) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method DynaPDF MBS DynaPDF Plugin 15.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Imports a PDF page.

If a page is open, this function calls EndPage.
Than it appends a new page, calls ImportPageEx and Endpage.

On success the return value is zero. If the function fails the return value is a negative error code.

Some examples using this method:

See also ImportPDFPage function in DynaPDF manual.

DynaPDFMBS.InitColorManagement(profiles as DynaPDFColorProfilesMBS, DestSpace as Integer, Flags as Integer) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method DynaPDF MBS DynaPDF Plugin 11.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Initializes color management with the given default profiles.

Pass nil for profiles to disable color management.
DestSpace can be kcsDeviceRGB, kcsDeviceCMYK or kcsDeviceGray.
Flags can be kicmDefault or kicmBPCompensation for:
Black point compensation preserves the black point when converting CMYK colors to different color spaces.

Some examples using this method:

See also InitColorManagement function in DynaPDF manual.

DynaPDFMBS.InitColorManagementEx(profiles as DynaPDFColorProfilesExMBS, DestSpace as Integer, Flags as Integer) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method DynaPDF MBS DynaPDF Plugin 16.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Initialize color management.

The function enables color management in the functions RenderPage(), RenderPageEx(), RenderPageToImage(), and RenderPDFFile() exactly like InitColorManagement() but accepts ICC profile buffers instead of file paths. See InitColorManagement() for further information.

To disable color management set the parameter Profiles to nil.

Initializing the color management requires a considerable amount of processing time. It is strongly recommended to use one PDF instance as long as possible so that it must not be initialized again when another PDF file will be rendered.
The color management can be initialized right after the PDF instance was created.

Returns true on succes or false on failure.

Some examples using this method:

See also InitColorManagementEx function in DynaPDF manual.

DynaPDFMBS.InitStack(byref stack as DynaPDFStackMBS) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method DynaPDF MBS DynaPDF Plugin 7.7 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The function initializes the variable Stack with default values and prepares the editing of a content stream.
Example
Var s as DynaPDFStackMBS
Var pdf as DynaPDFMBS // get your DynaPDF object

call pdf.InitStack(s)

If stack is nil, a new one will be created and stored in the variable.

Return values:
If the function succeeds the return value is true. If the function fails the return value is false.

Some examples using this method:

See also InitStack function in DynaPDF manual.

DynaPDFMBS.InkAnnot(points() as DynaPDFPointMBS, LineWidth as Double, ColorValue as UInt32, ColorSpace as Integer, Author as string, Subject as string, Content as string) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method DynaPDF MBS DynaPDF Plugin 15.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates an Ink annotation.

An ink annotation (PDF 1.3) represents a freehand "scribble" composed of one or more disjoint paths. The parameter Points represents a stroked path. More paths can be added with AddInkList.
The points are interpreted in currect user space. Any transformation that was applied on the coordinate system will be taken into account.
The points are connected with bezier curves to achieve a smooth transition between points. If the points should be connected with straight lines, then create a PolyLine annotation instead (see PolyLineAnnot).
This annotation type has an associated PopUp annotation that displays the string Content in a floating window. The initial window state of the associated PopUp annotation is closed by default but the state can be changed with SetAnnotOpenState() if necessary.

If the function succeeds the return value is the annotation handle, a value greater or equal zero. If the function fails the return value is a negative error code.

Some examples using this method:

See also InkAnnot function in DynaPDF manual.

DynaPDFMBS.InkAnnotAnsi(points() as DynaPDFPointMBS, LineWidth as Double, ColorValue as UInt32, ColorSpace as Integer, Author as string, Subject as string, Content as string) as Integer   Deprecated

Type Topic Plugin Version macOS Windows Linux iOS Targets
method DynaPDF MBS DynaPDF Plugin 15.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
This item is deprecated and should no longer be used. You can use the non ANSI function instead.
Creates an Ink annotation.

An ink annotation (PDF 1.3) represents a freehand "scribble" composed of one or more disjoint paths. The parameter Points represents a stroked path. More paths can be added with AddInkList.
The points are interpreted in currect user space. Any transformation that was applied on the coordinate system will be taken into account.
The points are connected with bezier curves to achieve a smooth transition between points. If the points should be connected with straight lines, then create a PolyLine annotation instead (see PolyLineAnnot).
This annotation type has an associated PopUp annotation that displays the string Content in a floating window. The initial window state of the associated PopUp annotation is closed by default but the state can be changed with SetAnnotOpenState() if necessary.

If the function succeeds the return value is the annotation handle, a value greater or equal zero. If the function fails the return value is a negative error code.

See also InkAnnot function in DynaPDF manual.

DynaPDFMBS.InsertBarcode(PosX as double, PosY as double, Width as double, Height as double, HAlign as Integer, VAlign as Integer, Barcode as DynaPDFBarcode2MBS) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method DynaPDF MBS DynaPDF Plugin 20.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Inserts a barcode to the current open page.
Example
Var d As New DynapdfMBS
// create/edit a page, then draw barcode:

// UPCA
Var b1 As New DynaPDFBarcode2MBS
b1.BarcodeType = b1.kbctUPCA
b1.Data = "72527270270"

Call d.InsertBarcode(100, 100, 200, 50, d.kcoLeft, d.kcoTop, b1)

See the kbct* constants for the types supported.

Options are very similar to what we have in our BarcodeGeneratorMBS class as both use the same zint library.

Some examples using this method:

See also InsertBarcode function in DynaPDF manual.

DynaPDFMBS.InsertBMPFromBuffer(PosX as Double, PosY as Double, ScaleWidth as Double, ScaleHeight as Double, Buffer as memoryblock) as Integer   Deprecated

Type Topic Plugin Version macOS Windows Linux iOS Targets
method DynaPDF MBS DynaPDF Plugin 13.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
This item is deprecated and should no longer be used. You can use InsertImageFromBuffer instead.
The function inserts a Device Independent Bitmap from a file buffer.

See also:

See also InsertBMPFromBuffer function in DynaPDF manual.

DynaPDFMBS.InsertBMPFromBuffer(PosX as Double, PosY as Double, ScaleWidth as Double, ScaleHeight as Double, Buffer as string) as Integer   Deprecated

Type Topic Plugin Version macOS Windows Linux iOS Targets
method DynaPDF MBS DynaPDF Plugin 13.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
This item is deprecated and should no longer be used. You can use InsertImageFromBuffer instead.
The function inserts a Device Independent Bitmap from a file buffer.

See also:

See also InsertBMPFromBuffer function in DynaPDF manual.

DynaPDFMBS.InsertBMPFromBuffer(PosX as Double, PosY as Double, ScaleWidth as Double, ScaleHeight as Double, BufferAddress as Integer) as Integer   Deprecated

Type Topic Plugin Version macOS Windows Linux iOS Targets
method DynaPDF MBS DynaPDF Plugin 8.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
This item is deprecated and should no longer be used. You can use InsertImageFromBuffer instead.
The function inserts a Device Independent Bitmap from a file buffer.

See also:

See also InsertBMPFromBuffer function in DynaPDF manual.

DynaPDFMBS.InsertBMPFromHandle(PosX as Double, PosY as Double, ScaleWidth as Double, ScaleHeight as Double, hBitmap as Integer) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method DynaPDF MBS DynaPDF Plugin 8.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
This function inserts a bitmap in the same way as InsertImage() but accepts a HBITMAP handle as input.

See also InsertBMPFromHandle function in DynaPDF manual.

DynaPDFMBS.InsertBookmark(title as String, parent as Integer, DestPage as Integer, Open as boolean, AddChildren as boolean) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method DynaPDF MBS DynaPDF Plugin 11.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
This function inserts a bookmark to the global outline tree of the document.

The title parameter is converted to unicode.

See also InsertBookmark function in DynaPDF manual.

DynaPDFMBS.InsertBookmarkAnsi(title as String, parent as Integer, DestPage as Integer, Open as boolean, AddChildren as boolean) as Integer   Deprecated

Type Topic Plugin Version macOS Windows Linux iOS Targets
method DynaPDF MBS DynaPDF Plugin 11.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
This item is deprecated and should no longer be used. You can use the non ANSI function instead.
This function inserts a bookmark to the global outline tree of the document.

The title parameter is converted to ANSI.

See also InsertBookmark function in DynaPDF manual.

DynaPDFMBS.InsertBookmarkEx(title as String, parent as Integer, NamedDest as Integer, Open as boolean, AddChildren as boolean) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method DynaPDF MBS DynaPDF Plugin 11.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
This function inserts a bookmark to the global outline tree of the document.

The title parameter is converted to unicode.

See also InsertBookmarkEx function in DynaPDF manual.

DynaPDFMBS.InsertBookmarkExAnsi(title as String, parent as Integer, NamedDest as Integer, Open as boolean, AddChildren as boolean) as Integer   Deprecated

Type Topic Plugin Version macOS Windows Linux iOS Targets
method DynaPDF MBS DynaPDF Plugin 11.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
This item is deprecated and should no longer be used. You can use the non ANSI function instead.
This function inserts a bookmark to the global outline tree of the document.

The title parameter is converted to ANSI.

See also InsertBookmarkEx function in DynaPDF manual.

DynaPDFMBS.InsertImage(PosX as Double, PosY as Double, ScaleWidth as Double, ScaleHeight as Double, File as folderitem) as Integer   Deprecated

Type Topic Plugin Version macOS Windows Linux iOS Targets
method DynaPDF MBS DynaPDF Plugin 8.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
This item is deprecated and should no longer be used. You can use InsertImage instead.
The function inserts an image from a file.
Example
Var pdf as DynaPDFMBS

// ... add page

// use transparency from image
call pdf.SetUseTransparency(False)

// max 300 dpi for recompressed images
call pdf.SetResolution(300)

// use JPEG when compressing new pictures
call pdf.SetCompressionFilter(pdf.kcfJPEG)

// pass through JPEGs if possible
call pdf.SetSaveNewImageFormat(false)

// insert image
Var source as FolderItem = SpecialFolder.Desktop.Child("test.jpg")
call pdf.InsertImage(0, 0, 300, 200, source)

Please call SetUseTransparency(false) before inserting image if you don't like one of the colors (default white) to become transparent.

DynaPDF 3.0 adds support for pictures with alpha channel for this function.

See also InsertImage function in DynaPDF manual.

DynaPDFMBS.InsertImageEx(PosX as Double, PosY as Double, ScaleWidth as Double, ScaleHeight as Double, File as folderitem, index as Integer = 1) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method DynaPDF MBS DynaPDF Plugin 8.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The function inserts an image from a file.
Example
Var pdf as DynaPDFMBS

// ... add page

// use transparency from image
call pdf.SetUseTransparency(False)

// max 300 dpi for recompressed images
call pdf.SetResolution(300)

// use JPEG when compressing new pictures
call pdf.SetCompressionFilter(pdf.kcfJPEG)

// pass through JPEGs if possible
call pdf.SetSaveNewImageFormat(false)

// insert image
Var source as FolderItem = SpecialFolder.Desktop.Child("test.jpg")
call pdf.InsertImageEx(0, 0, 300, 200, source)

Please call SetUseTransparency(false) before inserting image if you don't like one of the colors (default white) to become transparent.

DynaPDF 3.0 adds support for pictures with alpha channel for this function.

See also:

Some examples using this method:

See also InsertImageEx function in DynaPDF manual.

DynaPDFMBS.InsertImageEx(PosX as double, PosY as double, ScaleWidth as double, ScaleHeight as double, Path as String, index as integer = 1) as integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method DynaPDF MBS DynaPDF Plugin 19.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The function inserts an image from a file.
Example
Var d As New DynaPDFMBS

// create PDF in memory
Call d.CreateNewPDF

// add a picture
Call d.Append
Call d.InsertImageEx(100, 100, 100, 100, "/Users/cs/Pictures/mond.jpg")
Call d.EndPage

// okay?
If d.HaveOpenDoc Then

// open target file
Call d.OpenOutputFile("/Users/cs/Desktop/mond.pdf")

// write and close
Call d.CloseFile

End If

Please call SetUseTransparency(false) before inserting image if you don't like one of the colors (default white) to become transparent.

DynaPDF 3.0 adds support for pictures with alpha channel for this function.

See also:

See also InsertImageEx function in DynaPDF manual.

DynaPDFMBS.InsertImageFromBuffer(PosX as Double, PosY as Double, ScaleWidth as Double, ScaleHeight as Double, Buffer as Memoryblock, index as Integer = 1) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method DynaPDF MBS DynaPDF Plugin 13.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The function inserts an image in exactly the same way as InsertImageEx(), but it accepts a file buffer as input.

Please call SetUseTransparency(false) before inserting image if you don't like one of the colors (default white) to become transparent.

DynaPDF 3.0 adds support for pictures with alpha channel for this function.
Please pass positon and size as doubles. If you use integers, Xojo will give a compile error.

See also:

Some examples using this method:

See also InsertImageFromBuffer function in DynaPDF manual.

DynaPDFMBS.InsertImageFromBuffer(PosX as Double, PosY as Double, ScaleWidth as Double, ScaleHeight as Double, Buffer as string, index as Integer = 1) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method DynaPDF MBS DynaPDF Plugin 8.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The function inserts an image in exactly the same way as InsertImageEx(), but it accepts a file buffer as input.

Please call SetUseTransparency(false) before inserting image if you don't like one of the colors (default white) to become transparent.

DynaPDF 3.0 adds support for pictures with alpha channel for this function.
Please pass positon and size as doubles. If you use integers, Xojo will give a compile error.

See also:

See also InsertImageFromBuffer function in DynaPDF manual.

DynaPDFMBS.InsertMetafile(FileName as folderitem, PosX as Double, PosY as Double, Width as Double, Height as Double) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method DynaPDF MBS DynaPDF Plugin 8.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The function converts an Enhanced Meta File (EMF) or Windows Meta File (WMF) to a native PDF vector graphic.

Requires DynaPDF Lite license.

Some examples using this method:

See also InsertMetafile function in DynaPDF manual.

DynaPDFMBS.InsertMetafileEx(Buffer as memoryblock, PosX as Double, PosY as Double, Width as Double, Height as Double) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method DynaPDF MBS DynaPDF Plugin 13.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The function converts an Enhanced Meta File (EMF) or Windows Meta File (WMF) to a native PDF vector graphic in the same way as InsertMetafile().

Requires DynaPDF Lite license.

See also:

See also InsertMetafileEx function in DynaPDF manual.

DynaPDFMBS.InsertMetafileEx(Buffer as string, PosX as Double, PosY as Double, Width as Double, Height as Double) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method DynaPDF MBS DynaPDF Plugin 8.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The function converts an Enhanced Meta File (EMF) or Windows Meta File (WMF) to a native PDF vector graphic in the same way as InsertMetafile().

Requires DynaPDF Lite license.

See also:

See also InsertMetafileEx function in DynaPDF manual.

DynaPDFMBS.InsertMetafileExt(FileName as folderitem, View as DynaPDFRectMBS, PosX as Double, PosY as Double, Width as Double, Height as Double) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method DynaPDF MBS DynaPDF Plugin 8.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The function converts an Enhanced Meta File (EMF) or Windows Meta File (WMF) to a native PDF vector graphic in the same way as InsertMetafile().

Requires DynaPDF Lite license.

See also InsertMetafileExt function in DynaPDF manual.

DynaPDFMBS.InsertMetafileExtEx(Buffer as Memoryblock, View as DynaPDFRectMBS, PosX as Double, PosY as Double, Width as Double, Height as Double) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method DynaPDF MBS DynaPDF Plugin 13.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The function converts an Enhanced Meta File (EMF) or Windows Meta File (WMF) to a native PDF vector graphic in the same way as InsertMetafileExt().

Requires DynaPDF Lite license.

See also:

See also InsertMetafileExtEx function in DynaPDF manual.

DynaPDFMBS.InsertMetafileExtEx(Buffer as String, View as DynaPDFRectMBS, PosX as Double, PosY as Double, Width as Double, Height as Double) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method DynaPDF MBS DynaPDF Plugin 8.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The function converts an Enhanced Meta File (EMF) or Windows Meta File (WMF) to a native PDF vector graphic in the same way as InsertMetafileExt().

Requires DynaPDF Lite license.

See also:

See also InsertMetafileExtEx function in DynaPDF manual.

DynaPDFMBS.InsertMetafileFromHandle(hEnhMetafileHandle as Integer, PosX as Double, PosY as Double, Width as Double, Height as Double) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method DynaPDF MBS DynaPDF Plugin 8.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
This function inserts an Enhanced Metafile exactly in the same way as InsertMetafile() but accepts a HENHMETAFILE handle as input.

Requires DynaPDF Lite license.

See also InsertMetafileFromHandle function in DynaPDF manual.

DynaPDFMBS.InsertMetafileFromHandleEx(hEnhMetafileHandle as Integer, View as DynaPDFRectMBS, PosX as Double, PosY as Double, Width as Double, Height as Double) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method DynaPDF MBS DynaPDF Plugin 8.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
This function inserts an Enhanced Metafile exactly in the same way as InsertMetafileExt() but accepts a HENHMETAFILE handle as input.

Requires DynaPDF Lite license.

See also InsertMetafileFromHandleEx function in DynaPDF manual.

DynaPDFMBS.InsertPicture(pic as picture, mask as picture, PosX as Double, PosY as Double, ScaleWidth as Double, ScaleHeight as Double) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method DynaPDF MBS DynaPDF Plugin 9.7 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Takes a Xojo picture with a mask and adds it to the PDF.
Example
// insert MBS Logo with round Mask
Var d as new MyDynaPDFMBS
Var file as FolderItem = SpecialFolder.Desktop.Child("test.pdf")

call d.CreateNewPDF file
call d.Append

// get picture
Var p as Picture = LogoMBS(500)

// get mask
Var m as new Picture(500, 500, 32)
m.Graphics.ForeColor = &cFFFFFF
m.Graphics.FillRect 0,0,500,500
m.Graphics.ForeColor = &c000000
m.Graphics.FillOval 0,0,500,500

// add image to pdf
call d.InsertPicture(p, m, 50, 150, 500, 500)

call d.EndPage
call d.CloseFile

Please call SetUseTransparency(false) before inserting image if you don't like one of the colors (default white) to become transparent.
This is a convenience function to handle picture with mask.

Internally this calls pdfInsertRawImage so check the documtation on this function in the dynapdf manual.
For images with alpha channel, we pass a PNG via pdfInsertImageFromBuffer.

Usually InsertPicture with the mask/alpha is better.
PosX and PosY are the destination position and ScaledWidth and ScaledHeight is the new size of the image.

See also:

Some examples using this method:

DynaPDFMBS.InsertPicture(pic as picture, PosX as Double, PosY as Double, ScaleWidth as Double, ScaleHeight as Double) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method DynaPDF MBS DynaPDF Plugin 8.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Takes a Xojo picture and adds it to the PDF.

Please call SetUseTransparency(false) before inserting image if you don't like one of the colors (default white) to become transparent.
Internally this calls pdfInsertRawImage so check the documtation on this function in the dynapdf manual.
For images with alpha channel, we pass a PNG via pdfInsertImageFromBuffer.

PosX and PosY are the destination position and ScaledWidth and ScaledHeight is the new size of the image.

See also:

Next items

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


The biggest plugin in space...