WT PDF Viewer
Pdf viewer for Vaadin based on pdf.js web viewer
Pdf viewer for Vaadin based on pdf.js web viewer.
Features:
- Sidebar with thumbnails, document outline and attachments
- Text search in PDF text
- Previous page, next page and jump to arbitrary page
- Zooming out up to 10%, automatic zoom, zoom to actual size, fit page, full width
- Full-screen presentation Mode
- Document print
- Document download
- Rotation clockwise and counterclockwise
- Hand tool for comfortable scrolling
- Document properties
- Can show multiple pdf files on the same screen
Sample code
WTPdfViewer pdfViewer = new WTPdfViewer(); // get file stream String filename = "some-pdf-file.pdf"; InputStream dataStream = getClass().getClassLoader().getResourceAsStream(filename); // show file in pdf viewer pdfViewer.setResource(new StreamResource(new InputStreamSource(dataStream), filename)); // jump to fifth page pdfViewer.setPage(5); // boilerplate StreamSource implementation class InputStreamSource implements StreamSource { private final InputStream data; public InputStreamSource(InputStream data) { super(); this.data = data; } @Override public InputStream getStream() { return data; } }
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
Better server side log from javascript error.
- Released
- 2019-04-23
- Maturity
- STABLE
- License
- Apache License 2.0
Compatibility
- Framework
- Vaadin 8.0+
- Vaadin 7.0+ in 1.0
- Browser
- Firefox
- Opera
- Safari
- Google Chrome
- Internet Explorer
WT PDF Viewer - Vaadin Add-on Directory
Pdf viewer for Vaadin based on pdf.js web viewerIssue Tracker
Source Code
WT PDF Viewer version 1.0.1
Open file input box that sometimes appeared on the bottom of the page wont be visible anymore.
WT PDF Viewer version 1.0.2
* Fixed exception in console caused by uri fragments.
* Minimized imported JavaScript files.
WT PDF Viewer version 1.0.3
* The viewer used to show every pdf file uploaded via any upload button on the screen. The global file upload listener was removed, it does not happen anymore.
* Fixed exception in console when users clicks around the application caused url hash changes.
WT PDF Viewer version 1.0.4
* Number of total pages was invisible in IE11.
WT PDF Viewer version 1.0.5
Added `setShowPreviousViewOnLoad(boolean)` method. By default, the viewer remembers last opened page and zoom for each opened pdf. When the same pdf is opened second time in the same browser, it is opened at last read page. This method is able to turn off this functionality.
After `setShowPreviousViewOnLoad(false)` is called, pdf will be opened on the first page regardless of where it was opened last time.
WT PDF Viewer version 1.0.6
Sometimes client side attempts to switch between multiple different pdfs quickly, quicker then the pdf can load. This can lead to errors or it can confuse the server side to send wrong stream as a response to older request.
* Throw exception only if the last of concurrent file downloads failed.
* If the download is obsolete before it even started, send nothing.
WT PDF Viewer version 1.0.7
IE: pressing enter in page number field did not caused page change.
WT PDF Viewer version 2.0.0
Moved to vaadin 8 and java 8. An attempt to open incorrect pdf is now logged as warning on server side.
WT PDF Viewer version 2.0.1
Better server side log from javascript error.