Hello, i want to open .pdf file, how can i do it? there is what i have wrote:
protected void init(VaadinRequest request) {
final VerticalLayout layout = new VerticalLayout();
layout.setMargin(true);
setContent(layout);
String basepath = VaadinService.getCurrent().getBaseDirectory()
.getAbsolutePath();
Window win = new Window();
FileResource resource = new FileResource(new File(basepath
+ "/WEB-INF/doc/java.pdf"));
File pdfFile = new File("/WEB-INF/doc/java.pdf");
Embedded pdf = new Embedded(null, resource);
pdf.setMimeType("pdf");
Link link = new Link("Link to pdf", resource);
pdf.setType(Embedded.TYPE_BROWSER);
layout.addComponent(link);
}