Platforms to show: All Mac Windows Linux Cross-Platform

Back to DynaPDFPageMBS class.

DynaPDFPageMBS.BBox(type as Integer) as DynaPDFRectMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method DynaPDF MBS DynaPDF Plugin 11.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Returns the requested bounding box.

use the constants kpbArtBox, kpbBleedBox, kpbCropBox, kpbMediaBox or kpbTrimBox.

If orientation gives you 90, 270, -90 or -270, you may want to swap width and height of the rectangle.

DynaPDFPageMBS.CalcPagePixelSize(DefScale as UInt32, Scale as single, FrameWidth as UInt32, FrameHeight as UInt32, Flags as UInt32, byref Width as UInt32, byref Height as UInt32)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method DynaPDF MBS DynaPDF Plugin 12.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The function calculates the image size of a page exactly in the way as RenderPage() does, if called with the same parameters.
Example
// your PDF environment
dim pdf as new DynaPDFMBS

// some PDF
dim file as FolderItem = SpecialFolder.Desktop.Child("test.pdf")

call pdf.CreateNewPDF(nil)

// We import all pages
call pdf.SetImportFlags(pdf.kifImportAsPage)
call pdf.OpenImportFile(file, 0, "")
call pdf.ImportPDFFile(1,1.0,1.0)

// get first page
dim p as DynaPDFPageMBS = pdf.GetPage(1)

// and calculate how big it would be:
dim PageWidth, PageHeight as UInt32

dim DefScale as UInt32 = DynaPDFMBS.kpsFitBest
dim Scale as Single = 1.0
dim Flags as Uint32 = DynaPDFRasterImageMBS.krfDefault

p.CalcPagePixelSize(DefScale, Scale, window1.Width, window1.Height, Flags, PageWidth, PageHeight)

MsgBox "PageWidth: "+str(PageWidth)+EndOfLine+"PageHeight: "+str(PageHeight)

This makes it possible to create the image in the required size so that it can be rendered without a border.

DynaPDFPageMBS.Constructor   Private

Type Topic Plugin Version macOS Windows Linux iOS Targets
method DynaPDF MBS DynaPDF Plugin 15.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The private constructor.

DynaPDFPageMBS.GetWidthHeight(Flags as UInt32, byref Width as Single, byref Height as Single, Rotate as Integer = 0) as DynaPDFRectMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method DynaPDF MBS DynaPDF Plugin 16.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Calculates page width and height.

DynaPDFPageMBS.SetBBox(type as integer, BBox as DynaPDFRectMBS) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method DynaPDF MBS DynaPDF Plugin 18.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Sets or changes the bounding box of a page.

This function is intended to be fast as possible. It requires no open page like DynaPDFMBS.SetBBox(), it does not change the default media or crop box, and it does not adjust the current coordinate system if the media box will be changed.

The function is useful if only one or more bounding boxes must be changed, whithout editing a page, or when a specific area of a page should be rendered. In the latter case change the crop box and restore it to the previous value when finish.
To delete a bounding box set the bounding box to 0, 0, 0, 0. The parameter BBox is required to be present, it cannot be nil.

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

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


The biggest plugin in space...