PDF Viewer
Embed a view of a PDF document.
Demo
Basic example
Attributes
Attribute | Type | Description |
---|---|---|
type | string | Type expected is pdfViewer |
See section Common attributes.
NOTE
If value is an Array instead of a string URL, component will try to show an integrated document gallery
Extra attributes
Attribute | Type | Description |
---|---|---|
height | number | Height limit of the component in pixels, will show a scrollbar |
title | string | Path to title in data response, e.g. {{$item.filename}} . Default is {{$item.name}} |
file | string | Path to file URL in data response, e.g. {{$item.url_file}} . Default is {{$item.downloadUrl}} |
thumbnail | string | Path to thumbnail URL in data response, e.g. {{$item.url_thumb}} . Default is {{$item.previewUrl}} |
thumbnailPollTime | number | Time in miliseconds to retry loading thumbnails. Default is 2000 (2 seconds). Only useful when the url specified by thumbnail setting won't be ready in time. |
NOTE
Attributes title
, thumbnail
and file
have default resolving values named as in Upload component payload props. This means that you can bind an Upload component value directly to PDF Viewer value and no config should be necessary.
{
type: "upload",
value: "{{upload}}",
...
},
{
type: "pdfViewer",
value: "{{upload}}",
...
}
Events
Event | When | Additional | Cancellable |
---|---|---|---|
Pdf.ready | PDF content is loaded (only for pdfjs) | Definition + State | No |
See section Events for more information.
When to use it
Use it to show embedded PDF documents inside a form.