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-03-27 05:47:51 -0400
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
a48a0486ef405186d9605a14fb41bdb2220a3a0b
a48a0486
1 parent
67a83257
Add Creation Date
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
1 deletions
pdf/CHANGELOG.md
pdf/lib/src/info.dart
pdf/lib/src/stream.dart
pdf/pubspec.yaml
pdf/CHANGELOG.md
View file @
a48a048
# 1.3.7
*
Add Pdf Creation date
# 1.3.6
*
Fix TTF Font SubSetting
...
...
pdf/lib/src/info.dart
View file @
a48a048
...
...
@@ -47,6 +47,8 @@ class PdfInfo extends PdfObject {
}
else
{
params
[
'/Producer'
]
=
PdfStream
()..
putLiteral
(
_libraryName
);
}
params
[
'/CreationDate'
]
=
PdfStream
()..
putDate
(
DateTime
.
now
());
}
static
const
String
_libraryName
=
'https://github.com/DavBfr/dart_pdf'
;
...
...
pdf/lib/src/stream.dart
View file @
a48a048
...
...
@@ -144,6 +144,17 @@ class PdfStream {
putString
(
'['
+
values
.
join
(
' '
)
+
']'
);
}
void
putDate
(
DateTime
date
)
{
final
DateTime
utcDate
=
date
.
toUtc
();
final
String
year
=
utcDate
.
year
.
toString
().
padLeft
(
4
,
'0'
);
final
String
month
=
utcDate
.
month
.
toString
().
padLeft
(
2
,
'0'
);
final
String
day
=
utcDate
.
day
.
toString
().
padLeft
(
2
,
'0'
);
final
String
hour
=
utcDate
.
hour
.
toString
().
padLeft
(
2
,
'0'
);
final
String
minute
=
utcDate
.
minute
.
toString
().
padLeft
(
2
,
'0'
);
final
String
second
=
utcDate
.
second
.
toString
().
padLeft
(
2
,
'0'
);
putText
(
"D:
${year}${month}${day}${hour}${minute}${second}
Z"
);
}
void
putNumArray
(
List
<
double
>
values
)
{
putString
(
'['
);
putNumList
(
values
);
...
...
pdf/pubspec.yaml
View file @
a48a048
...
...
@@ -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.
6
version
:
1.3.
7
environment
:
sdk
:
"
>=2.1.0
<3.0.0"
...
...
Please
register
or
login
to post a comment