Hi All,
I have been trying to implement
Sami’s example code
which embeds a PDF.
However after i execute the code there is only a blank window. I am passing in the path to the pdf as a String. I have also tried to pass in the full filepath to the setSource method escaping the windows backslashes and tried with forward slashes.
My code is as follows:
EmbedPDF(String fullPathToFile){
Window sub = new Window();
Embedded em = new Embedded();
try{
em.setSource(new ExternalResource(fullPathToFile));
}catch(Exception e){
e.printStackTrace();
}
em.setType(Embedded.TYPE_BROWSER);
em.setSizeFull();
em.setImmediate(true);
em.setMimeType("application/pdf");
sub.addComponent(em);
MyApplication.getProject().getMainWindow().addWindow(sub);
}
Any pointers to what i am doing wrong?
Thanks
S.