Platforms to show: All Mac Windows Linux Cross-Platform

Back to DynaPDFMBS class.

Previous items

DynaPDFMBS.ReplaceFontEx(PDFFontRef as Integer, FontFile as FolderItem, Embed as boolean = true) as integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method DynaPDF MBS DynaPDF Plugin 17.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Replaces a PDF font with another one.

The font file can be loaded directly. It is not required to install the font on the system. The function can be called in the OnFontNotFound event of the function CheckConformance(). The return value of the event should be the return value of this function. The parameter PDFFontRef is a parameter of the event. The font reference is required and must be passed unchanged to the function.

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

See also:

See also ReplaceFontEx function in DynaPDF manual.

DynaPDFMBS.ReplaceFontEx(PDFFontRef as Integer, FontFilePath as string, Embed as boolean = true) as integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method DynaPDF MBS DynaPDF Plugin 17.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Replaces a PDF font with another one.

The font file can be loaded directly. It is not required to install the font on the system. The function can be called in the OnFontNotFound event of the function CheckConformance(). The return value of the event should be the return value of this function. The parameter PDFFontRef is a parameter of the event. The font reference is required and must be passed unchanged to the function.

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

See also:

See also ReplaceFontEx function in DynaPDF manual.

DynaPDFMBS.ReplaceFontExAnsi(PDFFontRef as Integer, FontFilePath as string, Embed as boolean = true) as integer   Deprecated

Type Topic Plugin Version macOS Windows Linux iOS Targets
method DynaPDF MBS DynaPDF Plugin 17.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
This item is deprecated and should no longer be used. You can use the non ANSI function instead.
Replaces a PDF font with another one.

The font file can be loaded directly. It is not required to install the font on the system. The function can be called in the OnFontNotFound event of the function CheckConformance(). The return value of the event should be the return value of this function. The parameter PDFFontRef is a parameter of the event. The font reference is required and must be passed unchanged to the function.

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

See also ReplaceFontEx function in DynaPDF manual.

DynaPDFMBS.ReplaceICCProfile(ColorSpace as Integer, ICCFile as folderitem) 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 is used to dynamically create ICC based color spaces within OnReplaceICCProfile event of CheckConformance().

Use in OnReplaceICCProfile event.

Some examples using this method:

See also ReplaceICCProfile function in DynaPDF manual.

DynaPDFMBS.ReplaceICCProfileEx(ColorSpace as integer, ICCFileData as MemoryBlock) as integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method DynaPDF MBS DynaPDF Plugin 17.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Replaces an ICC profile exactly in the same way as ReplaceICCProfile() but accepts a file buffer as input.

If the function succeeds the return value is zero. If the function fails the return value is a negative error code.
Use in OnReplaceICCProfile event.

See also:

See also ReplaceICCProfileEx function in DynaPDF manual.

DynaPDFMBS.ReplaceICCProfileEx(ColorSpace as integer, ICCFileData as String) as integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method DynaPDF MBS DynaPDF Plugin 17.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Replaces an ICC profile exactly in the same way as ReplaceICCProfile() but accepts a file buffer as input.

If the function succeeds the return value is zero. If the function fails the return value is a negative error code.
Use in OnReplaceICCProfile event.

See also:

See also ReplaceICCProfileEx function in DynaPDF manual.

DynaPDFMBS.ReplaceImage(ImageToReplace as DynaPDFImageMBS, ImageFile as FolderItem, Index as Integer = 1, ColorSpace as Integer = 0, CSHandle as Integer = -1, Flags as Integer = 0) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method DynaPDF MBS DynaPDF Plugin 17.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Replaces an image with another image.

The parameter ImageToReplace must be a valid pointer of an image object which is retrieved by functions like GetImageObj() or ParseContent().
The resolution, aspect ratio, color space and so on can be freely chosen. However, note that this function does not change the output position or size. If the aspect ratio of the new image is different, then it will be stretched or shrinked to fit into the output rectangle.
The parameter ColorSpace specifies the destination color space into which the image should be converted or saved, if the image is already defined in that color space. CSHandle must be the handle of that color space if a non-device space is used. The will be ignored for devices spaces.

