Stephen's Space


PDFLib

PDFLib provides a high-level interface to the PDFKit framework, allowing for easy PDF manipulation and modification. The library also provides functionalities such as PDF OCR, document enhancement, and more.

PDFLib Basics

Script Objects

PLPDF

Wrapper object around PDFKit functionality providing easy access to complex operations.

Instance Handlers
Handler Description
flip over axis into filePath Flips the PDF vertically or horizontally. axis must be one of X_AXIS, Y_AXIS, 0, or 1. filePath is an optional parameter specifying the file path to save the flipped PDF to. If filePath is not provided, the PDF is saved to the original file path.
rotate by degrees into filePath Rotates the PDF clockwise by the specified amount of degrees. degrees must be a real number. filePath is an optional parameter specifying the file path to save the rotated PDF to. If filePath is not provided, the PDF is saved to the original file path.
save in filePath Saves the PDF at the provided file path using the specified file type. If the PDF was loaded from a local file, filePath defaults to the original file path. Returns true if the PDF was saved successfully, false otherwise.
open Opens the PDF, accounting for any modifications. Returns true if the PDF was opened successfully, false otherwise.

Constants

Name Value Description
X_AXIS 1 The horizontal axis of the PDF; the line comprising the bottom edge of the PDF.
Y_AXIS 0 The vertical axis of the PDF; the line comprising the left edge of the PDF.