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
2022-01-16 09:07:32 -0400
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
578e6f2506ea00a7c33aaf6a67bc5d27007f2799
578e6f25
1 parent
60e65f83
Fix directPrint issue with iOS 15
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
14 deletions
printing/CHANGELOG.md
printing/ios/Classes/PrintJob.swift
printing/CHANGELOG.md
View file @
578e6f2
...
...
@@ -13,6 +13,7 @@
-
Enable usage of printer's settings on Windows
[
Alban Lecuivre
]
-
Update android projects (mavenCentral, compileSdkVersion 30, gradle:4.1.0)
-
Use syscall(SYS_memfd_create) instead of glibc function memfd_create
[
Obezyan
]
-
Fix directPrint issue with iOS 15
## 5.6.6
...
...
printing/ios/Classes/PrintJob.swift
View file @
578e6f2
...
...
@@ -70,20 +70,20 @@ public class PrintJob: UIPrintPageRenderer, UIPrintInteractionControllerDelegate
return
}
let
controller
=
UIPrintInteractionController
.
shared
controller
.
delegate
=
self
let
printInfo
=
UIPrintInfo
.
printInfo
()
printInfo
.
jobName
=
jobName
!
DispatchQueue
.
main
.
async
{
printInfo
.
outputType
=
.
general
}
if
orientation
!=
nil
{
printInfo
.
orientation
=
orientation
!
orientation
=
nil
}
controller
.
printInfo
=
printInfo
controller
.
printPageRenderer
=
self
DispatchQueue
.
main
.
async
{
[
self
]
in
let
controller
=
UIPrintInteractionController
.
shared
controller
.
delegate
=
self
let
printInfo
=
UIPrintInfo
.
printInfo
()
printInfo
.
jobName
=
jobName
!
printInfo
.
outputType
=
.
general
if
orientation
!=
nil
{
printInfo
.
orientation
=
orientation
!
orientation
=
nil
}
controller
.
printInfo
=
printInfo
controller
.
printPageRenderer
=
self
DispatchQueue
.
main
.
async
{
if
self
.
printerName
!=
nil
{
let
printerURL
=
URL
(
string
:
self
.
printerName
!
)
...
...
@@ -93,7 +93,14 @@ public class PrintJob: UIPrintPageRenderer, UIPrintInteractionControllerDelegate
}
let
printer
=
UIPrinter
(
url
:
printerURL
!
)
controller
.
print
(
to
:
printer
,
completionHandler
:
self
.
completionHandler
)
printer
.
contactPrinter
{
available
->
Void
in
if
!
available
{
printing
.
onCompleted
(
printJob
:
self
,
completed
:
false
,
error
:
"Printer not available"
)
return
}
controller
.
print
(
to
:
printer
,
completionHandler
:
self
.
completionHandler
)
}
}
else
{
controller
.
present
(
animated
:
true
,
completionHandler
:
self
.
completionHandler
)
}
...
...
Please
register
or
login
to post a comment