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
image
The
NSImage
to drawsize
the optional size of the image
alignment
The alignment of the image
offset
The offset of the image
-
Draw the image
Declaration
Swift
func draw(rect: inout CGRect, calculationOnly: Bool, pageRect: CGRect)
Parameters
rect
The available rectangle
calculationOnly
Bool if only the size should be calculated
pageRect
The page size of the PDF document