pdf_export_print library

PDF打印组件库

一个功能强大、高度可定制的Flutter PDF生成组件库

Classes

AdapterModuleConfig
适配器模块配置类
Align
A widget that aligns its child within itself and optionally sizes itself based on the child's size.
Alignment
AlignmentDirectional
An offset that's expressed as a fraction of a Size, but whose horizontal component is dependent on the writing direction.
AlignmentGeometry
Base class for Alignment that allows for text-direction aware resolution.
Anchor
Annotation
AnnotationBuilder
AnnotationCircle
AnnotationInk
AnnotationPolygon
AnnotationSquare
AnnotationTextField
AnnotationUrl
AspectRatio
Barcode
Barcode generation class
BarcodeBar
Rectangle drawing operation
BarcodeEan
Base class to generate EAN Barcodes
BarcodeElement
Barcode drawing operation
BarcodeText
Text drawing operation
BarcodeWidget
Draw a barcode using String data
BarDataSet<T extends PointChartValue>
BaseModuleConfig
模块配置基类
Border
A border of a box, comprised of four sides: top, right, bottom, left.
BorderRadius
An immutable set of radii for each corner of a rectangle.
BorderRadiusDirectional
An immutable set of radii for each corner of a rectangle, but with the corners specified in a manner dependent on the writing direction.
BorderRadiusGeometry
Base class for BorderRadius that allows for text-direction aware resolution.
BorderSide
A side of a border of a box.
BorderStyle
BoxBorder
BoxConstraints
BoxDecoration
BoxShadow
Builder
A platonic widget that calls a closure to obtain its child widget.
Bullet
CartesianGrid
CellContent
单元格内容抽象基类
CellRenderContext
单元格渲染上下文
CellRenderer
单元格渲染器接口
CellRendererFactory
单元格渲染器工厂
Center
Chart
This widget is in preview and the API is subject to change
ChartGrid
ChartLegend
ChartValue
Checkbox
ChoiceField
Circle
CircleAnnotation
CircularProgressIndicator
ClipOval
ClipRect
ClipRRect
Column
ColumnLayout
CommonTableConfig
通用表格组件配置
CommonTableWidget
通用表格组件
ConstrainedBox
A widget that imposes additional constraints on its child.
Container
Context
CorporateTheme
企业主题
CustomPaint
CustomTableConfig
自定义表格布局配置
CustomTableLayout
自定义表格布局组件 支持完美的跨列布局效果
DataAdapter
数据适配器接口
DataAdapterConfig
数据适配器总配置类
DataMatrixEncoder
Encode DataMatrix messages
Dataset
DecoratedBox
DecorationGraphic
DecorationImage
DecorationSvgImage
DefaultTextStyle
DefaultTheme
默认样式主题
DelayedWidget
Directionality
Divider
Document
EdgeInsets
EdgeInsetsDirectional
An immutable set of offsets in each of the four cardinal directions, but whose horizontal components are dependent on the writing direction.
EdgeInsetsGeometry
Expanded
FieldConfig
字段配置类
FieldLabelConfig
字段标签配置类
FieldStyle
字段样式配置
FittedBox
Scales and positions its child within itself according to fit.
FittedSizes
The pair of sizes returned by applyBoxFit.
FixedAxis<T extends num>
FixedColumnWidth
FlatButton
Flex
FlexColumnWidth
FlexContext
Flexible
A widget that controls how a child of a Row, Column, or Flex flexes.
Font
Lazy font declaration, registers the font in the document only if needed. Tries to register a font only once
FooterConfig
页脚模块配置
FooterModule
页脚模块,用于显示页面底部信息
FractionalOffset
An offset that's expressed as a fraction of a PdfPoint.
FractionColumnWidth
FullPage
Gradient
A 2D gradient.
GridAxis
GridPaper
A widget that draws a rectilinear grid of lines. The grid is drawn over the child widget.
GridView
GridViewContext
Icon
A graphical icon widget drawn with a glyph from a font described in an IconData such as material's predefined IconDatas in Icons.
IconData
A description of an icon fulfilled by a font glyph.
IconThemeData
Defines the color, opacity, and size of icons.
Image
ImageCellRenderer
图片单元格渲染器
ImageContent
图片内容
ImageImage
ImageProvider
Identifies an image without committing to the precise final asset
ImageProxy
Inherited
InheritedDirectionality
InheritedWidget
InkAnnotation
InkList
InlineSpan
Inseparable
IntrinsicColumnWidth
LayoutBuilder
Builds a widget tree that can depend on the parent widget's size.
LayoutConstants
页面布局常量
LimitedBox
LinearGradient
A 2D linear gradient.
LinearProgressIndicator
A material design linear progress indicator, also known as a progress bar.
LineChartValue
LineDataSet<T extends PointChartValue>
ListView
LogoConfig
Logo模块配置
LogoConstants
Logo模块常量
LogoData
Logo数据模型
LogoModule
Logo模块,用于在PDF页面左上角显示Logo图片
Lorem
LoremText
MainTableConfig
主表模块配置
MainTableData
主表数据模型(同时支持主表和页脚)
MainTableModule
主表模块,用于显示6列表格形式的主表数据
MeCard
MeCard is a data file similar to vCard but used by NTT DoCoMo in Japan in QR code format for use with Cellular Phones. https://github.com/zxing/zxing/wiki/Barcode-Contents
MemoryImage
MeTuple
Tuple key/value for MeCard elements
ModuleDescriptor
模块描述符
MultiChildWidget
MultiPage
Create a multi-page section, with automatic overflow from one page to another
NewPage
Trigger a page break if there is not enough free space. If freeSpace is null, a page break is always performed.
Opacity
Outline
OverflowBox
Padding
Page
PageTheme
Paragraph
Partition
Partitions
PartitionsContext
PdfaAttachedFile
PdfaAttachedFiles
PdfaColorProfile
PdfaFacturxRdf
PdfAnnot
PdfAnnotBase
PdfAnnotCircle
PdfAnnotInk
PdfAnnotPolygon
PdfAnnotSign
PdfAnnotSquare
PdfAnnotText
PdfAnnotWidget
PdfaRdf
PdfBaseFunction
PdfBorder
Defines a border object
PdfButtonField
PdfChoiceField
PdfColor
Represents an RGB color
PdfColorCmyk
Represents an CMYK color
PdfColorGrey
PdfColorHsl
Represents an HSL color
PdfColorHsv
Same as HSB, Cylindrical geometries with hue, their angular dimension, starting at the red primary at 0°, passing through the green primary at 120° and the blue primary at 240°, and then wrapping back to red at 360°
PdfColors
Material design colors
PDFConfig
PDF配置类,定义PDF生成的全局配置
PDFConfigBuilder
PDF配置构建器
PDFContext
PDF上下文,提供渲染时的环境信息
PdfDocument
This class is the base of the Pdf generator. A PdfDocument class is created for a document, and each page, object, annotation, etc is added to the document. Once complete, the document can be written to a Stream, and the Pdf document's internal structures are kept in sync.
PdfDocumentParserBase
Base class for loading an existing PDF document.
PdfEncryption
Encryption object
PdfFont
Pdf font object
PdfFontMetrics
Describe dimensions for glyphs in a font
PdfFormField
PdfFunction
PdfGraphics
Pdf drawing operations
PdfGraphicState
Graphic state
PdfGraphicStates
Stores all the graphic states used in the document
PdfImage
Image object stored in the Pdf document
PdfInfo
Information object
PdfJpegInfo
Jpeg metadata extraction
PdfMetadata
Pdf Metadata
PDFModule
PDF模块抽象基类
PdfName
PdfOutline
Pdf Outline object
PdfPage
Page object, which will hold any contents for this page.
PdfPageFormat
PdfPageLabel
PdfPageLabels
Pdf PageLabels object
PdfPattern
PdfPoint
PDFPrintBuilder
PDF构建器主类
PdfRasterBase
Represents a bitmap image
PdfRect
PdfShading
PdfShadingPattern
PdfSignature
PdfSignatureBase
PdfSoftMask
PdfStitchingFunction
PdfTextField
PdfTtfFont
PieDataSet
PieGrid
Placeholder
PointChartValue
PointDataSet<T extends PointChartValue>
Polygon
PolygonAnnotation
PolyLineAnnotation
Positioned
A widget that controls where a child of a Stack is positioned.
PositionedDirectional
A widget that controls where a child of a Stack is positioned without committing to a specific TextDirection.
RadialGradient
A 2D radial gradient.
RadialGrid
Radius
A radius for either circular or elliptical shapes.
RawImage
Rectangle
RichText
RichTextContext
Row
Shape
Signature
SingleChildWidget
SizedBox
A box with a specified size.
Spacer
Spacer creates an adjustable, empty spacer that can be used to tune the spacing between widgets in a Flex container, like Row or Column.
SquareAnnotation
Stack
A widget that positions its children relative to the edges of its box.
StatelessWidget
StyleTheme
样式主题抽象类
SubTableConfig
子表模块配置
SubTableData
子表数据模型(同时支持子表和审批流)
SubTableModule
子表模块,用于显示可分页的数据表格
SvgImage
Table
A widget that uses the table layout algorithm for its children.
TableBorder
TableColumnWidth
TableConstants
表格模块常量
TableContext
TableField
表格字段数据模型
TableOfContent
TableRow
A horizontal group of cells in a Table.
Text
TextCellRenderer
文本单元格渲染器
TextContent
文本内容
TextDecoration
A linear decoration to draw near the text.
TextField
TextSpan
TextStyle
Theme
ThemeData
TitleConfig
标题模块配置
TitleConstants
标题模块常量
TitleData
标题数据模型
TitleModule
标题模块,用于显示多行居中的红色标题
TitleStyle
标题样式
Transform
TtfBitmapInfo
TtfFont
TtfGlyphInfo
TtfParser
TypeSafeDataAdapter
类型安全的数据适配器
ValidationResult
验证结果类
VerticalDivider
Watermark
WatermarkConfig
水印配置类
Widget
WidgetContext
WidgetSpan
Wrap
A widget that displays its children in multiple horizontal or vertical runs.
WrapContext

