exportBytes function
Future<Uint8List>
exportBytes(
- DraftDocument document,
- PageComponent page,
- ExportChoice choice, {
- required Future<
Uint8List> fontBytes(), - double tableColorOpacity = kTableColorOpacity,
page of document as choice says: a vector PDF with fontBytes'
font embedded (read only for a PDF), or a PNG at the chosen dpi; the
separators omitted either way, and the coloured tables filled under the
drawing at tableColorOpacity (plan colours spec PC-7).
Implementation
Future<Uint8List> exportBytes(
DraftDocument document,
PageComponent page,
ExportChoice choice, {
required Future<Uint8List> Function() fontBytes,
double tableColorOpacity = kTableColorOpacity,
}) async {
return switch (choice.format) {
ExportFormat.pdf => exportPdfBytes(document, page,
fontBytes: await fontBytes(), tableColorOpacity: tableColorOpacity),
ExportFormat.png => exportPagePng(
document: document,
page: page,
dpi: choice.dpi,
omitOwners: exportOmitOwners(document),
underlay: tableColorUnderlay(document, tableColorOpacity)),
};
}