dartlangeditorflutterflutter-appsflutter-examplesflutter-packageflutter-widgetquillquill-deltaquilljsreactquillrich-textrich-text-editorwysiwygwysiwyg-editor
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
626 B
23 lines
626 B
1 year ago
|
library quill_pdf_converter;
|
||
|
|
||
|
import 'package:dart_quill_delta/dart_quill_delta.dart';
|
||
|
import 'package:htmltopdfwidgets/htmltopdfwidgets.dart';
|
||
1 year ago
|
import 'package:meta/meta.dart';
|
||
1 year ago
|
import 'package:pdf/widgets.dart' as pw;
|
||
|
import 'package:quill_html_converter/quill_html_converter.dart';
|
||
|
|
||
|
/// Extension on [Delta] to add extra functions for converting to Pdf
|
||
|
extension DeltaPdfExt on Delta {
|
||
|
/// First convert to Html then to Pdf
|
||
1 year ago
|
@experimental
|
||
1 year ago
|
Future<List<pw.Widget>> toPdf() async {
|
||
|
final html = toHtml();
|
||
|
return HTMLToPdf().convert(
|
||
|
html,
|
||
|
fontFallback: [
|
||
|
pw.Font.symbol(),
|
||
|
],
|
||
|
);
|
||
|
}
|
||
|
}
|