printing 1.0.6

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 91

Printing

Plugin that allows Flutter apps to generate and print documents to android or ios compatible printers

See the example on how to use the plugin.

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.

To load an image it is possible to use Image.toByteData:

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:

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);

1.0.6

  • Add screenshot example

1.0.5

  • Fix printing from pdf document

1.0.4

  • Update example for pdf 1.0.5
  • Add Contributing

1.0.3

  • Update source formatting
  • Update README

1.0.2

  • Add License file
  • Updated homepage

1.0.1

  • Fixed sdk version

1.0.0

  • Initial release.

example/README.md

Pdf Printing Example

Flutter example project

Getting Started

to generate the project files, run:

flutter create .

to run the example, start a simulator and run:

flutter run

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  printing: ^1.0.6

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter packages get

Alternatively, your editor might support flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:printing/printing.dart';
  
Version Uploaded Documentation Archive
1.0.6 Oct 28, 2018 Go to the documentation of printing 1.0.6 Download printing 1.0.6 archive
1.0.5 Sep 2, 2018 Go to the documentation of printing 1.0.5 Download printing 1.0.5 archive
1.0.4 Aug 21, 2018 Go to the documentation of printing 1.0.4 Download printing 1.0.4 archive
1.0.3 Aug 15, 2018 Go to the documentation of printing 1.0.3 Download printing 1.0.3 archive
1.0.2 Aug 15, 2018 Go to the documentation of printing 1.0.2 Download printing 1.0.2 archive
1.0.1 Aug 15, 2018 Go to the documentation of printing 1.0.1 Download printing 1.0.1 archive
1.0.0 Aug 14, 2018 Go to the documentation of printing 1.0.0 Download printing 1.0.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
82
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
91
Learn more about scoring.

We analyzed this package on Nov 14, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0
  • pana: 0.12.6
  • Flutter: 0.11.3

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.19.0 <3.0.0
flutter 0.0.0
pdf ^1.0.7 1.0.7
Transitive dependencies
collection 1.14.11
meta 1.1.6
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8