Image
class Image: PDFElement
A PDF image element
-
The image to draw
Declaration
Swift
let image: NSImage -
The optional fixed size of the image
Declaration
Swift
let fixedSize: CGSize? -
The alignment
Declaration
Swift
let alignment: NSTextAlignment -
The optional offset
Declaration
Swift
let offset: CGSize -
Init the image element
Declaration
Swift
init(_ image: NSImage, size: CGSize? = nil, alignment: NSTextAlignment = .center, offset: CGSize = .zero)Parameters
imageThe
NSImageto drawsizethe optional size of the image
alignmentThe alignment of the image
offsetThe offset of the image
-
Draw the image
Declaration
Swift
func draw(rect: inout CGRect, calculationOnly: Bool, pageRect: CGRect)Parameters
rectThe available rectangle
calculationOnlyBool if only the size should be calculated
pageRectThe page size of the PDF document
View on GitHub