PDFConverter constructor
PDFConverter({
- required PDFPageFormat pageFormat,
- required Delta document,
- TextDirection textDirection = TextDirection.ltr,
- Delta? frontMatterDelta,
- Delta? backMatterDelta,
- List<
CustomWidget> customBuilders = const <qpdf.CustomWidget>[], - Future<
Font> onRequestBoldFont()?, - Future<
Font> onRequestBoldItalicFont()?, - Future<
List< onRequestFallbackFont()?,Font> ?> - Future<
Font> onRequestFont()?, - Future<
Font> onRequestItalicFont()?, - required List<
Font> fallbacks, - double? blockQuotePaddingLeft,
- double? blockQuotePaddingRight,
- double? blockQuotethicknessDividerColor,
- PdfColor? blockQuoteBackgroundColor,
- PdfColor? blockQuoteDividerColor,
- TextStyle? blockQuoteTextStyle,
- PdfColor? codeBlockBackgroundColor,
- TextStyle? codeBlockNumLinesTextStyle,
- Font? codeBlockFont,
- TextStyle? codeBlockTextStyle,
- ThemeData? themeData,
- PDFWidgetBuilder<
List< ? onDetectBlockquote,InlineSpan> , Widget> - PDFWidgetBuilder<
List< ? onDetectCodeBlock,InlineSpan> , Widget> - PDFWidgetBuilder<
List< ? onDetectAlignedParagraph,InlineSpan> , Widget> - PDFWidgetBuilder<
Line, List< ? onDetectCommonText,InlineSpan> > - PDFWidgetBuilder<
List< ? onDetectHeaderBlock,InlineSpan> , Widget> - PDFWidgetBuilder<
Line, Widget> ? onDetectImageBlock, - PDFWidgetBuilder<
Line, List< ? onDetectInlineRichTextStyles,InlineSpan> > - PDFWidgetBuilder<
Line, List< ? onDetectLink,InlineSpan> > - PDFWidgetBuilder<
List< ? onDetectList,InlineSpan> , Widget>
Implementation
PDFConverter({
required this.pageFormat,
required this.document,
this.textDirection = TextDirection.ltr,
this.frontMatterDelta,
this.backMatterDelta,
this.customBuilders = const <qpdf.CustomWidget>[],
this.onRequestBoldFont,
this.onRequestBoldItalicFont,
this.onRequestFallbackFont,
this.onRequestFont,
this.onRequestItalicFont,
required List<pw.Font> fallbacks,
this.blockQuotePaddingLeft,
this.blockQuotePaddingRight,
this.blockQuotethicknessDividerColor,
this.blockQuoteBackgroundColor,
this.blockQuoteDividerColor,
this.blockQuoteTextStyle,
this.codeBlockBackgroundColor,
this.codeBlockNumLinesTextStyle,
this.codeBlockFont,
this.codeBlockTextStyle,
this.themeData,
this.onDetectBlockquote,
this.onDetectCodeBlock,
this.onDetectAlignedParagraph,
this.onDetectCommonText,
this.onDetectHeaderBlock,
this.onDetectImageBlock,
this.onDetectInlineRichTextStyles,
this.onDetectLink,
this.onDetectList,
}) : assert(pageFormat.height > 30, 'Page size height isn\'t valid'),
assert(pageFormat.width > 30, 'Page size width isn\'t valid'),
assert(pageFormat.marginBottom >= 0.0,
'Margin to bottom with value ${pageFormat.marginBottom}'),
assert(pageFormat.marginLeft >= 0.0,
'Margin to left with value ${pageFormat.marginLeft}'),
assert(pageFormat.marginRight >= 0.0,
'Margin to right with value ${pageFormat.marginRight}'),
assert(pageFormat.marginTop >= 0.0,
'Margin to tp with value ${pageFormat.marginTop}') {
globalFontsFallbacks = <pw.Font>[
...fallbacks,
pw.Font.helvetica(),
pw.Font.helveticaBold(),
pw.Font.helveticaOblique(),
pw.Font.symbol(),
pw.Font.times(),
pw.Font.timesBold(),
pw.Font.timesItalic(),
pw.Font.timesBoldItalic(),
pw.Font.courier(),
pw.Font.courierBold(),
pw.Font.courierOblique(),
pw.Font.courierBoldOblique(),
];
}