cancel
Showing results for 
Search instead for 
Did you mean: 

Add a fragment that displays the PDF content in my Tab

Benjamin_Jalon1
Elite Collaborator
Elite Collaborator

I would like to display the PDF stored into the file:content field directly in my tab, not the link to download it. How can I do that ?

1 ACCEPTED ANSWER

Benjamin_Jalon1
Elite Collaborator
Elite Collaborator

Dear me,

In your tab designer, you can add a template fragment with the following parameters:

Add 2 fields

  • the first one is empty
  • the second one containing file.content.filename

add the following properties

  • file_schema with the value file
  • and file_property_name with the value file:content

Look the following screenshot:

alt text

And I attached the following xhtml fragment to the widget:

<div xmlns:nxd="http://nuxeo.org/nxweb/document">
  <embed src="#{nxd:fileUrl('downloadFile', field_0, widget.properties.file_property_name, field_1)}" max-width="600" height="600" width="100%"/>
</div>

View answer in original post

1 REPLY 1

Benjamin_Jalon1
Elite Collaborator
Elite Collaborator

Dear me,

In your tab designer, you can add a template fragment with the following parameters:

Add 2 fields

  • the first one is empty
  • the second one containing file.content.filename

add the following properties

  • file_schema with the value file
  • and file_property_name with the value file:content

Look the following screenshot:

alt text

And I attached the following xhtml fragment to the widget:

<div xmlns:nxd="http://nuxeo.org/nxweb/document">
  <embed src="#{nxd:fileUrl('downloadFile', field_0, widget.properties.file_property_name, field_1)}" max-width="600" height="600" width="100%"/>
</div>