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>
@Named
@ViewScoped
public class AdvancedDocumentViewerController implements Serializable {
private static final long serialVersionUID = 1L;
private int page = 2;
private String locale = "en";
public int getPage() {
return page;
}
public void setPage(final int page) {
this.page = page;
}
public String getLocale() {
return locale;
}
public void setLocale(final String locale) {
this.locale = locale;
}
}