In the view it looks like this:
<p:media cache="false" value="#{documents.readPDF()}" width="640px" height="480px" player="pdf" />
No bean looks like this:
public StreamedContent readPDF() {
FileModel pdfModel = getDocumentPDF();
InputStream stream = new ByteArrayInputStream(pdfModel.getBytes());
return new DefaultStreamedContent(stream, "application/pdf", pdfModel.getFileName());
}
But I get an error 500 link