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-02-27 09:37:58 -0500
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
c7b313697c2ddc23c2ad26d8e3bdd62003440465
c7b31369
1 parent
eaf237a5
Add available dimensions for PdfPageFormat
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
2 deletions
pdf/CHANGELOG.md
pdf/lib/src/page_format.dart
pdf/pubspec.yaml
pdf/CHANGELOG.md
View file @
c7b3136
# 1.3.4
*
Add available dimensions for PdfPageFormat
# 1.3.3
*
Fix a bug with the RichText Widget
*
Update code to Dart 2.1.0
...
...
pdf/lib/src/page_format.dart
View file @
c7b3136
...
...
@@ -66,8 +66,18 @@ class PdfPageFormat {
marginRight:
marginRight
??
this
.
marginRight
);
}
/// Total page dimensions
PdfPoint
get
dimension
=>
PdfPoint
(
width
,
height
);
/// Total page width excluding margins
double
get
availableWidth
=>
width
-
marginLeft
-
marginRight
;
/// Total page height excluding margins
double
get
availableHeight
=>
height
-
marginTop
-
marginBottom
;
/// Total page dimensions excluding margins
PdfPoint
get
availableDimension
=>
PdfPoint
(
availableWidth
,
availableHeight
);
PdfPageFormat
get
landscape
=>
width
>=
height
?
this
:
copyWith
(
width:
height
,
height:
width
);
...
...
@@ -85,6 +95,6 @@ class PdfPageFormat {
@override
String
toString
()
{
return
'
${width}
x
$height
'
;
return
'
Page
${width}
x
$height
margins:
$marginLeft
,
$marginTop
,
$marginRight
,
$marginBottom
'
;
}
}
...
...
pdf/pubspec.yaml
View file @
c7b3136
...
...
@@ -4,7 +4,7 @@ description: A pdf producer for Dart. It can create pdf files for both web or fl
homepage
:
https://github.com/DavBfr/dart_pdf/tree/master/pdf
repository
:
https://github.com/DavBfr/dart_pdf
issue_tracker
:
https://github.com/DavBfr/dart_pdf/issues
version
:
1.3.
3
version
:
1.3.
4
environment
:
sdk
:
"
>=2.1.0
<3.0.0"
...
...
Please
register
or
login
to post a comment