0

I use primefaces extensions documentViewer to display pdfs:

<pe:documentViewer id="docViewerId" value="#{contentBL.inlineContent}" name="#{contentBL.getContentDataName()}" />

This works so far until I give the attribute name a value like in the code above. Then the viewer does not show the pdf with a message:

PDF.js Version 1.0.21 (build: f954cde) Nachricht: InvalidPDFException

I want to define the name of the file if the pdf is downloaded.

I am using PF extensions 3.2.0.

opfau
  • 731
  • 9
  • 37
  • It is always good to create an [mcve] and to provide version info (see [ask]) Do you use `StreamedContend`? If so, check its [API](http://www.primefaces.org/docs/api/5.2/org/primefaces/model/StreamedContent.html). It has a setName(...), so I expect the name attribute is not needed then and might even conflict. BTW, I never used this component, I just inspected docs to find a possible cause. Easy to do yourself – Kukeltje Oct 08 '15 at 19:22
  • 1
    Yes it is streamed content and the name is already set. But if I download the pdf in the viewer the default name is just "document.pdf" which was not the name I set. – opfau Oct 09 '15 at 06:27
  • Why did you omit all this info from the Q? Again… Create an mcve… – Kukeltje Oct 09 '15 at 06:53
  • 1
    I think a mcve wouldn't be helpful. It work as long I do not give the attribute `name` a value. Sounds like a but. Even if I set `name="blabla.pdf"` it crashes. – opfau Oct 09 '15 at 06:57
  • Good luck then… I'm not going to try to replicate without an [mcve]. Nor am I going to create something from scratch to try to make it work – Kukeltje Oct 09 '15 at 07:21

0 Answers0