Pdf Viewer
Component for displaying PDF files in the browser
This is the server-side component of <vcf-pdf-viewer>
Web Component. The component uses PDF.js library to display pdf files.
This component is part of Vaadin Component Factory.
Features
- Display a pdf file.
- Display a thumbnail's viewer.
- Set zoom
- Navigate to a certain page.
- Open or close thumbnail's viewer.
- Add a listener on change page when clicking on thumbnail.
- Download the pdf file
Sponsored development
Major pieces of development of this add-on has been sponsored by multiple customers of Vaadin. Read more about Expert on Demand at: Support and Pricing
Sample code
PdfViewer pdfViewer = new PdfViewer(); StreamResource resource = new StreamResource("example.pdf", () -> getClass().getResourceAsStream("/pdf/example.pdf")); pdfViewer.setSrc(resource); add(pdfViewer);
Links
Compatibility
Was this helpful? Need more help?
Leave a comment or a question below. You can also join
the chat on Discord or
ask questions on StackOverflow.
Version
New features:
- Allow document rotation (#66)
- Released
- 2024-12-06
- Maturity
- TESTED
- License
- Apache License 2.0
Compatibility
- Framework
- Vaadin 24
- Vaadin 21 in 1.0.0
- Vaadin 20 in 1.0.0
- Vaadin 19 in 1.0.0
- Vaadin 18 in 1.0.0
- Vaadin 17 in 1.0.0
- Vaadin 16 in 1.0.0
- Vaadin 15 in 1.0.0
- Vaadin 14 in 1.0.0
- Vaadin 22 in 2.0.0
- Vaadin 24.3 in 3.0.0
- Vaadin 24.2 in 2.8.0
- Vaadin 24.1 in 2.8.0
- Vaadin 23 in 2.0.0
- Browser
- N/A
Pdf Viewer - Vaadin Add-on Directory
Component for displaying PDF files in the browserIssue tracker
Author Homepage
View on GitHub
Pdf Viewer version 1.0.0
Initial release
Pdf Viewer version 1.0.1
### Bugfixes
* Thumbnails clicked listener not working ([#2](https://github.com/vaadin-component-factory/vcf-pdf-viewer-flow/issues/2))
Pdf Viewer version 2.0.0
### New features
* Update component to work on Vaadin 22+
Pdf Viewer version 1.0.2
### Bugfixes
* Call to `pdfViewer.setPage(pageNum)` after the viewer was initialized was ignored.
Pdf Viewer version 2.0.1
### Bugfixes
* Call to pdfViewer.setPage(pageNum) after the viewer was initialized was ignored.
Pdf Viewer version 2.0.2
Update web component dependency to 1.0.2.
Pdf Viewer version 2.1.0
#### New features:
Add new flag to indicate to only show filename in toolbar.
Pdf Viewer version 2.2.0
#### New features:
- Adds the possibility to define custom labels for zoom options: auto & page fit.
Pdf Viewer version 2.2.1
Update web component version to 1.1.1.
Pdf Viewer version 2.3.0
#### New features:
- add tabindex -1 to anchor to improve tab navigation
- add flag to indicate if download button is added or not
Pdf Viewer version 2.4.0
#### New features:
* Add new property to set a custom title to the viewer.
Pdf Viewer version 2.5.0
#### New features:
* Added print option.
Pdf Viewer version 2.5.1
#### Bug fixes:
* Update printJS call.
Pdf Viewer version 2.5.2
#### Bug fixes:
* Fix preview showing blank page on Safari printing.
Pdf Viewer version 2.5.3
#### Bug fixes:
* fix: use side-effect import instead of default import ([#25](https://github.com/vaadin-component-factory/vcf-pdf-viewer-flow/issues/25))
Pdf Viewer version 2.6.0
#### New features
* new renderInteractiveForms property to allow rendering of form documents
* new hideZoom property to allow hidding the zoom dropdown
Pdf Viewer version 2.7.0
#### New features:
Add aria label for download, print, next, previous and sidebar toggle buttons
Pdf Viewer version 2.7.1
#Bug fixes:
- Fix for download anchor href value not updating when pdf src is changed
- Fix anchor initialization when no source is defined
- Fix to disable dowload button when no source is set
Pdf Viewer version 2.7.2
#### Bug Fixes:
* Update web component version to 1.4.1. This version adds a fallback value to --lumo-border-radius variable to avoid wrong style when used in Vaadin 24. ([#33](https://github.com/vaadin-component-factory/vcf-pdf-viewer-flow/issues/33))
Pdf Viewer version 2.8.0
Updated the web component version and changed the add-on structure and project configuration to be compatible with Vaadin 24. Note: Version 2.8.0 is not necessarily compatible with V23 any longer.
Pdf Viewer version 2.7.3
#### Bug fixes:
Prevent download and print buttons from added multiple times ([#45](https://github.com/vaadin-component-factory/vcf-pdf-viewer-flow/issues/45))
Pdf Viewer version 2.8.1
#### Bug fixes:
Prevent download and print buttons from added multiple times ([#45](https://github.com/vaadin-component-factory/vcf-pdf-viewer-flow/issues/45))
Pdf Viewer version 3.0.0
* Add tooltip support for toolbar buttons([#54](https://github.com/vaadin-component-factory/vcf-pdf-viewer-flow/issues/54))
Pdf Viewer version 2.7.4
Built a new V23 version with JDK 11 instead of JDK 17
Pdf Viewer version 4.0.0
#### New features:
Update web component part to 3.0.1. This version adds components from toolbar (toggle button, next and previous page buttons, zoom select and current page text field) to the light dom.
Pdf Viewer version 2.7.5
Update web-component to version 1.4.2 ([#57](https://github.com/vaadin-component-factory/vcf-pdf-viewer-flow/issues/57)).
Pdf Viewer version 4.0.1
Update web-component to version 3.0.2 ([#57](https://github.com/vaadin-component-factory/vcf-pdf-viewer-flow/issues/57)).
Pdf Viewer version 2.7.6
#### New features:
* Allow document rotation ([#66](https://github.com/vaadin-component-factory/vcf-pdf-viewer-flow/issues/66))
Pdf Viewer version 4.1.0
#### New features:
* Allow document rotation ([#66](https://github.com/vaadin-component-factory/vcf-pdf-viewer-flow/issues/66))