PDFElement
protocol PDFElement
Protocol for elements to create a PDF
-
shouldPageBreak(rect:Default implementationpageRect: ) Check if a
PDFElementfits on the current page or if it should breakDefault Implementation
Check if a
PDFElementfits on the current page or if it should breakDeclaration
Swift
func shouldPageBreak(rect: CGRect, pageRect: CGRect) -> BoolParameters
rectThe available rectangle
pageRectThe rect of the page
Return Value
Bool if the page should break
-
draw(rect:Default implementationcalculationOnly: pageRect: ) Draw the
PDFElementDefault Implementation
Draw the
PDFElementDeclaration
Swift
func draw(rect: inout CGRect, calculationOnly: Bool, pageRect: CGRect)Parameters
rectThe available rectangle
calculationOnlyBool if only the Bounding Rect should be calculated
pageRectThe size of the page
-
calculateDraw(rect:Default implementationelements: pageRect: ) Calculate the Rect Bounds for an
PDFElementarrayDefault Implementation
Calculate the Rect Bounds for an
PDFElementarrayDeclaration
Swift
func calculateDraw(rect: CGRect, elements: [PDFElement], pageRect: CGRect) -> CGRectParameters
rectThe available rectangle
elementsThe
PDFElementarraypageRectThe rect of the page
Return Value
The available rectangle after the drawing
-
stringToMarkdown(_:Default implementation) Convert a string into Markdown
Default Implementation
Convert a string into Markdown
Declaration
Swift
func stringToMarkdown(_ text: String) -> NSAttributedStringParameters
textThe text as String
Return Value
The Markdown text as
NSAttributedString -
textPaddingExtension methodThe default padding for text
Note
Static because it is used in initsDeclaration
Swift
var textPadding: Double -
textDrawingOptionsExtension methodThe default text drawing options
Declaration
Swift
var textDrawingOptions: NSString.DrawingOptions -
padding(_:Extension method) Add padding to a
PDFElementDeclaration
Swift
func padding(_ size: CGFloat) -> PDFElementParameters
sizeThe size of the padding
Return Value
A modified
PDFElement -
clip(_:Extension method) Add a clip shape around a
PDFElementDeclaration
Swift
func clip(_ shape: PDFBuild.ShapeStyle) -> PDFElementParameters
shapeThe style of the shape
Return Value
A modified
PDFElement
View on GitHub