How to read / render a PDF in Flutter on WEB from local storage?

179 Views Asked by At

Have tried following steps but failing at Step 3 :

Step 1: Loading pdf from local storage using file_selector package --> Success

Step 2: Assign the pdf as an XFILE variable --> Success

Step 3: Read each page of the pdf --> Failure (tried packages pdf, pdfx, pdf_render, none of them read XFILE)

Issue with each package

  1. pdf and pdfx package --> I can read pdf document from local storage using file_selector but couldn't find a way to use this package to read each page. file_selector loads the pdf as XFILE but can't find a way to convert it into a PdfDocument.

  2. pdf_render package --> only works if the pdf is stored as an Asset. Can find a way to load pdf as an asset at runtime.

Is there any other way to read pdf for Web ?

0

There are 0 best solutions below