Topics   All   MacOS (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Deprecated   Guides   Examples   Videos
New in version: 9.3   9.4   9.5   10.0   10.1   10.2   10.3   10.4   10.5   10.6    Statistic    FMM    Blog  

PDFKit.SetPDFPageRotation

Sets the rotation angle for the page in degrees.

Component Version macOS Windows Linux Server FileMaker iOS SDK
PDFKit 2.9 Yes No No Yes, macOS only Yes
MBS( "PDFKit.SetPDFPageRotation"; PDF; index; rotation )   More

Parameters

Parameter Description Example
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

Created 18th August 2014, last changed 25th April 2016


PDFKit.SetPDFPageDisplayAnnotation   -   PDFKit.SetPrintOption

Feedback: Report problem or ask question.




Links
MBS Xojo Plugins

Start Chat