Xojo Conferences
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

Previous items Next items

DynaPDFMBS.PrintPDFFileWithDialog(TmpDir 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 Console & Web iOS
method DynaPDF MBS DynaPDF Plugin 17.2 No Yes No No No
Function: Prints current PDF file with dialog.
Notes:
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.

Feedback, Comments & Corrections

DynaPDFMBS.PrintPDFPage(PageNum 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 Console & Web iOS
method DynaPDF MBS DynaPDF Plugin 17.2 Yes Yes Yes Yes No
Function: Prints a page.
Notes: See PrintPDFFile for details and options.

See also:

Feedback, Comments & Corrections

DynaPDFMBS.PrintPDFPage(PageNum 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 Console & Web iOS
method DynaPDF MBS DynaPDF Plugin 17.2 Yes Yes Yes Yes No
Function: Prints a page.
Notes:
See PrintPDFFile for details and options.

Version 18.4 and newer use device mode set with DynaPDFMBS.PrintSetDevMode method for printer settings.

See also:

Feedback, Comments & Corrections

DynaPDFMBS.PrintPDFPageWithDialog(PageNum 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 Console & Web iOS
method DynaPDF MBS DynaPDF Plugin 17.2 Yes Yes Yes No No
Function: Prints a page with dialog.
Notes: See PrintPDFFileWithDialog for details and options.

Feedback, Comments & Corrections

DynaPDFMBS.PrintSetDevMode(data as String) as Boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method DynaPDF MBS DynaPDF Plugin 17.2 No Yes No No No
Function: Set last print dev mode.
Notes:
Returns true on success.
This is same data structure as in WindowsDeviceModeMBS class.

Feedback, Comments & Corrections

DynaPDFMBS.PrintSetDevNames(Driver as String, Device as String, Output as String, DefaultFlag as Integer) as Boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method DynaPDF MBS DynaPDF Plugin 17.2 No Yes No No No
Function: Sets printer device names.
Notes:
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.

Feedback, Comments & Corrections

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 Console & Web iOS
method DynaPDF MBS DynaPDF Plugin 8.0 Yes Yes Yes Yes No
Function: The function retrieves the most important properties of an image file.

Feedback, Comments & Corrections

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 Console & Web iOS
method DynaPDF MBS DynaPDF Plugin 8.0 Yes Yes Yes Yes No
Function: The function retrieves the most important properties of an image file.
Example:
// read image format and resolution and calculate physical size
dim bits as integer
dim useZip as Boolean
dim resX as integer = 0
dim resY as integer = 0
dim physHeight as integer
dim physWidth as integer
dim w as integer
dim h as integer

call pdf.ReadImageFormat2(Source, 1, w, h, bits, useZip)
call pdf.ReadImageResolution(Source, 1, resX, resY)

if (resX <> resY and resX > 0 and resY > 0) then
if (resX > resY) then
physWidth = w
physHeight = h \ (resX \ resY)
else
physWidth = w \ (resY \ resX)
physHeight = h
end if
else
physHeight = h
physWidth = w
end if

See also ReadImageFormat2 function in DynaPDF manual.

Feedback, Comments & Corrections

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 Console & Web iOS
method DynaPDF MBS DynaPDF Plugin 8.0 Yes Yes Yes Yes No
Function: The function retrieves the most important properties of a memory bitmap.

See also ReadImageFormatEx function in DynaPDF manual.

Feedback, Comments & Corrections

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 Console & Web iOS
method DynaPDF MBS DynaPDF Plugin 13.0 Yes Yes Yes Yes No
Function: The function retrieves the most important properties of an image in the same way as ReadImageFormat2(), but accepts an image buffer as input.

See also:

See also ReadImageFormatFromBuffer function in DynaPDF manual.

Feedback, Comments & Corrections

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 Console & Web iOS
method DynaPDF MBS DynaPDF Plugin 8.0 Yes Yes Yes Yes No
Function: The function retrieves the most important properties of an image in the same way as ReadImageFormat2(), but accepts an image buffer as input.

See also:

See also ReadImageFormatFromBuffer function in DynaPDF manual.

Feedback, Comments & Corrections

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 Console & Web iOS
method DynaPDF MBS DynaPDF Plugin 8.0 Yes Yes Yes Yes No
Function: The function retrieves the horizontal and vertical resolution of an image file.
Example:
// read image format and resolution and calculate physical size
dim bits as integer
dim useZip as Boolean
dim resX as integer = 0
dim resY as integer = 0
dim physHeight as integer
dim physWidth as integer
dim w as integer
dim h as integer

call pdf.ReadImageFormat2(Source, 1, w, h, bits, useZip)
call pdf.ReadImageResolution(Source, 1, resX, resY)

if (resX <> resY and resX > 0 and resY > 0) then
if (resX > resY) then
physWidth = w
physHeight = h \ (resX \ resY)
else
physWidth = w \ (resY \ resX)
physHeight = h
end if
else
physHeight = h
physWidth = w
end if

See also ReadImageResolution function in DynaPDF manual.

Feedback, Comments & Corrections

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 Console & Web iOS
method DynaPDF MBS DynaPDF Plugin 13.0 Yes Yes Yes Yes No
Function: The function retrieves the horizontal and vertical resolution of an image file in the same way as ReadImageResolution() but accepts an image buffer as input.

See also:

See also ReadImageResolutionEx function in DynaPDF manual.

Feedback, Comments & Corrections

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 Console & Web iOS
method DynaPDF MBS DynaPDF Plugin 8.0 Yes Yes Yes Yes No
Function: The function retrieves the horizontal and vertical resolution of an image file in the same way as ReadImageResolution() but accepts an image buffer as input.

See also:

See also ReadImageResolutionEx function in DynaPDF manual.

Feedback, Comments & Corrections

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 Console & Web iOS
method DynaPDF MBS DynaPDF Plugin 8.0 Yes Yes Yes Yes No
Function: This function draws a rectangle.

See also Rectangle function in DynaPDF manual.

Feedback, Comments & Corrections

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 Console & Web iOS
method DynaPDF MBS DynaPDF Plugin 8.0 Yes Yes Yes Yes No
Function: This function encrypts an already encrypted or unencrypted PDF file.

See also ReEncryptPDF function in DynaPDF manual.

Feedback, Comments & Corrections

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
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method DynaPDF MBS DynaPDF Plugin 12.2 Yes Yes Yes Yes No
Function: This function encrypts an already encrypted or unencrypted PDF file.
Notes: Same as ReEncryptPDF, but takes path name in Windows ANSI encoding.

See also ReEncryptPDF function in DynaPDF manual.

Feedback, Comments & Corrections

DynaPDFMBS.RenameSpotColor(Colorant as string, NewName as string) as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method DynaPDF MBS DynaPDF Plugin 10.4 Yes Yes Yes Yes No
Function: Renames a colorant.
Example:
// your instance
dim pdf as DynaPDFMBS

// rename the color
call pdf.RenameSpotColor("Magenta", "Magenta2")
Notes: Strings are converted to UTF-8.

See also RenameSpotColor function in DynaPDF manual.

Feedback, Comments & Corrections

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 Console & Web iOS
method DynaPDF MBS DynaPDF Plugin 14.4 Yes Yes Yes Yes No
Function: The function renders an annotation or field independent of the page.
Notes:
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.

Feedback, Comments & Corrections

DynaPDFMBS.RenderPagePicture(PageNum as Integer) as picture
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method DynaPDF MBS DynaPDF Plugin 11.1 Yes Yes Yes Yes No
Function: Renders a picture for the page with the given page number.
Example:
dim pdf as new MyDynaPDFMBS

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

// create in memory
call pdf.CreateNewPDF nil

// set import flags
call pdf.SetImportFlags pdf.kifImportAsPage

// open the PDF file
dim f as FolderItem = SpecialFolder.Desktop.Child("test.pdf")
call pdf.OpenImportFile(f, 0, "")

// import all the pages
call pdf.ImportPDFFile(1, 1.0, 1.0)

// and render first page
dim out as Picture = pdf.RenderPagePicture(1)

// display in window
Backdrop = out
Notes:
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.

See also:

Feedback, Comments & Corrections

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 Console & Web iOS
method DynaPDF MBS DynaPDF Plugin 11.1 Yes Yes Yes Yes No
Function: Renders a picture for the page with the given page number.
Example:
dim pdf as new MyDynaPDFMBS

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

// create in memory
call pdf.CreateNewPDF nil

// set import flags
call pdf.SetImportFlags pdf.kifImportAsPage

// open the PDF file
dim f as FolderItem = SpecialFolder.Desktop.Child("test.pdf")
call pdf.OpenImportFile(f, 0, "")

// import all the pages
call pdf.ImportPDFFile(1, 1.0, 1.0)

// and render first page with window size
dim out as Picture = pdf.RenderPagePicture(1, Width, Height)

// display in window
Backdrop = out
Notes:
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.

See also:

Feedback, Comments & Corrections

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 Console & Web iOS
method DynaPDF MBS DynaPDF Plugin 11.3 Yes Yes Yes Yes No
Function: The function renders a PDF page into an image.
Example:
dim pdf as new MyDynaPDFMBS // your DynaPDF subclass with Error event filled

// where to get PDF page
dim f as FolderItem = SpecialFolder.Desktop.Child("test.pdf")

// where to write
dim t as FolderItem = SpecialFolder.Desktop.Child("test.jpg")

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

call pdf.CreateNewPDF nil
call pdf.SetImportFlags(pdf.kifImportAll + pdf.kifImportAsPage)

// open file
call pdf.OpenImportFile(f,0,"")

// add page
call pdf.Append

// import the page
call pdf.ImportPageEx(1,1.0,1.0)
call pdf.EndPage

// render the page
call pdf.RenderPageToImage(1, t, 72, ImageView1.Width, ImageView1.Height, DynaPDFRasterImageMBS.krfDefault, DynaPDFRasterizerMBS.kpxfRGB, DynaPDFMBS.kcfJPEG, DynaPDFMBS.kifmJPEG)
Notes:
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.

Feedback, Comments & Corrections

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 Console & Web iOS
method DynaPDF MBS DynaPDF Plugin 14.1 Yes Yes Yes Yes No
Function: The function renders a PDF page into an image.
Notes:
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.

Must be called inside a Xojo (Real Studio) thread so time yields to main thread and you can keep the GUI running.
Requires DynaPDF Pro license.

Feedback, Comments & Corrections

DynaPDFMBS.RenderPageToPicture(PageNum as Integer, pic as picture, DefScale as Integer = 2, matrix as DynaPDFMatrixMBS = nil) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method DynaPDF MBS DynaPDF Plugin 11.1 Yes Yes Yes Yes No
Function: Renders the page into the given picture.
Example:
dim pdf as new MyDynaPDFMBS

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

// create in memory
call pdf.CreateNewPDF nil

// set import flags
call pdf.SetImportFlags pdf.kifImportAsPage

// open the PDF file
dim f as FolderItem = SpecialFolder.Desktop.Child("test.pdf")
call pdf.OpenImportFile(f, 0, "")

// import all the pages
call pdf.ImportPDFFile(1, 1.0, 1.0)

// create picture
dim out as new Picture(800, 600, 32)

// render first page in the existing picture
call pdf.RenderPageToPicture(1, out)

// display in window
Backdrop = out
Notes:
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).

This method draws into an existing picture. 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.

This does not work on Linux desktop targets as the plugin can't write into a picture there.

If you render a lot of pages from the same PDF, consider using DynaPDFRasterizerMBS class as it's faster when you reuse the rasterizer.
Requires DynaPDF Pro license.

Feedback, Comments & Corrections

DynaPDFMBS.RenderPDFFile(OutFile as folderitem, Resolution as UInt32, Flags as UInt32, PixFmt as UInt32, Filter as UInt32, Format as UInt32) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method DynaPDF MBS DynaPDF Plugin 11.2 Yes Yes Yes Yes No
Function: The function renders all PDF pages which are currently in memory and stores the result in a proprietary image format.
Example:
dim file as FolderItem = SpecialFolder.Desktop.Child("test.pdf")
dim pdf as new MyDynaPDFMBS

call pdf.CreateNewPDF nil
call pdf.OpenImportFile(file, 0, "")
call pdf.ImportPDFFile(1, 1.0, 1.0)

// create a TIFF file:

dim outfile as FolderItem = SpecialFolder.Desktop.Child("test.tif")

dim Flags as Integer = DynaPDFRasterImageMBS.krfDefault
dim PixFmt as Integer = DynaPDFRasterizerMBS.kpxfRGB
dim Format as Integer = DynaPDFMBS.kifmTIFF // use kifm* constants
dim Filter as Integer = DynaPDFMBS.kcfLZW // pick a compression scheme for the file format

call pdf.RenderPDFFile(outfile, 300, Flags, PixFmt, Filter, Format)

// create a folder of JPEG file:

dim outfolder as FolderItem = SpecialFolder.Desktop.Child("test files")
outfolder.CreateAsFolder

Flags = DynaPDFRasterImageMBS.krfDefault
PixFmt = DynaPDFRasterizerMBS.kpxfRGB
Format = DynaPDFMBS.kifmJPEG // use kifm* constants
Filter = DynaPDFMBS.kcfJPEG

call pdf.RenderPDFFile(outfolder, 300, Flags, PixFmt, Filter, Format)
Notes: Also check the dynapdf manual on the pdfRenderPDFFileA function (pdfRenderPDFFileW on Windows).

Feedback, Comments & Corrections

DynaPDFMBS.RenderPDFFileEx(OutFile as folderitem, Resolution as UInt32, Width as Integer, Height as Integer, Flags as UInt32, PixFmt as UInt32, Filter as UInt32, Format as UInt32) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method DynaPDF MBS DynaPDF Plugin 18.0 Yes Yes Yes Yes No
Function: Renders all PDF pages which are currently in memory and stores the result in a proprietary image format.
Notes:
The pages in memory could be imported from one or more external PDF files, e.g. with ImportPDFFile(), created with DynaPDF functions, or a combination of both.

The parameter OutFile can be a path to an existing directory or the file name of the output image. The latter type can be used with TIFF images because this format supports multi-page output. When a file path is used with a single page image format only the first page will be rendered.

The function checks whether the path is a directory or a file name.
The function can render pages in a specific resolution, or scale them to a given width or height.

Depending on which parameters are set the image size is calculated as follows:
  • Resolution > 0 and Width == 0 and Height == 0: Pages are rendered according to the given resolution. Note that PDF pages can be very large. Therefore, it is maybe not possible to render all pages in the whished resolution.
  • Resolution > 0 and Width < 0 and or Height < 0: Pages are rendered according to the given resolution. Negative values of Width and Height are interpreted as maximum width or height if Resolution is greater zero. Since PDF pages can be very large, it is recommended to set the maximum width and height to a value that is low enough so that no out of memory exception occurs, e.g. 5000 x 5000 pixels.
  • Resolution == 0 and Width > 0 or Height > 0: Pages are scaled to the given Width or Height. If Width and Height are greater zero then pages are scaled to that size independent of the original page format (not recommended). It is usually best to set the width or height to zero so that the function can calculate the missing value to preserve the aspect ratio.

On a 32 bit system it is possible to render PDF pages in RGB with up to around 1200 DPI, depending on the page format and available memory. The resolution of gray images can be higher but the encoder must be able to handle such large images. The PNG and bitmap encoders accept images in almost arbitrary resolutions but all other encoders can fail when the resolution is larger than about 2000 DPI.

The function calls the progress events.
Returns true on success or false on failure.

See also RenderPDFFileEx function in DynaPDF manual.

Feedback, Comments & Corrections

DynaPDFMBS.RenderPDFFileExMT(OutFile as folderitem, Resolution as UInt32, Width as Integer, Height as Integer, Flags as UInt32, PixFmt as UInt32, Filter as UInt32, Format as UInt32) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method DynaPDF MBS DynaPDF Plugin 18.0 Yes Yes Yes Yes No
Function: Renders all PDF pages which are currently in memory and stores the result in a proprietary image format.
Notes:
The pages in memory could be imported from one or more external PDF files, e.g. with ImportPDFFile(), created with DynaPDF functions, or a combination of both.

The parameter OutFile can be a path to an existing directory or the file name of the output image. The latter type can be used with TIFF images because this format supports multi-page output. When a file path is used with a single page image format only the first page will be rendered.

The function checks whether the path is a directory or a file name.
The function can render pages in a specific resolution, or scale them to a given width or height.

Depending on which parameters are set the image size is calculated as follows:
  • Resolution > 0 and Width == 0 and Height == 0: Pages are rendered according to the given resolution. Note that PDF pages can be very large. Therefore, it is maybe not possible to render all pages in the whished resolution.
  • Resolution > 0 and Width < 0 and or Height < 0: Pages are rendered according to the given resolution. Negative values of Width and Height are interpreted as maximum width or height if Resolution is greater zero. Since PDF pages can be very large, it is recommended to set the maximum width and height to a value that is low enough so that no out of memory exception occurs, e.g. 5000 x 5000 pixels.
  • Resolution == 0 and Width > 0 or Height > 0: Pages are scaled to the given Width or Height. If Width and Height are greater zero then pages are scaled to that size independent of the original page format (not recommended). It is usually best to set the width or height to zero so that the function can calculate the missing value to preserve the aspect ratio.

On a 32 bit system it is possible to render PDF pages in RGB with up to around 1200 DPI, depending on the page format and available memory. The resolution of gray images can be higher but the encoder must be able to handle such large images. The PNG and bitmap encoders accept images in almost arbitrary resolutions but all other encoders can fail when the resolution is larger than about 2000 DPI.

The function calls the progress events.
Returns true on success or false on failure.

Same as RenderPDFFile, but multithreaded.

Must be called inside a Xojo (Real Studio) thread so time yields to main thread and you can keep the GUI running.
Requires DynaPDF Pro license.

Feedback, Comments & Corrections

DynaPDFMBS.RenderPDFFileMT(OutFile as folderitem, Resolution as UInt32, Flags as UInt32, PixFmt as UInt32, Filter as UInt32, Format as UInt32) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method DynaPDF MBS DynaPDF Plugin 18.0 Yes Yes Yes Yes No
Function: The function renders all PDF pages which are currently in memory and stores the result in a proprietary image format.
Notes:
Same as RenderPDFFile, but multithreaded.
Also check the dynapdf manual on the pdfRenderPDFFileA function (pdfRenderPDFFileW on Windows).

Must be called inside a Xojo (Real Studio) thread so time yields to main thread and you can keep the GUI running.
Requires DynaPDF Pro license.

Feedback, Comments & Corrections

Previous items Next items

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




Links
MBS Xojo blog