@@ -86,18 +86,19 @@ public void showEmbedPDF(String uuid) {
86
86
vPanel .clear ();
87
87
88
88
vPanel .add (pdf );
89
- vPanel .setCellHorizontalAlignment (pdf , HasAlignment .ALIGN_CENTER );
89
+ vPanel .setCellHorizontalAlignment (pdf , HasAlignment .ALIGN_DEFAULT );
90
90
vPanel .setCellVerticalAlignment (pdf , HasAlignment .ALIGN_MIDDLE );
91
91
92
92
if (previewAvailable ) {
93
- String url = RPCService .DownloadServlet + "?inline=true&uuid=" + URL .encodeQueryString (uuid );
94
- pdf .setHTML ("<div id=\" pdfembededcontainer\" >" +
93
+ String url = RPCService .ConverterServlet + "?inline=true&toPdf=true&uuid=" + URL .encodeQueryString (uuid )
94
+ + "&downloadType=" + DOWNLOAD_TYPE_PREVIEW ;
95
+ pdf .setHTML ("<div id=\" " + flashContainer + "\" >" +
95
96
"<object id=\" " + pdfID + "\" name=\" " + pdfID + "\" width=\" " + width + "\" height=\" " + height + "\" type=\" application/pdf\" data=\" " + url + "\" &#zoom=85&scrollbar=1&toolbar=1&navpanes=1&view=FitH\" >" +
96
- "<p>Browser plugin suppport error, PDF can not be displayed</p>" +
97
+ "<p>Browser plugin support error, PDF can not be displayed</p>" +
97
98
"</object>" +
98
99
"</div>\n " ); // needed for rewriting purpose
99
100
} else {
100
- swf .setHTML ("<div id=\" pdfembededcontainer \" align=\" center\" ><br><br>" + Main .i18n ("preview.unavailable" ) + "</div>\n " );
101
+ pdf .setHTML ("<div id=\" " + flashContainer + " \" align=\" center\" ><br><br>" + Main .i18n ("preview.unavailable" ) + "</div>\n " );
101
102
}
102
103
}
103
104
@@ -219,36 +220,12 @@ public void previewDocument(boolean refreshing, GWTDocument doc) {
219
220
+ DOWNLOAD_TYPE_PREVIEW ;
220
221
showSystemEmbeddedPreview (EmbeddedPreview .SWF_URL + URL .encodeQueryString (url ) + "&uuid=" + URL .encodeQueryString (doc .getUuid ()));
221
222
} else {
222
- PreviewExtension previewExtension = null ;
223
-
224
- for (PreviewExtension preview : widgetPreviewExtensionList ) {
225
- Log .debug ("PreviewExtension: " + preview .getClass ().getName ());
226
-
227
- if (preview .isPreviewAvailable (doc .getMimeType ())) {
228
- Log .debug ("Chosen preview extension: " + preview .getClass ().getName ());
229
- previewExtension = preview ;
230
- break ;
231
- }
232
- }
233
-
234
- // CADViewer preview comes here
235
- if (previewExtension != null ) {
236
- if (!refreshing ) {
237
- String url = RPCService .DownloadServlet ;
238
- url += ";jsessionid=" + Main .get ().workspaceUserProperties .getWorkspace ().getSessionId ();
239
- url += "?uuid=" + URL .encodeQueryString (doc .getUuid ()) + "&downloadType=" + DOWNLOAD_TYPE_PREVIEW ;
240
- showPreviewExtension (previewExtension , url , doc );
241
- } else {
242
- previewExtension .resizeViewer (width , height );
223
+ if (refreshing ) {
224
+ if (Main .get ().workspaceUserProperties .getWorkspace ().isAcrobatPluginPreview ()) {
225
+ Util .resizeEmbededPDF ("" + width , "" + height , pdfID );
243
226
}
244
227
} else {
245
- if (refreshing ) {
246
- if (Main .get ().workspaceUserProperties .getWorkspace ().isAcrobatPluginPreview ()) {
247
- Util .resizeEmbededPDF ("" + width , "" + height , pdfID );
248
- }
249
- } else {
250
- showEmbedPDF (doc .getUuid ());
251
- }
228
+ showEmbedPDF (doc .getUuid ());
252
229
}
253
230
}
254
231
}
0 commit comments