     context.dashStyle = DashStyle(pattern: [3])!
     context.lineWidth = 0.5
     
-    context.move(to: point)
-    context.line(to: point1)
-    context.strokePath()
+    context.stroke(Path().moving(to: point).appendingLine(to: point1))
     
     context.dashStyle = .straightLine
     context.lineWidth = 1.5
     
-    context.move(to: point)
-    context.curve(controlPoint1: point1, endPoint: point2)
-    context.strokePath()
+    context.stroke(Path().moving(to: point).appendingCurve(controlPoint1: point1, endPoint: point2))
     
     point = point + Vector(x: 0, y: -150)
     point1 = point1 + Vector(x: 0, y: -160)

let document = SwiftyHaru.PDFDocument()
let page = document.addPage()

page.drawPath { context in
    
    context.rectangle(x: 50, y: 50, width: page.width - 100, height: page.height - 110)
    context.strokePath()
}

func drawLine(in context: PDFPathContext, x: Float, y: Float, label: String) {
    
    context.move(toX: x, y: y - 15)
    context.line(toX: x + 220, y: y - 15)
    context.strokePath()
}

func drawLine2(in context: PDFPathContext, x: Float, y: Float, label: String) {
    
    context.move(toX: x + 30, y: y - 25)
    context.line(toX: x + 160, y: y - 25)
    context.strokePath()
}

func drawRect(in context: PDFPathContext, x: Float, y: Float, label: String) {
    
    context.rectangle(x: x, y: y - 40, width: 220, height: 25)
}

page.drawPath { context in
    
    context.lineWidth = 0
    drawLine(in: context, x: 60, y: 770, label: "lineWidth == 0")

    drawLine2(in: context, x: 60, y: 440, label: "LineCap.projectingSquare")
}

page.draw { context in
    
    context.lineWidth = 30
    context.strokeColor = #colorLiteral(red: 0, green: 0, blue: 0.4980392157, alpha: 1)
    
    context.lineJoin = .miter
    
    let miterPath = Path()
        .moving(toX: 120, y: 300)
        .appendingLine(toX: 160, y: 340)
        .appendingLine(toX: 200, y: 300)
    
    context.stroke(miterPath)
    
    context.lineJoin = .round
    
    let roundPath = Path()
        .moving(toX: 120, y: 195)
        .appendingLine(toX: 160, y: 235)
        .appendingLine(toX: 200, y: 195)
    
    context.stroke(roundPath)
    
    context.lineJoin = .bevel
    
    let bevelPath = Path()
        .moving(toX: 120, y: 90)
        .appendingLine(toX: 160, y: 130)
        .appendingLine(toX: 200, y: 90)
    
    context.stroke(bevelPath)
}

page.draw { context in
    context.lineWidth = 2
    context.strokeColor = .black
    context.fillColor = #colorLiteral(red: 0.7529411765, green: 0, blue: 0, alpha: 1)
    
    let strokeRectangle = constructRect(in: context, x: 300, y: 770, label: "Stroke")
    context.stroke(strokeRectangle)
    
    let fillRectangle = constructRect(in: context, x: 300, y: 720, label: "Fill")
    context.fill(fillRectangle)
    
    let fillStrokeRectangle = constructRect(in: context, x: 300, y: 670, label: "Fill and Stroke")
    context.fill(fillStrokeRectangle, stroke: true)
    
    let clipRectangle = constructRect(in: context, x: 300, y: 620, label: "Clip Rectangle")
    context.stroke(clipRectangle)
}

page.draw { context in
    
    var point = Point(x: 330, y: 440)
    var point1 = Point(x: 430, y: 530)
