PdfService constructor

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

Implementation

PdfService({
  required PDFPageFormat pageFormat,
  required List<pw.Font> fonts,
  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],
        ),
      );
}