David PHAM-VAN

Update README

... ... @@ -3,3 +3,5 @@
This set of plugin allows Flutter apps to generate and print pdf files to device printer.
This plugin works for iOS and Android.
* dart pdf: <https://pub.dartlang.org/packages/pdf>
* flutter printing: <https://pub.dartlang.org/packages/printing>
... ...
# 1.0.4
* Updated homepage
* Update source formatting
* Update README
# 1.0.3
* Remove dependency to ttf_parser
... ...
... ... @@ -4,6 +4,9 @@ This is a low-level Pdf creation library.
It can create a full multi-pages document with graphics,
images and text using TrueType fonts.
> Use `printing` package <https://pub.dartlang.org/packages/printing>
> for full flutter print and share operation.
The coordinate system is using the internal Pdf system:
* (0.0, 0.0) is bottom-left
* 1.0 is defined as 1 / 72.0 inch
... ... @@ -27,7 +30,7 @@ var file = new File('file.pdf');
file.writeAsBytesSync(pdf.save());
```
To load an image it is possible to use the dart library `image`
To load an image it is possible to use the dart library [image](https://pub.dartlang.org/packages/image):
```dart
Image image = decodeImage(new Io.File('test.webp').readAsBytesSync());
... ...
# 1.0.3
* Update source formatting
* Update README
# 1.0.2
* Add License file
... ...
# Printing
Plugin that allows Flutter apps to generate and print documents to android or ios compatible printers
Plugin that allows Flutter apps to generate and print
documents to android or ios compatible printers
## Getting Started
See the example on how to use the plugin.
For help getting started with Flutter, view our online
[documentation](https://flutter.io/).
> This plugin uses the `pdf` package <https://pub.dartlang.org/packages/pdf>
> for pdf creation. Please refer to <https://pub.dartlang.org/documentation/pdf/latest/>
> for documentation.
For help on editing plugin code, view the [documentation](https://flutter.io/developing-packages/#edit-plugin-package).
To load an image it is possible to use
[Image.toByteData](https://docs.flutter.io/flutter/dart-ui/Image/toByteData.html):
```dart
var Image im;
var bytes = await im.toByteData(format: ui.ImageByteFormat.rawRgba);
PDFImage image = PDFImage(
pdf,
image: bytes.buffer.asUint8List(),
width: im.width,
height: im.height);
g.drawImage(image, 100.0, 100.0, 80.0);
```
To use a TrueType font from a flutter bundle:
```dart
var font = await rootBundle.load("assets/open-sans.ttf");
PDFTTFFont ttf = new PDFTTFFont(pdf, font);
g.setColor(new PDFColor(0.3, 0.3, 0.3));
g.drawString(ttf, 20.0, "Dart is awesome", 50.0, 30.0);
```
... ...