---
title: "Fernando Lam (@fenchai) | Hashnode"
description: "code. Read the latest articles by Fernando Lam on Hashnode."
url: "https://hashnode.com/@fenchai"
---

@fenchai

# Fernando Lam

@fenchai · Joined October 2020

code

## Comments

[I do something different which is exporting the created pdf into png files which takes a heavy toll on the main thread. Do you know if there is a way to compute the below? if (!isPdf) { int pageIndex = 1; await for (var page in Printing.raster(pdf.save(), dpi: 300)) { final image = await page.toPng(); final String pageQty = (pagesToPrint > 1) ? '$pageIndex-$pagesToPrint' : '1-1'; file = File("${output.path}/$fileName--$pageQty.png"); await file.writeAsBytes(image); imageList.add(file); pageIndex++; } } else { file = File("${output.path}/$fileName.pdf"); await file.writeAsBytes(pdf.save()); imageList.add(file); }](https://hashnode.com/posts/flutter-unblocking-ui-thread-with-isolates-compute-function/5d6e4c943e3f2adc43b93fc1/comment/5f7b1685a4bdec5ef0a751f2)

Comment · Article · Oct 5, 2020 · [Flutter: Unblocking UI thread with Isolates compute function](https://hashnode.com/posts/flutter-unblocking-ui-thread-with-isolates-compute-function/5d6e4c943e3f2adc43b93fc1)
