primefaces / primefaces

Ultimate Component Suite for JavaServer Faces
http://www.primefaces.org
MIT License
1.78k stars 759 forks source link

p:media for PDF does not work on mobile Safari #12550

Closed kojotak closed 1 month ago

kojotak commented 1 month ago

Describe the bug

Can not display PDF using p:media tag on mobile Safari browser. Should I use the extensions instead?

Reproducer

Open Primefaces showcase in mobile Safari (ipad, iphone), find and open Media component page. IMG_20240902_154839781

Expected behavior

PDF document is displayed as in other (desktop) browser like Chrome.

PrimeFaces edition

None

PrimeFaces version

14.0.0

Theme

No response

JSF implementation

Mojarra

JSF version

4.0.6

Java version

17.0.0

Browser(s)

iPadOS 17.5.1, AppleWebKit/605.1.15

melloware commented 1 month ago

Looks like this might be the issue: https://stackoverflow.com/questions/72183251/html-pdf-not-showing-in-safari

melloware commented 1 month ago

It seems like this is a common Mobile Safari issue with PDF's.

You might want to switch to PrimeFaces Extensions PDF Viewer: https://www.primefaces.org/showcase-ext/sections/documentviewer/basic.jsf

kojotak commented 1 month ago

Thanks, the DocumentViewer from PrimeFaces extension is working.

melloware commented 1 month ago

@kojotak excellent!

kojotak commented 3 weeks ago

I would like to reopen this issue because pe:documentViewer is not displaying more complex documents. It prints "Invalid PDF structure" even in Chrome. The error message reveals PDF.js version 2.11.338, which is 3 years old (current version is 4.6.82). Are there any plans for upgrades?

melloware commented 3 weeks ago

@kojotak this belongs over at PFE. Howevre PFE 13.0.11 uses the latest PDF.JS you can see in this ticket: https://github.com/primefaces-extensions/primefaces-extensions/issues/1569

So you must be using an older PFE.

kojotak commented 3 weeks ago

Oh, you are right, @melloware, I was using 13.0.10, thanks. The latest version of PE fixed my issue with more complex document. 👍

melloware commented 3 weeks ago

nice yeah you might want to use 13.0.13 which is the latest PFE release.