Hello i'm working with flutter desktop project. How can i attached assets images with the format of jpg/png in Flutter pdf pages.
static Future<File> generate(Invoice invoice) async {
final pdf = Document();
pdf.addPage(MultiPage(
build: (context) => [
buildHeader(invoice),
dashLine(),
SizedBox(height: 20.0),
buildTitle(invoice),
buildInvoice(invoice),
dashLine(),
priceDetails(invoice.total),
],
));
return PdfApi.saveDocument(
name:
'${DateTime.now().day}_${DateTime.now().month}_${DateTime.now().year}.pdf',
pdf: pdf);
}