Enums

Axis
BarcodeCodabarStartStop
Start and Stop symbols for BCodabar
BarcodeQRCorrectionLevel
QR Code Correction Level
BarcodeTextAlign
Text alignement inside the BarcodeText zone
BarcodeType
Supported barcode types
BoxFit
BoxShape
CellContentType
单元格内容类型枚举
CrossAxisAlignment
DecorationPosition
FlexFit
FontStyle
FontWeight
MainAxisAlignment
MainAxisSize
ModuleType
PDF模块类型枚举
Overflow
Whether overflowing children should be clipped, or their overflow be visible.
PageOrientation
PaintPhase
Pdf417SecurityLevel
Error correction levels
PdfAnnotAppearance
PdfAnnotFlags
PdfAnnotHighlighting
PdfBlendMode
PdfBorderStyle
Border style
PdfExifTag
Possible Exif tags
PdfFieldFlags
PdfImageOrientation
Represents the position of the first pixel in the data stream This corresponds to the exif orientations
PdfLineCap
Specify the shape that shall be used at the ends of open sub paths and dashes, when they are stroked.
PdfLineJoin
Shape to be used at the corners of paths that are stroked
PdfOutlineMode
Outline mode
PdfOutlineStyle
Outline style
PdfPageLabelStyle
PdfPageMode
Display hint for the PDF viewer
PdfPageRotation
Page rotation
PdfShadingType
PdfSigFlags
Signature flags
PdfTextFieldAlign
PdfTextRenderingMode
Text rendering mode
PdfVersion
PDF version to generate
PieLegendPosition
StackFit
How to size the non-positioned children of a Stack.
TableCellVerticalAlignment
TableWidth
TextAlign
TextDecorationStyle
TextDirection
TextOverflow
How overflowing text should be handled.
TileMode
Defines what happens at the edge of the gradient.
TtfParserName
Type1Fonts
ValuePosition
VerticalDirection
WatermarkMode
水印模式枚举
WatermarkPosition
水印位置枚举(九宫格定位)
WatermarkType
水印类型枚举
WrapAlignment
How Wrap should align objects.
WrapCrossAlignment
Who Wrap should align children within a run in the cross axis.

