PDF viewer component for Vaadin Flow 14.+
PDFViewer for Vaadin 14.+ with image overlay
PDFViewer let you put an image over the PDF and move it around. I use it in the digital sign process to position the "image sign" in the correct place. You can query at any time where is the image positioned. The references are in PDF coordinate values.
Sample code
// this code is executed when upload button finish to load the PDF. FileInputStream fis = new FileInputStream(buffer.getFileData(fileName).getFile());StreamResource sr = new StreamResource(event.getFileName(), () -> fis); // file VaadinSession.getCurrent().getResourceRegistry().registerResource(sr); PDFViewer viewer = new PDFViewer(); viewer.load(contextRoot + VaadinSession.getCurrent().getResourceRegistry().getTargetURI(sr).getPath()); // this field are filled with upload button that load an image. if (this.imageFileName!=null && !this.imageFileName.isBlank()) { viewer.drawImage(this.imageFileName, contextRoot + this.urlImage); }
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
Added first / last button
- Released
- 2023-08-10
- Maturity
- EXPERIMENTAL
- License
- Apache License 2.0
Compatibility
- Framework
- Vaadin 14+
- Browser
- Firefox
- Google Chrome
PDF viewer component for Vaadin Flow 14.+ - Vaadin Add-on Directory
PDFViewer for Vaadin 14.+ with image overlay**PDFViewer** let you put an image over the PDF and move it around. I use it in the digital sign process to position the "image sign" in the correct place.
You can query at any time where is the image positioned. The references are in PDF coordinate values.