Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server (Not)   Client   Old   Guides   Examples
New in version: 6.2   6.3   6.4   6.5   7.0   7.1   7.2   7.3   7.4   7.5    Statistic  

PDFKit.SetPDFPageRotation

Sets the rotation angle for the page in degrees.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
PDFKit 2.9 Yes No Yes, macOS only No No

MBS( "PDFKit.SetPDFPageRotation"; PDF; index; rotation )

Parameters

Parameter Description Example value
PDF A container value with the PDF content from a media field. Or a text with an URL. Or a PDF reference from PDFKit.Open.
index The index of the page. From zero to PDFKit.GetPDFPageCount-1. 1
rotation The new rotation value. 90

Result

Returns OK on success.

Description

Sets the rotation angle for the page in degrees.
The rotation must be a positive or negative multiple of 90 (negative angles are converted to their positive equivalents; for example, -90 is changed to 270).

Your changes are only done in memory, so please remember to write modified pdf back to disk, e.g. by using PDFKit.WriteToPath. Or use PDFKit.GetPDFDocument to get a PDF for storing in a container.

Examples

Rotate page and set title:

# open PDF from container
Set Variable [$ref; Value:MBS("PDFKit.OpenContainer"; combine pdf::result)]
# Set title for PDF
Set Variable [$result; Value:MBS("PDFKit.SetPDFAttribute"; $ref; "Title"; combine pdf::title)]
# Rotate first page by 90°
Set Variable [$result; Value:MBS("PDFKit.SetPDFPageRotation"; $ref; 0; 90)]
# save document to container
Set Field [combine pdf::result; MBS("PDFKit.GetPDFDocument"; $ref; "result.pdf")]
# free memory
Set Variable [$result; Value:MBS("PDFKit.Release"; $ref)]

See also


PDFKit.SetPDFPageDisplayAnnotation   -   PDFKit.SetPrintSetting

Feedback: Report problem or ask question.




Links
MBS Xojo Chart Plugins