mirror of
https://github.com/kiwix/kiwix-apple.git
synced 2025-09-25 04:48:16 -04:00
Fix scaling
This commit is contained in:
parent
33b1d7a5f6
commit
6aeb8bfc77
@ -40,13 +40,9 @@ struct PrintButton: View {
|
||||
Button {
|
||||
Task {
|
||||
guard let url = await tempFileURL() else { return }
|
||||
let view = PDFView()
|
||||
let window = NSWindow()
|
||||
view.document = PDFDocument(url: url)
|
||||
window.setContentSize(view.frame.size)
|
||||
window.contentView = view
|
||||
window.center()
|
||||
view.print(with: .shared, autoRotate: true)
|
||||
let pdfDoc = PDFDocument(url: url)
|
||||
let operation = pdfDoc?.printOperation(for: .shared, scalingMode: .pageScaleToFit, autoRotate: true)
|
||||
operation?.run()
|
||||
}
|
||||
} label: {
|
||||
Label {
|
||||
|
Loading…
x
Reference in New Issue
Block a user