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
2020-05-27 18:50:16 -0400
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
8094496ba7f8ea2c464d11cf3485bd7d4845ade7
8094496b
1 parent
b0f45edf
Update swift code style
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
printing/ios/Classes/PrintJob.swift
printing/macos/Classes/PrintJob.swift
printing/ios/Classes/PrintJob.swift
View file @
8094496
...
...
@@ -35,7 +35,7 @@ public class PrintJob: UIPrintPageRenderer, UIPrintInteractionControllerDelegate
super
.
init
()
}
public
override
func
drawPage
(
at
pageIndex
:
Int
,
in
_
:
CGRect
)
{
override
public
func
drawPage
(
at
pageIndex
:
Int
,
in
_
:
CGRect
)
{
let
ctx
=
UIGraphicsGetCurrentContext
()
let
page
=
pdfDocument
?
.
page
(
at
:
pageIndex
+
1
)
ctx
?
.
scaleBy
(
x
:
1.0
,
y
:
-
1.0
)
...
...
@@ -67,7 +67,7 @@ public class PrintJob: UIPrintPageRenderer, UIPrintInteractionControllerDelegate
controller
.
present
(
animated
:
true
,
completionHandler
:
completionHandler
)
}
public
override
var
numberOfPages
:
Int
{
override
public
var
numberOfPages
:
Int
{
let
pages
=
pdfDocument
?
.
numberOfPages
??
0
return
pages
}
...
...
printing/macos/Classes/PrintJob.swift
View file @
8094496
...
...
@@ -41,7 +41,7 @@ public class PrintJob: NSView, NSSharingServicePickerDelegate {
}
// Return the number of pages available for printing
public
override
func
knowsPageRange
(
_
range
:
NSRangePointer
)
->
Bool
{
override
public
func
knowsPageRange
(
_
range
:
NSRangePointer
)
->
Bool
{
setFrameSize
(
printOperation
!.
printPanel
.
printInfo
.
paperSize
)
setBoundsSize
(
printOperation
!.
printPanel
.
printInfo
.
paperSize
)
range
.
pointee
.
length
=
pdfDocument
?
.
numberOfPages
??
0
...
...
@@ -49,7 +49,7 @@ public class PrintJob: NSView, NSSharingServicePickerDelegate {
}
// Return the drawing rectangle for a particular page number
public
override
func
rectForPage
(
_
page
:
Int
)
->
NSRect
{
override
public
func
rectForPage
(
_
page
:
Int
)
->
NSRect
{
self
.
page
=
pdfDocument
?
.
page
(
at
:
page
)
return
self
.
page
?
.
getBoxRect
(
CGPDFBox
.
mediaBox
)
??
NSZeroRect
}
...
...
@@ -68,7 +68,7 @@ public class PrintJob: NSView, NSSharingServicePickerDelegate {
printOperation
!.
runModal
(
for
:
window
,
delegate
:
self
,
didRun
:
#selector(
printOperationDidRun(printOperation:success:contextInfo:)
)
,
contextInfo
:
nil
)
}
public
override
func
draw
(
_
:
NSRect
)
{
override
public
func
draw
(
_
:
NSRect
)
{
if
pdfDocument
!=
nil
{
let
ctx
=
NSGraphicsContext
.
current
?
.
cgContext
if
page
!=
nil
{
...
...
Please
register
or
login
to post a comment