PDFConverter class

Constructors

PDFConverter({required PDFPageFormat params, required Delta document, required Delta? frontMatterDelta, required Delta? backMatterDelta, required List<CustomConverter> customConverters, required Future<Font> onRequestBoldFont(String), required Future<Font> onRequestBoldItalicFont(String), required Future<List<Font>?> onRequestFallbackFont(String)?, required Future<Font> onRequestFont(String), required Future<Font> onRequestItalicFont(String), required List<Font> fallbacks, double? blockQuotePaddingLeft, double? blockQuotePaddingRight, double? blockQuotethicknessDividerColor, PdfColor? blockQuoteBackgroundColor, PdfColor? blockQuoteDividerColor, TextStyle? blockQuoteTextStyle, PdfColor? codeBlockBackgroundColor, TextStyle? codeBlockNumLinesTextStyle, List<Rule>? customRules, Font? codeBlockFont, TextStyle? codeBlockTextStyle, ThemeData? themeData, String customDeltaToHTMLConverter(Delta)?, String customHTMLToMarkdownConverter(String)?, CustomPDFWidget? onDetectBlockquote, CustomPDFWidget? onDetectCodeBlock, CustomPDFWidget? onDetectAlignedParagraph, CustomPDFWidget? onDetectCommonText, CustomPDFWidget? onDetectHeaderAlignedBlock, CustomPDFWidget? onDetectHeaderBlock, CustomPDFWidget? onDetectImageBlock, CustomPDFWidget? onDetectInlineRichTextStyles, CustomPDFWidget? onDetectInlinesMarkdown, CustomPDFWidget? onDetectLink, CustomPDFWidget? onDetectList, ConverterOptions? convertOptions})

Properties

backMatterDelta → Delta?
This delta is used after the main content
final
blockQuoteBackgroundColor → PdfColor?
Customize the background of the blockquote
final
blockQuoteDividerColor → PdfColor?
Customize the left/right divider color to blockquotes
final
blockQuotePaddingLeft double?
Define the left space between divider and text
final
blockQuotePaddingRight double?
final
blockQuoteTextStyle → TextStyle?
Define the text style of the general blockquote. This overrides any style detected like: line-height, size, font families, color
final
blockQuotethicknessDividerColor double?
Define the width of the divider
final
codeBlockBackgroundColor → PdfColor?
Customize the background color of the code block
final
codeBlockFont → Font?
If you need just a different font to show your code blocks, use this font (by default is pw.Font.courier())
final
codeBlockNumLinesTextStyle → TextStyle?
Customize the style of the num lines in code block
final
codeBlockTextStyle → TextStyle?
If you need customize exactly how the code block looks, then you use this theme
final
convertOptions ConverterOptions?
These are the configurations used by vsc_quill_to_html to manage how use the attributes and add custom attrs You can check vsc_quill_to_delta_html documentation here: https://github.com/VisualSystemsCorp/vsc_quill_delta_to_html
final
customConverters List<CustomConverter>
CustomConverter allow devs to use custom regex patterns to detect and create custom widgets
final
customDeltaToHTMLConverter String Function(Delta)?
Used by PDF converter to transform delta to html. if you use your own delta implementation, use this to avoid conflicts
final
customHTMLToMarkdownConverter String Function(String)?
Used by PDF converter to transform formatted html to markdown By default, markdown contains html into it
final
customRules List<Rule>?
final
document → Delta
final
frontMatterDelta → Delta?
This delta is used before the main content
final
globalFontsFallbacks List<Font>
latefinal
hashCode int
The hash code for this object.
no setterinherited
onDetectAlignedParagraph CustomPDFWidget?
Detect html headers:
final
onDetectBlockquote CustomPDFWidget?
Detect html blockquote tag
final
onDetectCodeBlock CustomPDFWidget?
Detect html code tag
final
onDetectCommonText CustomPDFWidget?
Detect simple text like:
final
onDetectHeaderAlignedBlock CustomPDFWidget?
Detect html headers:
final
onDetectHeaderBlock CustomPDFWidget?
Detect simple: # header
final
onDetectImageBlock CustomPDFWidget?
final
onDetectInlineRichTextStyles CustomPDFWidget?
Detect Rich text styles like: size, spacing, font family
final
onDetectInlinesMarkdown CustomPDFWidget?
Detect classic inline markdown styles: bold italic underline strikethrough is not supported yet
final
Detect custom and common html links implementation like: link to google link to google
final
onDetectList CustomPDFWidget?
final
onRequestBoldFont Future<Font> Function(String)
A simple request font when converter detect a font
final
onRequestBoldItalicFont Future<Font> Function(String)
A simple request font when converter detect a font
final
onRequestFallbackFont Future<List<Font>?> Function(String)?
If this request is null, list is empty or is list null, will be used another by default
final
onRequestFont Future<Font> Function(String)
A simple request font when converter detect a font
final
onRequestItalicFont Future<Font> Function(String)
A simple request font when converter detect a font
final
params PDFPageFormat
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
themeData → ThemeData?
If you need to customize the theme of the pdf document, override this param
final

Methods

createDocument({DeltaAttributesOptions? deltaOptionalAttr, bool overrideAttributesPassedByUser = false, void onException(dynamic error)?, bool shouldProcessDeltas = true}) Future<Document?>
Creates the PDF document an return this one
createDocumentFile({required String path, void onException(dynamic error)?, void onSucessWrite([Object? data])?, DeltaAttributesOptions? deltaOptionalAttr, bool overrideAttributesPassedByUser = false, bool shouldProcessDeltas = true}) Future<void>
This Create the PDF document and write it to storage path
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

processDelta(Delta? delta, DeltaAttributesOptions options, bool overrideAttributesPassedByUser) → Delta?