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-01-01 14:03:37 -0400
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
093cc12184ee15b5156378ccf1d96e81acf52144
093cc121
1 parent
c2b0f549
Allow PdfPreview to send the actual paper size
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletions
printing/lib/src/pdf_preview.dart
printing/lib/src/pdf_preview.dart
View file @
093cc12
...
...
@@ -441,10 +441,20 @@ class _PdfPreviewState extends State<PdfPreview> {
}
Future
<
void
>
_print
()
async
{
var
format
=
pageFormat
;
if
(!
widget
.
canChangePageFormat
&&
pages
.
isNotEmpty
)
{
format
=
PdfPageFormat
(
pages
.
first
.
page
.
width
*
72
/
dpi
,
pages
.
first
.
page
.
height
*
72
/
dpi
,
marginAll:
5
*
PdfPageFormat
.
mm
,
);
}
final
result
=
await
Printing
.
layoutPdf
(
onLayout:
widget
.
build
,
name:
widget
.
pdfFileName
??
'Document'
,
format:
pageF
ormat
,
format:
f
ormat
,
);
if
(
result
&&
widget
.
onPrinted
!=
null
)
{
...
...
Please
register
or
login
to post a comment