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-03-06 08:57:51 -0400
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
297f1664011a28fe2dcf7ea49177d9b0b161690e
297f1664
1 parent
b1ee0be5
Fix Web print
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
13 deletions
printing/CHANGELOG.md
printing/lib/src/printing_web.dart → printing/lib/printing_web.dart
printing/pubspec.yaml
printing/CHANGELOG.md
View file @
297f166
...
...
@@ -4,6 +4,7 @@
-
Fix iOS/macOS release build not working
-
Fix some linting issues
-
Fix Web print
## 5.0.1
...
...
printing/lib/
src/
printing_web.dart → printing/lib/printing_web.dart
View file @
297f166
...
...
@@ -28,12 +28,12 @@ import 'package:flutter_web_plugins/flutter_web_plugins.dart';
import
'package:image/image.dart'
as
im
;
import
'package:pdf/pdf.dart'
;
import
'callback.dart'
;
import
'interface.dart'
;
import
'pdfjs.dart'
;
import
'printer.dart'
;
import
'printing_info.dart'
;
import
'raster.dart'
;
import
'src/callback.dart'
;
import
'src/interface.dart'
;
import
'src/pdfjs.dart'
;
import
'src/printer.dart'
;
import
'src/printing_info.dart'
;
import
'src/raster.dart'
;
/// Print plugin targetting Flutter on the Web
class
PrintingPlugin
extends
PrintingPlatform
{
...
...
@@ -120,10 +120,9 @@ class PrintingPlugin extends PrintingPlatform {
);
final
pdfUrl
=
html
.
Url
.
createObjectUrl
(
pdfFile
);
final
html
.
HtmlDocument
doc
=
js
.
context
[
'document'
];
// ignore: avoid_as
final
link
=
doc
.
createElement
(
'a'
)
as
html
.
AnchorElement
;
link
.
href
=
pdfUrl
;
final
link
=
html
.
AnchorElement
(
href:
pdfUrl
);
link
.
target
=
'_blank'
;
doc
.
body
?.
append
(
link
);
link
.
click
();
link
.
remove
();
return
true
;
...
...
@@ -141,10 +140,9 @@ class PrintingPlugin extends PrintingPlatform {
);
final
pdfUrl
=
html
.
Url
.
createObjectUrl
(
pdfFile
);
final
html
.
HtmlDocument
doc
=
js
.
context
[
'document'
];
// ignore: avoid_as
final
link
=
doc
.
createElement
(
'a'
)
as
html
.
AnchorElement
;
link
.
href
=
pdfUrl
;
final
link
=
html
.
AnchorElement
(
href:
pdfUrl
);
link
.
download
=
filename
;
doc
.
body
?.
append
(
link
);
link
.
click
();
link
.
remove
();
return
true
;
...
...
printing/pubspec.yaml
View file @
297f166
...
...
@@ -47,7 +47,7 @@ flutter:
macos
:
pluginClass
:
PrintingPlugin
web
:
fileName
:
src/
printing_web.dart
fileName
:
printing_web.dart
pluginClass
:
PrintingPlugin
windows
:
pluginClass
:
PrintingPlugin
...
...
Please
register
or
login
to post a comment