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-10-30 15:16:35 -0400
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
5a302c61042b3a095a2d64e8e63b530669763a8a
5a302c61
1 parent
e127d087
Fix Pdf Raster on WEB
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
23 deletions
printing/CHANGELOG.md
printing/lib/src/printing_web.dart
printing/pubspec.yaml
printing/CHANGELOG.md
View file @
5a302c6
# Changelog
## 3.7.1
-
Fix Pdf Raster on WEB
## 3.7.0
-
Add beta support for Windows Desktop
...
...
printing/lib/src/printing_web.dart
View file @
5a302c6
...
...
@@ -193,9 +193,6 @@ class PrintingPlugin extends PrintingPlatform {
await
promiseToFuture
<
void
>(
page
.
render
(
renderContext
).
promise
);
// final Uint8ClampedList data =
// context.getImageData(0, 0, canvas.width, canvas.height).data;
// Convert the image to PNG
final
completer
=
Completer
<
void
>();
final
blob
=
await
canvas
.
toBlob
();
...
...
@@ -233,7 +230,7 @@ class _WebPdfRaster extends PdfRaster {
@override
Uint8List
get
pixels
{
if
(
_pixels
==
null
)
{
final
img
=
asImage
(
);
final
img
=
im
.
PngDecoder
().
decodeImage
(
png
);
_pixels
=
img
.
data
.
buffer
.
asUint8List
();
}
...
...
@@ -241,28 +238,14 @@ class _WebPdfRaster extends PdfRaster {
}
@override
Future
<
Image
>
toImage
()
{
final
comp
=
Completer
<
Image
>();
decodeImageFromPixels
(
png
,
width
,
height
,
PixelFormat
.
rgba8888
,
(
Image
image
)
=>
comp
.
complete
(
image
),
);
return
comp
.
future
;
Future
<
Image
>
toImage
()
async
{
final
codec
=
await
instantiateImageCodec
(
png
);
final
frameInfo
=
await
codec
.
getNextFrame
();
return
frameInfo
.
image
;
}
@override
Future
<
Uint8List
>
toPng
()
async
{
return
png
;
}
@override
im
.
Image
asImage
()
{
if
(
_pixels
!=
null
)
{
return
super
.
asImage
();
}
return
im
.
PngDecoder
().
decodeImage
(
png
);
}
}
...
...
printing/pubspec.yaml
View file @
5a302c6
...
...
@@ -4,7 +4,7 @@ description: Plugin that allows Flutter apps to generate and print documents to
homepage
:
https://github.com/DavBfr/dart_pdf/tree/master/printing
repository
:
https://github.com/DavBfr/dart_pdf
issue_tracker
:
https://github.com/DavBfr/dart_pdf/issues
version
:
3.7.
0
version
:
3.7.
1
environment
:
sdk
:
"
>=2.3.0
<3.0.0"
...
...
Please
register
or
login
to post a comment