0 like 0 dislike
1 view
in Vaadin by anonymous Bilge (165k points)
reshown by anonymous
Vaadin show pdf file

2 Answers

0 like 0 dislike
by anonymous Bilge (165k points)
Şöyle bir yöntem olabilir;

File pdfFile = new File(app.getFileLoction()+"projects\\"+proyectNumber+"\\"+fileName+".pdf");
Embedded pdf = new Embedded("", new FileResource(pdfFile, getApplication()));pdf.setMimeType("application/pdf");
pdf.setType(Embedded.TYPE_BROWSER);
layout.addComponent(pdf);
pdf.setSizeFull();
layout.setSizeFull();
0 like 0 dislike
by anonymous Bilge (165k points)
Çalışan bir örnek;

File file = new File(KMConst.KM_PATH_INVOICES + "test.pdf");
        if (file.exists()) {
            Resource pdf = new FileResource(file);
            setResource("Test", pdf);
            ResourceReference rr = ResourceReference.create(pdf, this, "Test");
            Page.getCurrent().open(rr.getURL(), "blank_");
        } else {
            Notification.show("Hata", "Fatura belirtilen yolda bulunamadı!", Notification.Type.ERROR_MESSAGE);
        }
...