Functions

applyBoxFit(BoxFit fit, PdfPoint inputSize, PdfPoint outputSize) FittedSizes
getEffectiveWidthPercentUtil(double? widthPercent) double
工具函数:获取有效的列宽百分比
transformPoint(Matrix4 transform, PdfPoint point) PdfPoint
transformRect(Matrix4 transform, PdfRect rect) PdfRect

Typedefs

BuildCallback = Widget Function(Context context)
BuildListCallback = List<Widget> Function(Context context)
CustomPainter = dynamic Function(PdfGraphics canvas, PdfPoint size)
DefaultThemeDataBuilder = ThemeData Function()
DeflateCallback = List<int> Function(List<int> data)
Callback used to compress the data
GridAxisBuildLabel = Widget Function(num value)
GridAxisFormat = String Function(num value)
Hyphenation = List<String> Function(String word)
IndexedWidgetBuilder = Widget Function(Context context, int index)
LayoutWidgetBuilder = Widget Function(Context context, BoxConstraints? constraints)
The signature of the LayoutBuilder builder function.
OnCell = Widget? Function(int index, dynamic data, int rowNum)
OnCellDecoration = BoxDecoration Function(int index, dynamic data, int rowNum)
OnCellFormat = String Function(int index, dynamic data)
OnCellTextStyle = TextStyle? Function(int index, dynamic data, int rowNum)
SvgCustomFontLookup = Font? Function(String fontFamily, String fontStyle, String fontWeight)
VisitorCallback = bool Function(InlineSpan span, TextStyle? parentStyle, AnnotationBuilder? annotation)
WidgetBuilder = Widget Function(Context context)

Exceptions / Errors

BarcodeException
Exception raised if the library cannot generate the Barcode
PDFBuildException
PDF构建异常
PdfException
A base exception for all PDF related exceptions.
PdfTooBigPageException
Exception thrown when generator populates more pages than maxPages of MultiPage.