Commit 501ec778 authored by Yusei Tahara's avatar Yusei Tahara

erp5_dms: PDF reader is very slow to open a large base64 encoded PDF embedded in…

… HTML or it fails to open such a large PDF. Thus, now PDF reader opens a PDF using URL. It is faster and stable.

/reviewed-on nexedi/erp5!468
parent 1d493de7
...@@ -50,6 +50,10 @@ ...@@ -50,6 +50,10 @@
<key> <string>tales</string> </key> <key> <string>tales</string> </key>
<value> <value>
<dictionary> <dictionary>
<item>
<key> <string>data_url</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>default</string> </key> <key> <string>default</string> </key>
<value> <value>
...@@ -111,7 +115,7 @@ ...@@ -111,7 +115,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python: context.getData().encode("base64")</string> </value> <value> <string>python: context.absolute_url()+\'/getData\'</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -21,15 +21,7 @@ ...@@ -21,15 +21,7 @@
window.document.head.removeChild(el); window.document.head.removeChild(el);
}); });
this.props.key = options.key; this.props.key = options.key;
var raw = window.atob(options.value); webViewerLoad(options.value);
var rawLength = raw.length;
var array = new Uint8Array(new ArrayBuffer(rawLength));
for (var i = 0; i < rawLength; i++) {
array[i] = raw.charCodeAt(i);
}
webViewerLoad(array);
// hide few buttons for now // hide few buttons for now
this.props.element.querySelector('#viewBookmark').hidden = true; this.props.element.querySelector('#viewBookmark').hidden = true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment