Theme
arya
luna-amber
luna-blue
luna-green
luna-pink
nova-dark
nova-light
saga
vela
Document Viewer
It's also possible to set the Locale and the starting page of the DocumentViewer
Source

<p:outputPanel layout="block" id="container" deferred="true">
        <p:panelGrid columns="2" layout="tabular">
            <h:outputLabel value="Page"/>
            <p:spinner min="1" max="69" value="#{advancedDocumentViewerController.page}">
                <p:ajax update="container"/>
            </p:spinner>
            <h:outputLabel value="Locale"/>
            <p:selectOneRadio value="#{advancedDocumentViewerController.locale}">
                <f:selectItem itemValue="en" itemLabel="English"/>
                <f:selectItem itemValue="de" itemLabel="German"/>
                <f:selectItem itemValue="it" itemLabel="Italian"/>
                <f:selectItem itemValue="pt_BR" itemLabel="Portuguese"/>
                <p:ajax update="container"/>
            </p:selectOneRadio>
        </p:panelGrid>
        <pe:documentViewer
                height="500"
                locale="#{advancedDocumentViewerController.locale}"
                page="#{advancedDocumentViewerController.page}"
                url="/sections/documentviewer/book.pdf"/>
    </p:outputPanel>
            
Components and more
Documentation pe:documentViewer
Attributes (move mouse over the names to see data types)
Name Description
id Unique identifier of the component in a namingContainer.
rendered Boolean value to specify the rendering of the component, when set to false component will not be rendered.
binding An el expression referring to a server side UIComponent instance in a backing bean.
width Width of the viewer frame. Default to 100%.
height Height of the viewer frame.
style CSS style of the viewer frame.
title Title of the viewer frame per Section 508.
url URL of the document to view.
cache Controls browser caching mode of the resource. Default is false
locale Locale to be used for labels.
page Start page of the document.
pagemode Pagemode: either "thumbs" or "bookmarks".
download You should use a name in your StreamedContent but if you are using a URL value you can give the file a name. NOTE: Must end in .pdf for PDF.js to pick it up!
zoom Zoom level. Example: zoom=200 (accepted formats: '[zoom],[left],[top]', 'page-width', 'page-height', 'page-fit', 'auto')
name Name of the document.
nameddest Nameddest: go to a named destination in the document.
library Library name of the document
value Value of the component.
disableFontFace Flag to control using system fonts or font loaded in document. If your PDF does not render correctly try setting this flag to false. Default is true.
PrimeFaces Extensions Showcase - © 2011-2023,PrimeFaces: 14.0.5,PrimeFaces Extensions: 14.0.5,JSF: Apache MyFaces JSF-2.3 Core Impl 2.3.10,Server: jetty/9.4.36.v20210114,Build time: 2024-09-10 21:01