12345678910111213141516171819202122232425262728293031323334353637 |
- //
- // KMPrintDrawPage.swift
- // PDF Reader Pro
- //
- // Created by lizhe on 2023/2/13.
- //
- import Cocoa
- //typealias KMPrintDrawPageBlock = (_ box: CPDFDisplayBox, _ context: CGContext, _ pages: [KMPrintDrawPage]) -> Void
- typealias KMPrintDrawPageBlock = (_ box: PDFDisplayBox, _ context: CGContext, _ pages: [KMPrintDrawPage]) -> Void
- class KMPrintDrawPage: PDFPage {
- // var page: CPDFPage = CPDFPage()
- var page: PDFPage = PDFPage()
- var pages: [KMPrintDrawPage] = []
-
- var cropRect: CGRect = NSZeroRect
- var showRect: CGRect = NSZeroRect
-
- var point: CGPoint = NSMakePoint(1, 1)
-
- var drawPageBlock: KMPrintDrawPageBlock?
-
-
- override func draw(with box: PDFDisplayBox, to context: CGContext) {
- super.draw(with: box, to: context)
- self.drawPageBlock?(box, context, pages)
- }
- // override func draw(with box: CPDFDisplayBox, to context: CGContext!) {
- // super.draw(with: box, to: context)
- //
- // self.drawPageBlock?(box, context, pages)
- // }
- }
|