0

Is it possible render a PDF object using Primeface 3.4 and DefaultStreamedContent? This used to work for us in Primefaces 2.2:

Backing Bean:

   streamedDoc = new DefaultStreamedContent(pdfStream, "application/pdf");
...
 public StreamedContent getStreamedDoc() {
    return streamedDoc;
 }

view:

<object id="embeddedPDF"
       data="?primefacesDynamicContent=confirmForm.streamedDoc#toolbar=0?docId=456"
       type="application/pdf"
       width="100%"
       height="1610px"/>

But after upgrading to 3.4, the PDF doesn't get rendered. We don't get an exception. We simply get this Abode Reader error in the browser:

Adobe Reader could not open 'A9RE0BF.tmp' because it is either not a supported file type or because the file has been damaged. (for example, it was sent as an email attachment and wasn't correctly encoded)."

Any ideas?

1 Answer 1

3

What about using the primefaces lightbox and the media components?

http://www.primefaces.org/showcase/ui/multimedia/media.xhtml

http://www.primefaces.org/showcase/ui/overlay/lightBox.xhtml

You can see the PDF inside the lightBox, I think it's more elegant.

Anyway just with the media one you can solve your problem I guess.

Regards.

Not the answer you're looking for? Browse other questions tagged or ask your own question.