Showing
2 changed files
with
16 additions
and
0 deletions
| @@ -74,6 +74,16 @@ Or share the document to other applications: | @@ -74,6 +74,16 @@ Or share the document to other applications: | ||
| 74 | await Printing.sharePdf(bytes: pdf.save(), filename: 'my-document.pdf'); | 74 | await Printing.sharePdf(bytes: pdf.save(), filename: 'my-document.pdf'); |
| 75 | ``` | 75 | ``` |
| 76 | 76 | ||
| 77 | +To print an HTML document, simply do: | ||
| 78 | + | ||
| 79 | +```dart | ||
| 80 | +await Printing.layoutPdf( | ||
| 81 | + onLayout: (PdfPageFormat format) async => await Printing.convertHtml( | ||
| 82 | + format: format, | ||
| 83 | + html: '<html><body><p>Hello!</p></body></html>', | ||
| 84 | + )); | ||
| 85 | +``` | ||
| 86 | + | ||
| 77 | ## Installing | 87 | ## Installing |
| 78 | 88 | ||
| 79 | 1. Add this to your package's `pubspec.yaml` file: | 89 | 1. Add this to your package's `pubspec.yaml` file: |
-
Please register or login to post a comment