· Experimenting with low-code tools

PDF generation in a custom action

Custom Code

Hey. Months ago I had a custom action that generated a pdf based on some db results working. But it has stopped working. I'm getting

'TypeError: byte_order.ByteOrder is undefined'

What has changed??

 final pdf = pw.Document();
  // ... PDF generation stuff....
  print('file generated');
BREAKS FROM HERE....
  // Generate PDF bytes
  final bytes = await pdf.save();
  // Create blob from bytes
  final blob = html.Blob([bytes], 'application/pdf');
  print('blob  genrated');
  // Create download URL
  final url = html.Url.createObjectUrlFromBlob(blob);
  print('url genrated');
  // Create anchor element for download
  final anchor = html.AnchorElement()
    ..href = url
    ..download = 'order_labels.pdf' // This will be the downloaded file name
    ..style.display = 'none';
What have you tried so far?

changed to printing package with the same result.

Did you check FlutterFlow's Documentation for this topic?
Yes
3
3 replies