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-07-21 08:57:30 -0400
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
d1e8f789501602d7315e3391ab6d9fc50a68fef4
d1e8f789
1 parent
bf132a8d
Fix MultiPage with multiple save() calls
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
66 additions
and
2 deletions
pdf/CHANGELOG.md
pdf/lib/src/object_stream.dart
pdf/pubspec.yaml
pdf/test/all_tests.dart
pdf/test/widget_multipage_test.dart
pdf/CHANGELOG.md
View file @
d1e8f78
# Changelog
## 1.3.17
*
Fix MultiPage with multiple save() calls
## 1.3.16
*
Add better debugPaint on Align Widget
...
...
pdf/lib/src/object_stream.dart
View file @
d1e8f78
...
...
@@ -39,7 +39,7 @@ class PdfObjectStream extends PdfObject {
void
_prepare
()
{
super
.
_prepare
();
if
(
params
.
containsKey
(
'/Filter'
))
{
if
(
params
.
containsKey
(
'/Filter'
)
&&
_data
==
null
)
{
// The data is already in the right format
_data
=
buf
.
output
();
}
else
if
(
pdfDocument
.
deflate
!=
null
)
{
...
...
pdf/pubspec.yaml
View file @
d1e8f78
...
...
@@ -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.1
6
version
:
1.3.1
7
environment
:
sdk
:
"
>=2.1.0
<3.0.0"
...
...
pdf/test/all_tests.dart
View file @
d1e8f78
...
...
@@ -28,6 +28,7 @@ import 'type1_test.dart' as type1;
import
'widget_basic_test.dart'
as
widget_basic
;
import
'widget_clip_test.dart'
as
widget_clip
;
import
'widget_container_test.dart'
as
widget_container
;
import
'widget_multipage_test.dart'
as
widget_multipage
;
import
'widget_table_test.dart'
as
widget_table
;
import
'widget_test.dart'
as
widget
;
import
'widget_text_test.dart'
as
widget_text
;
...
...
@@ -47,6 +48,7 @@ void main() {
widget_basic
.
main
();
widget_clip
.
main
();
widget_container
.
main
();
widget_multipage
.
main
();
widget_table
.
main
();
widget_text
.
main
();
widget_theme
.
main
();
...
...
pdf/test/widget_multipage_test.dart
0 → 100644
View file @
d1e8f78
/*
* Copyright (C) 2017, David PHAM-VAN <dev.nfet.net@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
'dart:io'
;
import
'package:pdf/widgets.dart'
;
import
'package:test/test.dart'
;
List
<
Widget
>
lines
=
<
Widget
>[];
void
main
(
)
{
setUpAll
(()
{
for
(
int
i
=
0
;
i
<
200
;
i
++)
{
lines
.
add
(
Text
(
'Line
$i
'
));
}
});
test
(
'Pdf Widgets MultiPage'
,
()
{
Document
.
debug
=
true
;
final
Document
pdf
=
Document
();
pdf
.
addPage
(
MultiPage
(
build:
(
Context
context
)
=>
lines
));
final
File
file
=
File
(
'widgets-multipage.pdf'
);
file
.
writeAsBytesSync
(
pdf
.
save
());
final
File
file1
=
File
(
'widgets-multipage-1.pdf'
);
file1
.
writeAsBytesSync
(
pdf
.
save
());
});
test
(
'Pdf Widgets MonoPage'
,
()
{
Document
.
debug
=
true
;
final
Document
pdf
=
Document
();
pdf
.
addPage
(
Page
(
build:
(
Context
context
)
=>
Column
(
children:
lines
)));
final
File
file
=
File
(
'widgets-monopage.pdf'
);
file
.
writeAsBytesSync
(
pdf
.
save
());
final
File
file1
=
File
(
'widgets-monopage-1.pdf'
);
file1
.
writeAsBytesSync
(
pdf
.
save
());
});
}
...
...
Please
register
or
login
to post a comment