packages.flutter icon indicating copy to clipboard operation
packages.flutter copied to clipboard

[native_pdf_render] Windows throws PlatformException

Open ShaharLet opened this issue 2 years ago • 3 comments

I'm getting this exception when trying to view pdf file: "PlatformException(native_pdf_exception, Document failed to open, null, null)"

ShaharLet avatar Oct 11 '21 05:10 ShaharLet

I'm getting the same error and a similar one on macOS. It's running perfectly fine on web though. I think there is a null check (!) somewhere that when the pdf controller gets initialised if that helps.

spikelucky avatar Oct 12 '21 16:10 spikelucky

We had the same error and instead of PdfDocument.openFile(widget.file.path)

we solved using PdfDocument.openData(widget.file.readAsBytesSync())

berkaycelebi00 avatar Jan 13 '22 14:01 berkaycelebi00

We had the same error and instead of PdfDocument.openFile(widget.file.path)

we solved using PdfDocument.openData(widget.file.readAsBytesSync())

This works for me. Thanks!

d-wolf avatar Aug 29 '22 12:08 d-wolf