Platforms to show: All Mac Windows Linux Cross-Platform
Back to DynaPDFMBS class.
DynaPDFMBS.PrintGetDevMode as String
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | DynaPDF | MBS DynaPDF Plugin | 17.2 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop only |
You can store this in a preferences file for next printing.
This is same data structure as in WindowsDeviceModeMBS class.
Some examples using this method:
DynaPDFMBS.PrintGetDevNames(byref Driver as String, byref Device as String, byref Output as String, byref DefaultFlag as Integer) as Boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | DynaPDF | MBS DynaPDF Plugin | 17.2 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop only |
Driver: File name (without the extension) of the device driver.
Device: Name of the device.
Output: Device name for the physical output medium (output port).
DefaultFlag: 1 if the selected printer is the default one.
Returns true on success or false on failure.
DynaPDFMBS.PrintPDFFile(TempDir as FolderItem, DocName as string, DCHandle as integer, Flags as Integer = 0, Margin as DynaPDFRectMBS = nil, PrintParams as DynaPDFPrintParamsMBS = nil) as Boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | DynaPDF | MBS DynaPDF Plugin | 15.1 | ❌ No | ✅ Yes | ❌ No | ❌ No | All |
Returns true on success and false on failure.
Flags can be a combination of the flag values kpffPrintAsImage, kpffDefault, kpffColor, kpffAutoRotateAndCenter and kpff1Bit.
Margin can be nil. If not nil, specifies the margins to use.
DCHandle is the handle of the graphics context.
If you only want to print a selection of pages, please only import those pages via ImportPDFPage function. Or use DeletePage to remove the pages you don't want to print.
Does not work with a graphics handle from Xojo 2016r4 and newer due to switch to DirectDraw APIs.
Or in other words, you can use a HDC handle from graphics class in Xojo 2016r3 and older to print PDF.
See also:
Some examples using this method:
See also PrintPDFFile function in DynaPDF manual.
DynaPDFMBS.PrintPDFFile(TempDir as FolderItem, DocName as string, PrinterName as String, Flags as Integer = 0, Margin as DynaPDFRectMBS = nil, PrintParams as DynaPDFPrintParamsMBS = nil) as Boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | DynaPDF | MBS DynaPDF Plugin | 17.2 | ❌ No | ✅ Yes | ❌ No | ❌ No | All |
Returns true on success and false on failure.
Flags can be a combination of the flag values kpffPrintAsImage, kpffDefault, kpffColor, kpffAutoRotateAndCenter and kpff1Bit.
Margin can be nil. If not nil, specifies the margins to use.
PrinterName is the name of the printer to use. The plugin will open the printer and print PDF there with default settings.
If you only want to print a selection of pages, please only import those pages via ImportPDFPage function. Or use DeletePage to remove the pages you don't want to print.
See also:
See also PrintPDFFile function in DynaPDF manual.
DynaPDFMBS.PrintPDFFileWithDialog(TempDir as FolderItem, DocName as string, Flags as Integer = 0, Margin as DynaPDFRectMBS = nil, PrintParams as DynaPDFPrintParamsMBS = nil, parentWindow as Window = nil) as Boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | DynaPDF | MBS DynaPDF Plugin | 17.2 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop only |
Returns true on success and false on failure.
Flags can be a combination of the flag values kpffPrintAsImage, kpffDefault, kpffColor, kpffAutoRotateAndCenter and kpff1Bit.
Margin can be nil. If not nil, specifies the margins to use.
Shows print dialog and allows user to set printer.
If you only want to print a selection of pages, please only import those pages via ImportPDFPage function. Or use DeletePage to remove the pages you don't want to print.
After this call you can use PrintGetDevNames and PrintGetDevMode to get printer settings.
And before this call you can use PrintSetDevMode and PrintSetDevNames to restore printer settings.
See also:
Some examples using this method:
DynaPDFMBS.PrintPDFFileWithDialog(TempDir as FolderItem, DocName as string, Flags as Integer, Margin as DynaPDFRectMBS, PrintParams as DynaPDFPrintParamsMBS, parentWindow as DesktopWindow) as Boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | DynaPDF | MBS DynaPDF Plugin | 22.0 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop only |
Returns true on success and false on failure.
Flags can be a combination of the flag values kpffPrintAsImage, kpffDefault, kpffColor, kpffAutoRotateAndCenter and kpff1Bit.
Margin can be nil. If not nil, specifies the margins to use.
Shows print dialog and allows user to set printer.
If you only want to print a selection of pages, please only import those pages via ImportPDFPage function. Or use DeletePage to remove the pages you don't want to print.
After this call you can use PrintGetDevNames and PrintGetDevMode to get printer settings.
And before this call you can use PrintSetDevMode and PrintSetDevNames to restore printer settings.
See also:
DynaPDFMBS.PrintPDFPage(PageNumber as Integer, DocName as string, DCHandle as integer, Flags as Integer = 0, Margin as DynaPDFRectMBS = nil, PrintParams as DynaPDFPrintParamsMBS = nil) as Boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | DynaPDF | MBS DynaPDF Plugin | 17.2 | ❌ No | ✅ Yes | ❌ No | ❌ No | All |
See PrintPDFFile for details and options.
See also:
DynaPDFMBS.PrintPDFPage(PageNumber as Integer, DocName as string, PrinterName as String, Flags as Integer = 0, Margin as DynaPDFRectMBS = nil, PrintParams as DynaPDFPrintParamsMBS = nil) as Boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | DynaPDF | MBS DynaPDF Plugin | 17.2 | ❌ No | ✅ Yes | ❌ No | ❌ No | All |
See PrintPDFFile for details and options.
Version 18.4 and newer use device mode set with DynaPDFMBS.PrintSetDevMode method for printer settings.
See also:
DynaPDFMBS.PrintPDFPageWithDialog(PageNumber as Integer, DocName as string, Flags as Integer = 0, Margin as DynaPDFRectMBS = nil, PrintParams as DynaPDFPrintParamsMBS = nil, parentWindow as Window = nil) as Boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | DynaPDF | MBS DynaPDF Plugin | 17.2 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop only |
See PrintPDFFileWithDialog for details and options.
See also:
Some examples using this method:
DynaPDFMBS.PrintPDFPageWithDialog(PageNumber as Integer, DocName as string, Flags as Integer, Margin as DynaPDFRectMBS, PrintParams as DynaPDFPrintParamsMBS, parentWindow as DesktopWindow) as Boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | DynaPDF | MBS DynaPDF Plugin | 22.0 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop only |
See PrintPDFFileWithDialog for details and options.
See also:
DynaPDFMBS.PrintSetDevMode(data as MemoryBlock) as Boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | DynaPDF | MBS DynaPDF Plugin | 18.5 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop only |
Returns true on success.
This is same data structure as in WindowsDeviceModeMBS class.
See also:
Some examples using this method:
DynaPDFMBS.PrintSetDevMode(data as String) as Boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | DynaPDF | MBS DynaPDF Plugin | 17.2 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop only |
Returns true on success.
This is same data structure as in WindowsDeviceModeMBS class.
See also:
DynaPDFMBS.PrintSetDevNames(Driver as String, Device as String, Output as String, DefaultFlag as Integer) as Boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | DynaPDF | MBS DynaPDF Plugin | 17.2 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop only |
Driver: File name (without the extension) of the device driver.
Device: Name of the device.
Output: Device name for the physical output medium (output port).
DefaultFlag: 1 if the selected printer is the default one.
Returns true on success or false on failure.
DynaPDFMBS.ReadImageFormat(FileName as folderitem, byref Width as Integer, byref Height as Integer, byref BitsPerPixel as Integer, byref UseZip as Boolean) as Boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | DynaPDF | MBS DynaPDF Plugin | 8.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Some examples using this method:
- /DynaPDF/Create PDF with Picture file
- /DynaPDF/Create PDF with Picture files
- /DynaPDF/Image to PDF/Batch Image to PDF
- /DynaPDF/Image to PDF/Batch Image to PDF console
- /DynaPDF/Image to PDF/Image to pdf
- /DynaPDF/Image to PDF/Multi Tiff to PDF
- /DynaPDF/JBig Test
See also ReadImageFormat function in DynaPDF manual.
DynaPDFMBS.ReadImageFormat2(FileName as folderitem, Index as Integer, byref Width as Integer, byref Height as Integer, byref BitsPerPixel as Integer, byref UseZip as Boolean) as Boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | DynaPDF | MBS DynaPDF Plugin | 8.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Some examples using this method:
- /DynaPDF/Image to PDF/Batch Image to PDF
- /DynaPDF/Image to PDF/Batch Image to PDF console
- /DynaPDF/Image to PDF/Multi Tiff to PDF
See also ReadImageFormat2 function in DynaPDF manual.
DynaPDFMBS.ReadImageFormatEx(hBitmap as Integer, byref Width as Integer, byref Height as Integer, byref BitsPerPixel as Integer, byref UseZip as Boolean) as Boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | DynaPDF | MBS DynaPDF Plugin | 8.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
See also ReadImageFormatEx function in DynaPDF manual.
DynaPDFMBS.ReadImageFormatFromBuffer(Buffer as memoryblock, Index as Integer, byref Width as Integer, byref Height as Integer, byref BitsPerPixel as Integer, byref UseZip as Boolean) as Boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | DynaPDF | MBS DynaPDF Plugin | 13.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
See also:
See also ReadImageFormatFromBuffer function in DynaPDF manual.
DynaPDFMBS.ReadImageFormatFromBuffer(Buffer as string, Index as Integer, byref Width as Integer, byref Height as Integer, byref BitsPerPixel as Integer, byref UseZip as Boolean) as Boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | DynaPDF | MBS DynaPDF Plugin | 8.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
See also:
See also ReadImageFormatFromBuffer function in DynaPDF manual.
DynaPDFMBS.ReadImageResolution(FileName as folderitem, Index as Integer, byref ResX as Integer, byref ResY 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 |
Some examples using this method:
See also ReadImageResolution function in DynaPDF manual.
DynaPDFMBS.ReadImageResolutionEx(Buffer as Memoryblock, Index as Integer, byref ResX as Integer, byref ResY as Integer) as Boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | DynaPDF | MBS DynaPDF Plugin | 13.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
See also:
See also ReadImageResolutionEx function in DynaPDF manual.
DynaPDFMBS.ReadImageResolutionEx(Buffer as string, Index as Integer, byref ResX as Integer, byref ResY 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 |
See also:
See also ReadImageResolutionEx function in DynaPDF manual.
DynaPDFMBS.Rectangle(PosX as Double, PosY as Double, Width as Double, Height 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 |
See also Rectangle function in DynaPDF manual.
DynaPDFMBS.ReEncryptPDF(File as folderitem, PwdType as Integer, InPwd as string, OpenPwd as string, OwnerPwd as string, KeyLen as Integer, Restrict 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 |
See also ReEncryptPDF function in DynaPDF manual.
DynaPDFMBS.ReEncryptPDFAnsi(Path as string, PwdType as Integer, InPwd as string, OpenPwd as string, OwnerPwd as string, KeyLen as Integer, Restrict as Integer) as Integer Deprecated
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | DynaPDF | MBS DynaPDF Plugin | 12.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Same as ReEncryptPDF, but takes path name in Windows ANSI encoding.
See also ReEncryptPDF function in DynaPDF manual.
DynaPDFMBS.RenameSpotColor(Colorant as string, NewName as string) as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | DynaPDF | MBS DynaPDF Plugin | 10.4 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Strings are converted to UTF-8.
See also RenameSpotColor function in DynaPDF manual.
DynaPDFMBS.RenderAnnotOrField(Handle as UInt32, IsAnnot as boolean, State as Integer, Matrix as DynaPDFMatrixMBS, Flags as Integer, PixFmt as Integer, Filter as Integer, byref Out as DynaPDFBitmapMBS) as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | DynaPDF | MBS DynaPDF Plugin | 14.4 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Please check dynapdf_help.pdf for details on RenderAnnotOrField function.
Plugin will fill out parameter only if result is zero.
Requires DynaPDF Pro license.
See also RenderAnnotOrField function in DynaPDF manual.
DynaPDFMBS.RenderPagePicture(PageNum as Integer) as picture
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | DynaPDF | MBS DynaPDF Plugin | 11.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Please note that for most cases RenderPageToImage and RenderPDFFile are better choices for rendering. Especially if you plan to compress images later anyway. And you avoid trouble with color matching. For this function to work correct you have to initialize DynaPDF with right color space for screen (Generic RGB on Mac and screen profile for Windows).
The picture size is set to the Cropbox. If no crop box is defined, it uses the media box.
Returns nil on any error.
If you render a lot of pages from the same PDF, consider using DynaPDFRasterizerMBS class as it's faster when you reuse the rasterizer.
Currently not available for Linux Desktop apps.
Requires DynaPDF Pro license.
For pages with orientation of 90 or 270 degree, the plugin will take that into account and swap width/height to have rendered picture have the riuht size.
See also:
Some examples using this method:
- /DynaPDF/Extract page Text area
- /DynaPDF/OCG/OCG Test
- /DynaPDF/Raster/Create and Render PDF
- /DynaPDF/Raster/Create and Render PDF in console
- /DynaPDF/Raster/DynaPDF Display PDF
- /DynaPDF/Raster/PDF Diff
- /DynaPDF/Raster/Render Tests/Render Test 1
- /DynaPDF/Show Differences
- /DynaPDF/StyledText Editor
- /DynaPDF/Tables/Dynamic Table/DynaPDF Table Multi Page
DynaPDFMBS.RenderPagePicture(PageNum as Integer, Width as Integer, Height as Integer, DefScale as Integer = 2, matrix as DynaPDFMatrixMBS = nil) as picture
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | DynaPDF | MBS DynaPDF Plugin | 11.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Please note that for most cases RenderPageToImage and RenderPDFFile are better choices for rendering. Especially if you plan to compress images later anyway. And you avoid trouble with color matching. For this function to work correct you have to initialize DynaPDF with right color space for screen (Generic RGB on Mac and screen profile for Windows).
The picture is created with the given size. The PDF page is scaled to fit size. You can use the constants kpsFitBest, kpsFitHeight or kpsFitWidth for the DefScale parameter. The matrix allows you to move, rotate or scale the PDF inside the picture.
Returns nil on any error.
If you render a lot of pages from the same PDF, consider using DynaPDFRasterizerMBS class as it's faster when you reuse the rasterizer.
Currently not available for Linux Desktop apps.
Requires DynaPDF Pro license.
If page is rotated, please swap width and height yourself.
See also:
DynaPDFMBS.RenderPageToImage(PageNumber as UInt32, OutFile as folderitem, Resolution as UInt32, Width as UInt32, Height as UInt32, Flags as UInt32, PixFmt as UInt32, Filter as UInt32, Format as UInt32) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | DynaPDF | MBS DynaPDF Plugin | 11.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
PixFmt: pass kpxf* constants like DynaPDFRasterizerMBS.kpxfRGB.
Filter: Pass kcf* constants like DynaPDFMBS.kcfJPEG.
Format: pass kifm* constants like DynaPDFMBS.kifmJPEG.
The page that should be rendered must be closed (Append() or EditPage() open a page and EndPage() closes a page).
If the parameter OutFile is set to nil the image is created in memory. In this case call GetImageBuffer() to retrieve the image buffer and finally FreeImageBuffer() to release it.
The output image size can be calculated in different ways:
- If Resolution is > 0 the image width and height is calculated according to the specified resolution. On a 32 bit machine it is possible to render pages in up to 1200 DPI depending on the page format. Larger resolutions require special techniques like banding to restrict the memory usage. However, no such feature is available in DynaPDF.
- If Width > 0 and if Height == 0 the image height is calculated according to the given width to archive an image with exact proportions.
- If Width == 0 and if Height > 0 then image width is calculated according to the given height to archive an image with exact proportions.
- If Width > 0 and if Height > 0 the image is scaled to the width and height.
The pixel format and the output image format must be compatible. Because TIFF is the only image format that supports different compression filters, the parameter Filter will be ignored for all other output formats.
If the function succeeds the return value is true. If the function fails the return value is false.
Requires DynaPDF Pro license.
Some examples using this method:
- /DynaPDF/Create Previews for folder
- /DynaPDF/DynaPDF Graphics/DynaPDF Graphics
- /DynaPDF/DynaPDF Graphics/DynaPDF Graphics Desktop
- /DynaPDF/DynaPDF Graphics/DynaPDF Graphics iOS
- /DynaPDF/DynaPDF Graphics/DynaPDF GraphicsPath
- /DynaPDF/DynaPDF Graphics/Reporting/GasReport/GasReport
- /DynaPDF/DynaPDF Graphics/Reporting/List Of Orders with Background
- /DynaPDF/JBig Test
- /DynaPDF/Raster/RenderPageToImage variants
- /DynaPDF/Rotate rotated PDF back
See also RenderPageToImage function in DynaPDF manual.
DynaPDFMBS.RenderPageToImageMT(PageNumber as UInt32, OutFile as folderitem, Resolution as UInt32, Width as UInt32, Height as UInt32, Flags as UInt32, PixFmt as UInt32, Filter as UInt32, Format as UInt32) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | DynaPDF | MBS DynaPDF Plugin | 14.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
PixFmt: pass kpxf* constants like DynaPDFRasterizerMBS.kpxfRGB.
Filter: Pass kcf* constants like DynaPDFMBS.kcfJPEG.
Format: pass kifm* constants like DynaPDFMBS.kifmJPEG.
The page that should be rendered must be closed (Append() or EditPage() open a page and EndPage() closes a page).
If the parameter OutFile is set to nil the image is created in memory. In this case call GetImageBuffer() to retrieve the image buffer and finally FreeImageBuffer() to release it.
The output image size can be calculated in different ways:
- If Resolution is > 0 the image width and height is calculated according to the specified resolution. On a 32 bit machine it is possible to render pages in up to 1200 DPI depending on the page format. Larger resolutions require special techniques like banding to restrict the memory usage. However, no such feature is available in DynaPDF.
- If Width > 0 and if Height == 0 the image height is calculated according to the given width to archive an image with exact proportions.
- If Width == 0 and if Height > 0 then image width is calculated according to the given height to archive an image with exact proportions.
- If Width > 0 and if Height > 0 the image is scaled to the width and height.
The pixel format and the output image format must be compatible. Because TIFF is the only image format that supports different compression filters, the parameter Filter will be ignored for all other output formats.
If the function succeeds the return value is true. If the function fails the return value is false.
Requires DynaPDF Pro license.
The work is performed on a preemptive thread, so this function does not block the application and can yield time to other Xojo threads. Must be called in a Xojo thread to enjoy benefits. If called in main thread will block, but keep other background threads running.
If you run several threads calling MT methods, you can get all CPU cores busy while main thread shows GUI with progress window.
Some examples using this method:
The items on this page are in the following plugins: MBS DynaPDF Plugin.