Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
dart_pdf
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
David PHAM-VAN
2021-12-15 06:42:16 -0400
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
81f59be943ac60863026c2f527304fe5e8c73f4d
81f59be9
1 parent
e22f86cf
Fix directPrint printer selection on macOS
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
2 deletions
printing/CHANGELOG.md
printing/macos/Classes/PrintJob.swift
printing/CHANGELOG.md
View file @
81f59be
...
...
@@ -3,6 +3,7 @@
## 5.6.8
-
Fix print dialog crash on Linux
-
Fix directPrint printer selection on macOS
## 5.6.7
...
...
printing/macos/Classes/PrintJob.swift
View file @
81f59be
...
...
@@ -119,6 +119,9 @@ public class PrintJob: NSView, NSSharingServicePickerDelegate {
for
name
in
NSPrinter
.
printerNames
{
let
printer
=
NSPrinter
(
name
:
name
)
if
printer
==
nil
{
continue
}
let
pr
:
NSDictionary
=
[
"url"
:
name
,
"name"
:
name
,
...
...
@@ -143,12 +146,21 @@ public class PrintJob: NSView, NSSharingServicePickerDelegate {
printInfo
.
orientation
=
NSPrintInfo
.
PaperOrientation
.
landscape
}
// Print the custom view
// A printer is specified
if
printer
!=
nil
{
let
pr
=
NSPrinter
(
name
:
printer
!
)
if
pr
==
nil
{
printing
.
onCompleted
(
printJob
:
self
,
completed
:
false
,
error
:
"Unable to find the printer"
)
return
}
printInfo
.
printer
=
pr
!
}
// The custom print view
printOperation
=
NSPrintOperation
(
view
:
self
,
printInfo
:
printInfo
)
printOperation
!.
jobTitle
=
name
printOperation
!.
printPanel
.
options
=
[
.
showsPreview
]
if
printer
!=
nil
{
printInfo
.
printer
=
NSPrinter
(
name
:
printer
!
)
!
printOperation
!.
showsPrintPanel
=
false
printOperation
!.
showsProgressPanel
=
false
}
...
...
Please
register
or
login
to post a comment