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-02 18:40:36 -0500
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
6dd169b5798ca5ad634a731e9312012fa1e8bb4a
6dd169b5
1 parent
4739641b
Improve examples
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
11 additions
and
11 deletions
pdf/test/annotations.dart
pdf/test/colors.dart
pdf/test/complex_test.dart
pdf/test/jpeg_test.dart
pdf/test/metrics.dart
pdf/test/minimal_test.dart
pdf/test/ttf_test.dart
pdf/test/type1_test.dart
pdf/test/widget_test.dart
printing/example/lib/document.dart
printing/example/test/pdf_test.dart
pdf/test/annotations.dart
View file @
6dd169b
...
...
@@ -20,7 +20,7 @@ import 'package:pdf/pdf.dart';
import
'package:test/test.dart'
;
void
main
(
)
{
test
(
'Pdf'
,
()
{
test
(
'Pdf
Annotations
'
,
()
{
final
PdfDocument
pdf
=
PdfDocument
();
final
PdfPage
page
=
PdfPage
(
pdf
,
pageFormat:
const
PdfPageFormat
(
500
,
300
));
...
...
pdf/test/colors.dart
View file @
6dd169b
...
...
@@ -51,7 +51,7 @@ class Color extends StatelessWidget {
}
void
main
(
)
{
test
(
'Pdf'
,
()
{
test
(
'Pdf
Colors
'
,
()
{
final
Document
pdf
=
Document
(
title:
'Material Colors'
);
pdf
.
addPage
(
MultiPage
(
...
...
pdf/test/complex_test.dart
View file @
6dd169b
...
...
@@ -23,7 +23,7 @@ import 'package:test/test.dart';
import
'package:vector_math/vector_math_64.dart'
;
void
main
(
)
{
test
(
'Pdf'
,
()
{
test
(
'Pdf
Complex
'
,
()
{
final
Uint32List
img
=
Uint32List
(
10
*
10
);
img
.
fillRange
(
0
,
img
.
length
-
1
,
0x12345678
);
...
...
pdf/test/jpeg_test.dart
View file @
6dd169b
...
...
@@ -32,7 +32,7 @@ Future<Uint8List> download(String url) async {
}
void
main
(
)
{
test
(
'Pdf
1
'
,
()
async
{
test
(
'Pdf
Jpeg
'
,
()
async
{
final
PdfDocument
pdf
=
PdfDocument
();
final
PdfPage
page
=
PdfPage
(
pdf
,
pageFormat:
PdfPageFormat
.
a4
);
...
...
pdf/test/metrics.dart
View file @
6dd169b
...
...
@@ -58,7 +58,7 @@ void printMetrics(
}
void
main
(
)
{
test
(
'Pdf'
,
()
{
test
(
'Pdf
Font Metrics
'
,
()
{
final
Document
pdf
=
Document
();
final
File
ttfFont
=
File
(
'open-sans.ttf'
);
...
...
pdf/test/minimal_test.dart
View file @
6dd169b
...
...
@@ -20,7 +20,7 @@ import 'package:pdf/pdf.dart';
import
'package:test/test.dart'
;
void
main
(
)
{
test
(
'Pdf
1
'
,
()
{
test
(
'Pdf
Minimal
'
,
()
{
final
PdfDocument
pdf
=
PdfDocument
();
final
PdfPage
page
=
PdfPage
(
pdf
,
pageFormat:
PdfPageFormat
.
a4
);
...
...
pdf/test/ttf_test.dart
View file @
6dd169b
...
...
@@ -58,7 +58,7 @@ void printTextTtf(PdfGraphics canvas, String text, File ttfFont, double top) {
}
void
main
(
)
{
test
(
'Pdf'
,
()
{
test
(
'Pdf
TrueType
'
,
()
{
final
PdfDocument
pdf
=
PdfDocument
();
final
PdfPage
page
=
PdfPage
(
pdf
,
pageFormat:
const
PdfPageFormat
(
500
,
300
));
...
...
pdf/test/type1_test.dart
View file @
6dd169b
...
...
@@ -49,7 +49,7 @@ void printText(PdfGraphics canvas, String text, PdfFont font, double top) {
}
void
main
(
)
{
test
(
'Pdf'
,
()
{
test
(
'Pdf
Type1 Embedded Fonts
'
,
()
{
final
PdfDocument
pdf
=
PdfDocument
();
final
PdfPage
page
=
PdfPage
(
pdf
,
pageFormat:
const
PdfPageFormat
(
500
,
430
));
...
...
pdf/test/widget_test.dart
View file @
6dd169b
...
...
@@ -22,7 +22,7 @@ import 'package:pdf/widgets.dart';
import
'package:test/test.dart'
;
void
main
(
)
{
test
(
'Pdf'
,
()
{
test
(
'Pdf
Widgets
'
,
()
{
Document
.
debug
=
true
;
final
Document
pdf
=
Document
(
title:
'Widgets Test'
);
...
...
printing/example/lib/document.dart
View file @
6dd169b
...
...
@@ -111,7 +111,7 @@ Future<PdfDocument> generateDocument(PdfPageFormat format) async {
image:
const
fw
.
NetworkImage
(
'https://www.gravatar.com/avatar/00000000000000000000000000000000?d=mp&s=200'
),
onError:
(
dynamic
exception
,
StackTrace
stackTrace
)
{
print
(
'
error
'
);
print
(
'
Unable to download image
'
);
});
pdf
.
addPage
(
MyPage
(
...
...
printing/example/test/pdf_test.dart
View file @
6dd169b
...
...
@@ -7,7 +7,7 @@ import 'package:pdf/pdf.dart';
import
'package:printing_example/document.dart'
;
void
main
(
)
{
testWidgets
(
'
Generate the Pdf
document'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'
Pdf Generate the
document'
,
(
WidgetTester
tester
)
async
{
final
PdfDocument
pdf
=
await
generateDocument
(
PdfPageFormat
.
a4
);
final
File
file
=
File
(
'document.pdf'
);
file
.
writeAsBytesSync
(
pdf
.
save
());
...
...
Please
register
or
login
to post a comment