David PHAM-VAN

Add Flutter example

@@ -9,6 +9,7 @@ @@ -9,6 +9,7 @@
9 * Add support for Jpeg images 9 * Add support for Jpeg images
10 * Fix numeric conversions in graphic operations 10 * Fix numeric conversions in graphic operations
11 * Add unicode support for annotations and info block 11 * Add unicode support for annotations and info block
  12 +* Add Flutter example
12 13
13 # 1.0.8 14 # 1.0.8
14 * Fix monospace TTF font loading 15 * Fix monospace TTF font loading
@@ -51,3 +51,12 @@ PdfTtfFont ttf = PdfTtfFont( @@ -51,3 +51,12 @@ PdfTtfFont ttf = PdfTtfFont(
51 g.setColor(PdfColor(0.3, 0.3, 0.3)); 51 g.setColor(PdfColor(0.3, 0.3, 0.3));
52 g.drawString(ttf, 20.0, "Dart is awesome", 50.0, 30.0); 52 g.drawString(ttf, 20.0, "Dart is awesome", 50.0, 30.0);
53 ``` 53 ```
  54 +
  55 +To save the image on Flutter, use the [path_provider](https://pub.dartlang.org/packages/path_provider) library:
  56 +
  57 +```dart
  58 +Directory tempDir = await getTemporaryDirectory();
  59 +String tempPath = tempDir.path;
  60 +var file = File("$tempPath/file.pdf");
  61 +await file.writeAsBytes(pdf.save());
  62 +```