PdfService constructor

PdfService({
  1. required PDFPageFormat pageFormat,
  2. required List<Font> fonts,
  3. TextDirection textDirection = pw.TextDirection.ltr,
  4. Future<Font> onRequestBoldFont(
    1. String fontFamily
    )?,
  5. Future<Font> onRequestBothFont(
    1. String fontFamily
    )?,
  6. Future<List<Font>?> onRequestFallbacks(
    1. String fontFamily
    )?,
  7. Future<Font> onRequestFont(
    1. String fontFamily
    )?,
  8. Future<Font> onRequestItalicFont(
    1. String fontFamily
    )?,
  9. required List<CustomWidget> customBuilders,
  10. required Delta document,
  11. ThemeData? customTheme,
  12. Font? codeBlockFont,
  13. PdfColor? blockQuoteBackgroundColor,
  14. PdfColor? codeBlockBackgroundColor,
  15. TextStyle? codeBlockNumLinesTextStyle,
  16. TextStyle? codeBlockTextStyle,
  17. PdfColor? blockQuoteDividerColor,
  18. TextStyle? blockQuoteTextStyle,
  19. double? blockQuotePaddingLeft,
  20. double? blockQuotePaddingRight,
  21. double? blockQuotethicknessDividerColor,
  22. PDFWidgetBuilder<List<InlineSpan>, Widget>? onDetectBlockquote,
  23. PDFWidgetBuilder<List<InlineSpan>, Widget>? onDetectCodeBlock,
  24. PDFWidgetBuilder<List<InlineSpan>, Widget>? onDetectAlignedParagraph,
  25. PDFWidgetBuilder<Line, List<InlineSpan>>? onDetectCommonText,
  26. PDFWidgetBuilder<List<InlineSpan>, Widget>? onDetectHeaderBlock,
  27. PDFWidgetBuilder<Line, Widget>? onDetectImageBlock,
  28. PDFWidgetBuilder<Line, List<InlineSpan>>? onDetectInlineRichTextStyles,
  29. PDFWidgetBuilder<Line, List<InlineSpan>>? onDetectLink,
  30. PDFWidgetBuilder<List<InlineSpan>, Widget>? onDetectList,
  31. Delta? backM,
  32. Delta? frontM,
})

Implementation

PdfService({
  required PDFPageFormat pageFormat,
  required List<pw.Font> fonts,
  this.textDirection = pw.TextDirection.ltr,
  super.onRequestBoldFont,
  super.onRequestBothFont,
  super.onRequestFallbacks,
  super.onRequestFont,
  super.onRequestItalicFont,
  required super.customBuilders,
  required super.document,
  pw.ThemeData? customTheme,
  super.codeBlockFont,
  super.blockQuoteBackgroundColor,
  super.codeBlockBackgroundColor,
  super.codeBlockNumLinesTextStyle,
  super.codeBlockTextStyle,
  super.blockQuoteDividerColor,
  super.blockQuoteTextStyle,
  super.blockQuotePaddingLeft,
  super.blockQuotePaddingRight,
  super.blockQuotethicknessDividerColor,
  super.onDetectBlockquote,
  super.onDetectCodeBlock,
  super.onDetectAlignedParagraph,
  super.onDetectCommonText,
  super.onDetectHeaderBlock,
  super.onDetectImageBlock,
  super.onDetectInlineRichTextStyles,
  super.onDetectLink,
  super.onDetectList,
  super.backM,
  super.frontM,
}) {
  _fonts = fonts;
  defaultTextStyle = pw.TextStyle(
    fontSize: defaultFontSize.toDouble(),
    lineSpacing: 1.0,
    fontFallback: <pw.Font>[..._fonts],
  );
  _marginLeft = pageFormat.marginLeft;
  _marginBottom = pageFormat.marginBottom;
  _marginTop = pageFormat.marginTop;
  _marginRight = pageFormat.marginRight;
  _width = pageFormat.width;
  _height = pageFormat.height;
  pageWidth = pageFormat.width;
  pageHeight = pageFormat.height;
  defaultTheme = customTheme ??
      pw.ThemeData(
        softWrap: true,
        textAlign: pw.TextAlign.left,
        iconTheme: pw.IconThemeData.fallback(pw.Font.symbol()),
        overflow: pw.TextOverflow.span,
        defaultTextStyle: pw.TextStyle(
          color: PdfColors.black,
          fontWeight: pw.FontWeight.normal,
          fontStyle: pw.FontStyle.normal,
          letterSpacing: 0,
          wordSpacing: 1.0,
          lineSpacing: 1.0,
          height: 1,
          decoration: pw.TextDecoration.none,
          decorationColor: null,
          decorationStyle: pw.TextDecorationStyle.solid,
          decorationThickness: 1,
          renderingMode: PdfTextRenderingMode.fill,
          fontFallback: <pw.Font>[..._fonts],
        ),
      );
}