bound-pdf-viewer
An HTML content command that becomes an HTML structure functioning as a viewer displaying a PDF File retrieved from a URL specified through a Screen data variable.
The main functional difference between this command and pdf-viewer is that the PDF displayed by bound-pdf-viewer
may be changed while the Screen is being displayed. The bound-pdf-viewer
also requires the PDF to be specified through a URL String, instead of a File value - the getFileDownloadURL(INVALID) command is therefore very useful with this content command.
Attributes
file-url | ||
---|---|---|
Required | Value type | EL-evaluated |
Yes | String | No |
Defines the name of Screen data variable that holds the URL String of the PDF document to display. |
height | ||
---|---|---|
Required | Value type | EL-evaluated |
No | String | Yes |
Defines the height of the viewer in CSS pixels. The resolved value is expected to be a String representing an integer. If not defined, the width of the viewer is set to be the same as the width of its parent element. |
width | ||
---|---|---|
Required | Value type | EL-evaluated |
No | String | Yes |
Defines the width of the viewer in CSS pixels. The resolved value is expected to be a String representing an integer. If not defined, the width of the viewer is set to be the same as the width of its parent element. |
Examples
The basic use of bound-pdf-viewer
is to display a PDF document generated within the logic. This requires a download URL for the PDF to be created with getFileDownloadURL
and stored in a variable declared as Screen data. The logic could look like this:
<exportPDF var="pdf" document="${composedDoc}"><getFileDownloadURL var="pdfURL" file="${pdf}" contentDisposition="inline" screenData="true">
In the Screen bound-pdf-viewer
can then be given the URL-holding Screen data variable:
<bound-pdf-viewer file-url="pdfURL">