I'm on PF 6.2 and trying to use the p:media
component for displaying PDFs.
(I shifted from using pe:documentViewer
only because it currently doesn't display digital signatures, since PDF.js doesn't support that feature in the first place).
However, I observe that the look-n-feel of the rendered PDF viewer is different across browsers.
My usage:
<p:media id="pdfVw" height="600" width="800" value="#{viewerController4.pdfDocumentStream}" player="pdf" cache="false">
<f:param name="id" value="#{viewerController4.currentDocId}" />
</p:media>
In the backing bean:
public StreamedContent getPdfDocumentStream() throws IOException {
FacesContext context = FacesContext.getCurrentInstance();
if (context.getCurrentPhaseId() == PhaseId.RENDER_RESPONSE) {
return new DefaultStreamedContent();
} else {
String id = context.getExternalContext().getRequestParameterMap().get("id");
Doc doc = pdfDocMap.get(id);
return new DefaultStreamedContent(new FileInputStream(new File(doc.getDocPath())), "application/pdf", doc.getDocName());
}
}
About the look-n-feel...for example, in Chrome:
* no thumbnail strip for the pages!
* that string "Microsoft word-Dokument1" is coming from the PDF's "title" attribute (I wish I could suppress displaying it !)
In Firefox:
* the thumbnail strip is there
* the digital signature is gone!
* that title string is not there (for me, it's a plus)
* the menus are also completely different compared to Chrome
(In IE, it's even more different)
My client's target browser is Chrome.
If I could somehow suppress that title and start showing the thumbnail strip in Chrome, that would solve my purpose entirely. Any advice?