Hello, I've a problem version 23 of Vadin. I get "Invalid PDF Structure" i

hello,

I’ve a problem version 23 of Vadin. I get “Invalid PDF Structure” in the browser and not show the content of file. The download works.

My code:

PdfViewer pdfViewer = new PdfViewer();
StreamResource resource = new StreamResource(manualUsuario.getName(), () -> createResource(manualUsuario));
pdfViewer.setSrc(resource);
add(pdfViewer);
private InputStream createResource(File path) {
 try {
	 return FileUtils.openInputStream(path);
	 } catch (Exception ex){
     }
 return null;
}

Thanks for help.

I had the same problem with external jars. When I added Maven dependencies, the problem was solved. There’s no problem with your code. In fact, i used your code to solve my problem.