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
2019-05-11 08:00:05 -0400
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
771e362980cbb8c1bb3339e05d8dfc760b62dfc5
771e3629
1 parent
071f420d
Fix warnings in printing example
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
5 deletions
printing/example/lib/main.dart
printing/example/lib/viewer.dart
printing/example/lib/main.dart
View file @
771e362
...
...
@@ -35,9 +35,9 @@ class MyAppState extends State<MyApp> {
}
Future
<
void
>
_saveAsFile
()
async
{
Directory
appDocDir
=
await
getApplicationDocumentsDirectory
();
String
appDocPath
=
appDocDir
.
path
;
File
file
=
File
(
appDocPath
+
'/'
+
'document.pdf'
);
final
Directory
appDocDir
=
await
getApplicationDocumentsDirectory
();
final
String
appDocPath
=
appDocDir
.
path
;
final
File
file
=
File
(
appDocPath
+
'/'
+
'document.pdf'
);
print
(
'Save as file
${file.path}
...'
);
await
file
.
writeAsBytes
((
await
generateDocument
(
PdfPageFormat
.
a4
)).
save
());
Navigator
.
push
<
dynamic
>(
...
...
@@ -75,7 +75,7 @@ class MyAppState extends State<MyApp> {
Printing
.
layoutPdf
(
onLayout:
(
PdfPageFormat
format
)
{
final
pdf
.
Document
document
=
PdfDoc
();
final
image
=
PdfImage
(
document
.
document
,
final
PdfImage
image
=
PdfImage
(
document
.
document
,
image:
bytes
.
buffer
.
asUint8List
(),
width:
im
.
width
,
height:
im
.
height
);
...
...
printing/example/lib/viewer.dart
View file @
771e362
...
...
@@ -2,7 +2,6 @@ import 'dart:io';
import
'package:flutter/material.dart'
;
import
'package:flutter_full_pdf_viewer/flutter_full_pdf_viewer.dart'
;
import
'package:flutter_full_pdf_viewer/full_pdf_viewer_plugin.dart'
;
import
'package:flutter_full_pdf_viewer/full_pdf_viewer_scaffold.dart'
;
class
PdfViewer
extends
StatelessWidget
{
...
...
Please
register
or
login
to post a comment