Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

Platforms to show: All Mac Windows Linux Cross-Platform

DynaPDFPageMBS.BBox(type as Integer) as DynaPDFRectMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method DynaPDF MBS DynaPDF Plugin 11.1 Yes Yes Yes Yes No
Function: Returns the requested bounding box.
Notes:
use the constants kpbArtBox, kpbBleedBox, kpbCropBox, kpbMediaBox or kpbTrimBox.
Also check the dynapdf manual on the pdfGetPageBBox function.

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

Feedback, Comments & Corrections

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 Console & Web iOS
method DynaPDF MBS DynaPDF Plugin 12.1 Yes Yes Yes Yes No
Function: 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)
Notes:
This makes it possible to create the image in the required size so that it can be rendered without a border.

Also check the dynapdf manual on the rasCalcPagePixelSize function.

Feedback, Comments & Corrections

DynaPDFPageMBS.Constructor
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method DynaPDF MBS DynaPDF Plugin 15.0 Yes Yes Yes Yes No
Function: The private constructor.

Feedback, Comments & Corrections

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 Console & Web iOS
method DynaPDF MBS DynaPDF Plugin 16.4 Yes Yes Yes Yes No
Function: Calculates page width and height.

Feedback, Comments & Corrections

DynaPDFPageMBS.Orientation as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method DynaPDF MBS DynaPDF Plugin 11.1 Yes Yes Yes Yes No
Function: Returns the page orientation.
Notes: Also check the dynapdf manual on the pdfGetPageOrientation function.

Feedback, Comments & Corrections

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




Links
MBS Xojo Chart Plugins