flutter_pdf_render icon indicating copy to clipboard operation
flutter_pdf_render copied to clipboard

pdf not visible on flutter web when hosted without building with (--web-renderer html ) flag

Open CoderJerry opened this issue 1 year ago • 5 comments

CoderJerry avatar Mar 14 '24 15:03 CoderJerry

I've tested with the following two configurations and both build and run correctly:

flutter build web --release --verbose --web-renderer=html
flutter build web --release --verbose --web-renderer=canvaskit

Could you please show your flutter doctor -v ?

espresso3389 avatar Mar 14 '24 16:03 espresso3389

it runs well on system but when i hosted it on firebase hosting it did not worked...but without changing any code when i build with flutter build web --release --web-renderer html it worked finee

CoderJerry avatar Mar 14 '24 18:03 CoderJerry

It seems that it's out of Flutter/pdfrx scope. My guess is that PDF is not hosted on the same origin. CORS or something prevents the app from loading the PDF correctly.

espresso3389 avatar Mar 14 '24 19:03 espresso3389

.but without changing any code when i build with flutter build web --release --web-renderer html it worked finee

Do you mean, you're building the app without --web-renderer option?

If so, according to flutter build web --help,

    --web-renderer                                           The renderer implementation to use when building for the web.

          [auto] (default)                                   Use the HTML renderer on mobile devices, and CanvasKit on desktop devices.
          [canvaskit]                                        Always use the CanvasKit renderer. This renderer uses WebGL and WebAssembly to render graphics.
          [html]                                             Always use the HTML renderer. This renderer uses a combination of HTML, CSS, SVG, 2D Canvas, and WebGL.
          [skwasm]                                           Always use the experimental skwasm renderer.

The default renderer changes depending on the device. On what device do you testing?

Anyway, I want to repeat the phrase; please show me your flutter doctor -v. I don't know anything about your environment. Everything is just my guess :(

espresso3389 avatar Mar 14 '24 19:03 espresso3389

Works on debug and release mode on localhost only. After hosting it to firebase hosting the below error is showing MissingPluginException(No implementation found for method data on channel pdf_render)

irajeshh avatar Mar 16 '24 13:03 irajeshh