use of com.teamdev.jxbrowser.chromium.javafx.BrowserView in project TeachingInSimulation by ScOrPiOzzy.
the class ResourceViewer method createOfficeViewer.
/**
* 创建文档文件查看器
*/
private void createOfficeViewer() {
String officeName = resource.getPath();
String pdfName = officeName.substring(0, officeName.lastIndexOf(".")) + ".pdf";
String pdfPath = SpringUtil.getBean(HTTPUtils.class).getFullPath(ResourceConsts.FTP_CONVERT_PATH + pdfName);
if (pdfPath == null) {
return;
}
Browser browser = new Browser(BrowserType.LIGHTWEIGHT);
browser.loadURL(pdfPath);
BrowserView view = new BrowserView(browser);
viewer.getChildren().add(view);
}
Aggregations