discontinuedPackage jet_cad_floor_plan has been discontinued and replaced by jet_cad_2d_plan.

exportBytes function

Future<Uint8List> exportBytes(
  1. DraftDocument document,
  2. PageComponent page,
  3. ExportChoice choice, {
  4. required Future<Uint8List> fontBytes(),
  5. 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)),
  };
}