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-11-24 08:27:29 -0500
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
a7a61711e4979220198cc4dc78d9c6303dcf38ae
a7a61711
1 parent
c7d9385a
Simplify PdfImage constructor
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
16 deletions
pdf/CHANGELOG.md
pdf/lib/src/compatibility.dart
pdf/lib/src/image.dart
pdf/CHANGELOG.md
View file @
a7a6171
...
...
@@ -13,6 +13,7 @@
-
Fix Page orientation
-
Add Ascii85 test
-
Add more warnings on type1 fonts
-
Simplify PdfImage constructor
## 1.3.23
...
...
pdf/lib/src/compatibility.dart
View file @
a7a6171
...
...
@@ -193,18 +193,14 @@ class PDFGraphics extends PdfGraphics {
@deprecated
class
PDFImage
extends
PdfImage
{
PDFImage
(
PdfDocument
pdfDocument
,
{
@required
Uint8List
image
,
@required
int
width
,
@required
int
height
,
bool
alpha
=
true
,
bool
alphaChannel
=
false
})
:
super
(
pdfDocument
,
image:
image
,
width:
width
,
height:
height
,
alpha:
alpha
,
alphaChannel:
alphaChannel
);
PDFImage
(
PdfDocument
pdfDocument
,
{
@required
Uint8List
image
,
@required
int
width
,
@required
int
height
,
bool
alpha
=
true
,
})
:
super
.
_
(
pdfDocument
,
image:
image
,
width:
width
,
height:
height
,
alpha:
alpha
);
}
@deprecated
...
...
pdf/lib/src/image.dart
View file @
a7a6171
...
...
@@ -23,8 +23,22 @@ class PdfImage extends PdfXObject {
/// @param width
/// @param height
/// @param alpha if the image is transparent
/// @param alphaChannel if this is transparency mask
PdfImage
(
PdfDocument
pdfDocument
,
factory
PdfImage
(
PdfDocument
pdfDocument
,
{
@required
Uint8List
image
,
@required
int
width
,
@required
int
height
,
bool
alpha
=
true
,
})
=>
PdfImage
.
_
(
pdfDocument
,
image:
image
,
width:
width
,
height:
height
,
alpha:
alpha
,
);
PdfImage
.
_
(
PdfDocument
pdfDocument
,
{
@required
this
.
image
,
@required
this
.
width
,
@required
this
.
height
,
...
...
@@ -42,7 +56,7 @@ class PdfImage extends PdfXObject {
params
[
'/Name'
]
=
PdfStream
.
string
(
_name
);
if
(
alphaChannel
==
false
&&
alpha
)
{
final
PdfImage
_sMask
=
PdfImage
(
pdfDocument
,
final
PdfImage
_sMask
=
PdfImage
.
_
(
pdfDocument
,
image:
image
,
width:
width
,
height:
height
,
...
...
@@ -103,7 +117,7 @@ class PdfImage extends PdfXObject {
offset
+=
len
-
2
;
}
return
PdfImage
(
pdfDocument
,
return
PdfImage
.
_
(
pdfDocument
,
image:
image
,
width:
width
,
height:
height
,
jpeg:
true
,
alpha:
false
);
}
...
...
Please
register
or
login
to post a comment