0

I have some pdf content which i retrieved from the API and i converted it using webcontent_converter package. But when i try to download it, it is throwing error or not downloading.

here is the code:

  var dir = await getApplicationDocumentsDirectory();
              var savedPath = "${dir.path}/$title.pdf";
              var result = await WebcontentConverter.contentToPDF(
                content: content,
                savedPath: savedPath,
                format: PaperFormat.a4,
                margins:
                    PdfMargins.px(top: 55, bottom: 55, right: 55, left: 55),
              );

I can convert the above result into file by : File file = File(result!)

but how can i download the file?

0 Answers0