PDFImage
public class PDFImage : PDFDocumentObject
Image element for the PDF document.
Contains all information about an image, including the caption.
-
The actual image
Declaration
Swift
public var image: Image -
An instance of a
PDFTextsubclass. UsePDFSimpleTextfor a simple, container-based styled caption andPDFAttributedTextfor advanced styling.Declaration
Swift
public var caption: PDFText? -
The size of the image in the PDF document
Declaration
Swift
public var size: CGSize -
Defines how the image will fit if not enough space is given
Declaration
Swift
public var sizeFit: PDFImageSizeFit -
JPEG quality of image.
Value ranges between 0.0 and 1.0, maximum quality equals 1.0
Declaration
Swift
public var quality: CGFloat -
Options used for changing the image before drawing
Declaration
Swift
public var options: PDFImageOptions -
Optional corner radius, is used if the
optionsare set.Declaration
Swift
public var cornerRadius: CGFloat? -
Initializer to create a PDF image element.
Declaration
Swift
public init( image: Image, caption: PDFText? = nil, size: CGSize = .zero, sizeFit: PDFImageSizeFit = .widthHeight, quality: CGFloat = 0.85, options: PDFImageOptions = [.resize, .compress], cornerRadius: CGFloat? = nil )Parameters
imageImage which will be drawn
captionOptional instance of a
PDFTextsubclass, defaults tonilsizeSize of image, defaults to zero size
sizeFitDefines how the image will fit if not enough space is given, defaults to
PDFImageSizeFit.widthHeightqualityJPEG quality between 0.0 and 1.0, defaults to 0.85
optionsDefines if the image will be modified before rendering
cornerRadiusDefines the radius of the corners
-
Creates a new
PDFImagewith the same propertiesDeclaration
Swift
public var copy: PDFImage { get }
-
nodoc
Declaration
Swift
override public func isEqual(to other: PDFDocumentObject) -> Bool
-
nodoc
Declaration
Swift
override public func hash(into hasher: inout Hasher)
View on GitHub
Install in Dash