I have a very basic Mac application in Xcode with a Split View that contains a PDFThumbnailView and a PDFView. (Just like Preview.)
There's hardly any Swift code beyond what is required to load a PDF into the views.
However, when I select Print from the Print menu, the app wants to print the ThumbnailView, unless I click on the PDFView first.
Is there any way to always make it print the PDFView and never the ThumbnailView? I presume it's a setting or parameter somewhere in the Storyboard, rather than a bit of code as such.
Xcode 10.2.1 on Mojhave 10.14.5.
An easy solution would be to provide your own print method (like printContent:) on your controller, and in your XIB file change the target method for the print menu item to printContent: instead of print:
// eg.
@IBOutlet weak var pdfThumbnails: PDFThumbnailView!
@IBOutlet weak var pdfContent: PDFView!
...
@IBAction func printContent(_ sender: Any) {
self.pdfContent.printView(sender)
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With