Showing
2 changed files
with
5 additions
and
5 deletions
| @@ -35,7 +35,7 @@ public class PrintJob: UIPrintPageRenderer, UIPrintInteractionControllerDelegate | @@ -35,7 +35,7 @@ public class PrintJob: UIPrintPageRenderer, UIPrintInteractionControllerDelegate | ||
| 35 | super.init() | 35 | super.init() |
| 36 | } | 36 | } |
| 37 | 37 | ||
| 38 | - public override func drawPage(at pageIndex: Int, in _: CGRect) { | 38 | + override public func drawPage(at pageIndex: Int, in _: CGRect) { |
| 39 | let ctx = UIGraphicsGetCurrentContext() | 39 | let ctx = UIGraphicsGetCurrentContext() |
| 40 | let page = pdfDocument?.page(at: pageIndex + 1) | 40 | let page = pdfDocument?.page(at: pageIndex + 1) |
| 41 | ctx?.scaleBy(x: 1.0, y: -1.0) | 41 | ctx?.scaleBy(x: 1.0, y: -1.0) |
| @@ -67,7 +67,7 @@ public class PrintJob: UIPrintPageRenderer, UIPrintInteractionControllerDelegate | @@ -67,7 +67,7 @@ public class PrintJob: UIPrintPageRenderer, UIPrintInteractionControllerDelegate | ||
| 67 | controller.present(animated: true, completionHandler: completionHandler) | 67 | controller.present(animated: true, completionHandler: completionHandler) |
| 68 | } | 68 | } |
| 69 | 69 | ||
| 70 | - public override var numberOfPages: Int { | 70 | + override public var numberOfPages: Int { |
| 71 | let pages = pdfDocument?.numberOfPages ?? 0 | 71 | let pages = pdfDocument?.numberOfPages ?? 0 |
| 72 | return pages | 72 | return pages |
| 73 | } | 73 | } |
| @@ -41,7 +41,7 @@ public class PrintJob: NSView, NSSharingServicePickerDelegate { | @@ -41,7 +41,7 @@ public class PrintJob: NSView, NSSharingServicePickerDelegate { | ||
| 41 | } | 41 | } |
| 42 | 42 | ||
| 43 | // Return the number of pages available for printing | 43 | // Return the number of pages available for printing |
| 44 | - public override func knowsPageRange(_ range: NSRangePointer) -> Bool { | 44 | + override public func knowsPageRange(_ range: NSRangePointer) -> Bool { |
| 45 | setFrameSize(printOperation!.printPanel.printInfo.paperSize) | 45 | setFrameSize(printOperation!.printPanel.printInfo.paperSize) |
| 46 | setBoundsSize(printOperation!.printPanel.printInfo.paperSize) | 46 | setBoundsSize(printOperation!.printPanel.printInfo.paperSize) |
| 47 | range.pointee.length = pdfDocument?.numberOfPages ?? 0 | 47 | range.pointee.length = pdfDocument?.numberOfPages ?? 0 |
| @@ -49,7 +49,7 @@ public class PrintJob: NSView, NSSharingServicePickerDelegate { | @@ -49,7 +49,7 @@ public class PrintJob: NSView, NSSharingServicePickerDelegate { | ||
| 49 | } | 49 | } |
| 50 | 50 | ||
| 51 | // Return the drawing rectangle for a particular page number | 51 | // Return the drawing rectangle for a particular page number |
| 52 | - public override func rectForPage(_ page: Int) -> NSRect { | 52 | + override public func rectForPage(_ page: Int) -> NSRect { |
| 53 | self.page = pdfDocument?.page(at: page) | 53 | self.page = pdfDocument?.page(at: page) |
| 54 | return self.page?.getBoxRect(CGPDFBox.mediaBox) ?? NSZeroRect | 54 | return self.page?.getBoxRect(CGPDFBox.mediaBox) ?? NSZeroRect |
| 55 | } | 55 | } |
| @@ -68,7 +68,7 @@ public class PrintJob: NSView, NSSharingServicePickerDelegate { | @@ -68,7 +68,7 @@ public class PrintJob: NSView, NSSharingServicePickerDelegate { | ||
| 68 | printOperation!.runModal(for: window, delegate: self, didRun: #selector(printOperationDidRun(printOperation:success:contextInfo:)), contextInfo: nil) | 68 | printOperation!.runModal(for: window, delegate: self, didRun: #selector(printOperationDidRun(printOperation:success:contextInfo:)), contextInfo: nil) |
| 69 | } | 69 | } |
| 70 | 70 | ||
| 71 | - public override func draw(_: NSRect) { | 71 | + override public func draw(_: NSRect) { |
| 72 | if pdfDocument != nil { | 72 | if pdfDocument != nil { |
| 73 | let ctx = NSGraphicsContext.current?.cgContext | 73 | let ctx = NSGraphicsContext.current?.cgContext |
| 74 | if page != nil { | 74 | if page != nil { |
-
Please register or login to post a comment