The function works in the very same way as InsertImageEx() with the following differences:
• The color of an image mask cannot be set or changed because this would require changes on the content stream in which the image is used. An image mask will be created if the image color depth is 1 bit and if color key masking is enabled (see SetUseTransparency()). SetUseTransparency() should normally be set to false before calling this function.
• The image will never be downscaled, independent of the current resolution, because the size of the output rectangle is not known.

If the image that should be replaced is a soft mask of another base image, then make sure that the destination color space is set to kesDeviceGray, kesCalGray, or to a one channel ICC based color space because a soft mask must not contain more than one color channel.
The flags kgfUseImageColorSpace, kgfIgnoreICCProfiles, kgfRealPassThrough, and kfNoBitmapAlpha are all supported. See SetGStateFlags() for further information.

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

See also ReplaceImage function in DynaPDF manual.

DynaPDFMBS.ReplaceImageEx(ImageToReplace as DynaPDFImageMBS, ImageData as MemoryBlock, Index as Integer = 1, ColorSpace as Integer = 0, CSHandle as Integer = -1, Flags as Integer = 0) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method DynaPDF MBS DynaPDF Plugin 17.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Replaces an image with a new image exactly like ReplaceImage() but accepts a file buffer as input.

See ReplaceImage() for further information.

If the function succeeds the return value is 1. If the function fails the return value is 0.

See also:

See also ReplaceImageEx function in DynaPDF manual.

DynaPDFMBS.ReplaceImageEx(ImageToReplace as DynaPDFImageMBS, ImageData as String, Index as Integer = 1, ColorSpace as Integer = 0, CSHandle as Integer = -1, Flags as Integer = 0) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method DynaPDF MBS DynaPDF Plugin 17.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Replaces an image with a new image exactly like ReplaceImage() but accepts a file buffer as input.

See ReplaceImage() for further information.

If the function succeeds the return value is 1. If the function fails the return value is 0.

See also:

See also ReplaceImageEx function in DynaPDF manual.

