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
2018-12-07 08:48:21 -0500
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
182e6e96cde849626a2c44e5b1dace1351e9fcef
182e6e96
1 parent
7e5a3109
Fix some numeric conversion
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
pdf/lib/src/graphics.dart
pdf/lib/src/stream.dart
pdf/lib/src/graphics.dart
View file @
182e6e9
...
...
@@ -159,7 +159,7 @@ class PdfGraphics {
/// @param x coordinate
/// @param y coordinate
/// @oaran s String to draw
void
drawString
(
PdfFont
font
,
size
,
String
s
,
double
x
,
double
y
)
{
void
drawString
(
PdfFont
font
,
double
size
,
String
s
,
double
x
,
double
y
)
{
if
(!
page
.
fonts
.
containsKey
(
font
.
name
))
{
page
.
fonts
[
font
.
name
]
=
font
;
}
...
...
@@ -180,7 +180,8 @@ class PdfGraphics {
/// Set the transformation Matrix
void
setTransform
(
Matrix4
t
)
{
var
s
=
t
.
storage
;
buf
.
putString
(
"
${s[0]}
${s[1]}
${s[4]}
${s[5]}
${s[12]}
${s[13]}
cm
\n
"
);
buf
.
putNumList
(<
double
>[
s
[
0
],
s
[
1
],
s
[
4
],
s
[
5
],
s
[
12
],
s
[
13
]]);
buf
.
putString
(
" cm
\n
"
);
}
/// This adds a line segment to the current path
...
...
pdf/lib/src/stream.dart
View file @
182e6e9
...
...
@@ -19,6 +19,7 @@
part of
pdf
;
class
PdfStream
{
static
const
precision
=
5
;
final
_stream
=
List
<
int
>();
void
putStream
(
PdfStream
s
)
{
...
...
@@ -49,7 +50,11 @@ class PdfStream {
}
void
putNum
(
double
d
)
{
putString
(
d
.
toString
());
putString
(
d
.
toStringAsFixed
(
precision
));
}
void
putNumList
(
List
<
double
>
d
)
{
putString
(
d
.
map
((
v
)
=>
v
.
toStringAsFixed
(
precision
)).
join
(
" "
));
}
static
PdfStream
num
(
double
d
)
=>
PdfStream
()..
putNum
(
d
);
...
...
Please
register
or
login
to post a comment