diff --git a/src/main/java/com/openkm/frontend/client/widget/properties/Preview.java b/src/main/java/com/openkm/frontend/client/widget/properties/Preview.java
index 0682febb..f9ab0b20 100644
--- a/src/main/java/com/openkm/frontend/client/widget/properties/Preview.java
+++ b/src/main/java/com/openkm/frontend/client/widget/properties/Preview.java
@@ -86,18 +86,19 @@ public void showEmbedPDF(String uuid) {
vPanel.clear();
vPanel.add(pdf);
- vPanel.setCellHorizontalAlignment(pdf, HasAlignment.ALIGN_CENTER);
+ vPanel.setCellHorizontalAlignment(pdf, HasAlignment.ALIGN_DEFAULT);
vPanel.setCellVerticalAlignment(pdf, HasAlignment.ALIGN_MIDDLE);
if (previewAvailable) {
- String url = RPCService.DownloadServlet + "?inline=true&uuid=" + URL.encodeQueryString(uuid);
- pdf.setHTML("
" +
+ String url = RPCService.ConverterServlet + "?inline=true&toPdf=true&uuid=" + URL.encodeQueryString(uuid)
+ + "&downloadType=" + DOWNLOAD_TYPE_PREVIEW;
+ pdf.setHTML("
" +
"
" +
"
\n"); // needed for rewriting purpose
} else {
- swf.setHTML("
" + Main.i18n("preview.unavailable") + "
\n");
+ pdf.setHTML("
" + Main.i18n("preview.unavailable") + "
\n");
}
}
@@ -219,36 +220,12 @@ public void previewDocument(boolean refreshing, GWTDocument doc) {
+ DOWNLOAD_TYPE_PREVIEW;
showSystemEmbeddedPreview(EmbeddedPreview.SWF_URL + URL.encodeQueryString(url) + "&uuid=" + URL.encodeQueryString(doc.getUuid()));
} else {
- PreviewExtension previewExtension = null;
-
- for (PreviewExtension preview : widgetPreviewExtensionList) {
- Log.debug("PreviewExtension: " + preview.getClass().getName());
-
- if (preview.isPreviewAvailable(doc.getMimeType())) {
- Log.debug("Chosen preview extension: " + preview.getClass().getName());
- previewExtension = preview;
- break;
- }
- }
-
- // CADViewer preview comes here
- if (previewExtension != null) {
- if (!refreshing) {
- String url = RPCService.DownloadServlet;
- url += ";jsessionid=" + Main.get().workspaceUserProperties.getWorkspace().getSessionId();
- url += "?uuid=" + URL.encodeQueryString(doc.getUuid()) + "&downloadType=" + DOWNLOAD_TYPE_PREVIEW;
- showPreviewExtension(previewExtension, url, doc);
- } else {
- previewExtension.resizeViewer(width, height);
+ if (refreshing) {
+ if (Main.get().workspaceUserProperties.getWorkspace().isAcrobatPluginPreview()) {
+ Util.resizeEmbededPDF("" + width, "" + height, pdfID);
}
} else {
- if (refreshing) {
- if (Main.get().workspaceUserProperties.getWorkspace().isAcrobatPluginPreview()) {
- Util.resizeEmbededPDF("" + width, "" + height, pdfID);
- }
- } else {
- showEmbedPDF(doc.getUuid());
- }
+ showEmbedPDF(doc.getUuid());
}
}
}