DynaPDFMBS.ReplacePageText(text as string, 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 deletes or replaces a text string of a content stream that was found by the function GetPageText() beforehand.

Be aware that ReplacePageText can't always replace text as encoding must match and fonts may not have the characters for the new text. For that better use ReplacePageTextEx.

If you have problems with asian characters, please make sure you use SetCMapDir and load the CMAPs.
Requires DynaPDF Pro license.

Some examples using this method:

See also ReplacePageText function in DynaPDF manual.

DynaPDFMBS.ReplacePageTextEx(text as string, 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 deletes or replaces a text string of a content stream that was found by the function GetPageText() beforehand.

The text parameter is converted to unicode.

If you have problems with asian characters, please make sure you use SetCMapDir and load the CMAPs.
Requires DynaPDF Pro license.

See also ReplacePageTextEx function in DynaPDF manual.

DynaPDFMBS.ReplacePageTextExAnsi(text as string, stack as DynaPDFStackMBS) as boolean   Deprecated

Type Topic Plugin Version macOS Windows Linux iOS Targets
method DynaPDF MBS DynaPDF Plugin 8.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
This item is deprecated and should no longer be used. You can use the non ANSI function instead.
The function deletes or replaces a text string of a content stream that was found by the function GetPageText() beforehand.

The text parameter is converted to ANSI.
Requires DynaPDF Pro license.

See also ReplacePageTextEx function in DynaPDF manual.

DynaPDFMBS.ResetAnnotAP(Handle as integer = -1) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method DynaPDF MBS DynaPDF Plugin 20.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Forces a rebuild of the appearance stream of the specified annotation.

If Handle is set to -1 all annotation appearances will be rebuild. This function be useful if an imported annotation has an invalid or empty appearance stream.

See also ResetAnnotAP function in DynaPDF manual.

DynaPDFMBS.ResetEncryptionSettings as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method DynaPDF MBS DynaPDF Plugin 17.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Resets the encryption settings which were imported from an external PDF file so that the PDF file in memory can be saved unencrypted.

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

See also ResetEncryptionSettings function in DynaPDF manual.

DynaPDFMBS.ResetLineDashPattern 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 resets a previously defined line dash pattern to its default value (straight line).

See also ResetLineDashPattern function in DynaPDF manual.

DynaPDFMBS.RestoreGraphicState 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 restores a previously saved graphics state.

See also RestoreGraphicState function in DynaPDF manual.

DynaPDFMBS.RotateCoords(alpha as Double, OriginX as Double, OriginY 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 rotates the coordinate system at the point OriginX, OriginY by applying a transformation matrix.

Please do not try to scale/skew/translate back later. use SaveGraphicState and RestoreGraphicState.

Some examples using this method:

See also RotateCoords function in DynaPDF manual.

DynaPDFMBS.RotateTemplate(OldTemplate as Integer, Rotation as Integer, RotateCoords as boolean = true) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method DynaPDF MBS DynaPDF Plugin 17.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Rotates a template.

Returns a new template handle.
This is a convenience function which creates a new template and draws the existing template there with rotation.
Returns negative number for errors. The plugin uses -1 for plugin errors like wrong rotation angle.

RotateCoords: Whether to rotate coordinate system.
This is now done by DynaPDF automatically, so for current version of the library, this must be false. But older versions need the true.

Some examples using this method:

DynaPDFMBS.RoundRect(PosX as Double, PosY as Double, Width as Double, Height as Double, Radius as Double, FillMode as Integer) 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 draws a rectangle with rounded corners.
Example
Var pdf as new DynaPDFMBS
Var f as FolderItem = SpecialFolder.Desktop.Child("Create PDF with Round Rectangles.pdf")

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

call pdf.CreateNewPDF f
call pdf.Append

Var PosX as Double = 100.0
Var PosY as Double = 100.0
Var Width as Double = 100.0
Var Height as Double = 100.0
Var Radius as Double = 20.0
Var FillMode as Integer = pdf.kfmFill

call pdf.RoundRect(PosX, PosY, Width, Height, Radius, FillMode)

PosX = 300.0
Var RadiusX as Double = 30.0
Var RadiusY as Double = 30.0

call pdf.RoundRectEx(PosX, PosY, Width, Height, RadiusX, RadiusY, FillMode)

call pdf.EndPage
call pdf.CloseFile

f.Launch

Some examples using this method:

See also RoundRect function in DynaPDF manual.

DynaPDFMBS.RoundRectEx(PosX as Double, PosY as Double, Width as Double, Height as Double, rWidth as Double, rHeight as Double, FillMode as Integer) 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 draws a rectangle with elliptical corners.
Example
Var pdf as new DynaPDFMBS
Var f as FolderItem = SpecialFolder.Desktop.Child("Create PDF with Round Rectangles.pdf")

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

call pdf.CreateNewPDF f
call pdf.Append

Var PosX as Double = 100.0
Var PosY as Double = 100.0
Var Width as Double = 100.0
Var Height as Double = 100.0
Var Radius as Double = 20.0
Var FillMode as Integer = pdf.kfmFill

call pdf.RoundRect(PosX, PosY, Width, Height, Radius, FillMode)

PosX = 300.0
Var RadiusX as Double = 30.0
Var RadiusY as Double = 30.0

call pdf.RoundRectEx(PosX, PosY, Width, Height, RadiusX, RadiusY, FillMode)

call pdf.EndPage
call pdf.CloseFile

f.Launch

Some examples using this method:

See also RoundRectEx function in DynaPDF manual.

Previous items

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


The biggest plugin in space...