David PHAM-VAN

Improve examples

... ... @@ -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));
... ...
... ... @@ -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(
... ...
... ... @@ -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);
... ...
... ... @@ -32,7 +32,7 @@ Future<Uint8List> download(String url) async {
}
void main() {
test('Pdf1', () async {
test('Pdf Jpeg', () async {
final PdfDocument pdf = PdfDocument();
final PdfPage page = PdfPage(pdf, pageFormat: PdfPageFormat.a4);
... ...
... ... @@ -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');
... ...
... ... @@ -20,7 +20,7 @@ import 'package:pdf/pdf.dart';
import 'package:test/test.dart';
void main() {
test('Pdf1', () {
test('Pdf Minimal', () {
final PdfDocument pdf = PdfDocument();
final PdfPage page = PdfPage(pdf, pageFormat: PdfPageFormat.a4);
... ...
... ... @@ -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));
... ...
... ... @@ -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));
... ...
... ... @@ -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');
... ...
... ... @@ -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(
... ...
... ... @@ -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());
... ...