Skip to content

Instantly share code, notes, and snippets.

@koohq
Created November 5, 2017 17:50
Show Gist options
  • Save koohq/e21ae34a2bd4fa445f98f571c3f22b0d to your computer and use it in GitHub Desktop.
Save koohq/e21ae34a2bd4fa445f98f571c3f22b0d to your computer and use it in GitHub Desktop.
A snippet to enable the PDF file preview by using 'filePreview.js'.
/**
* sp-pdfpreview.js
*
* (c) 2017 koohq. Licensed under CC0.
* https://creativecommons.org/publicdomain/zero/1.0/legalcode
*/
(function enablePDFPreview() {
ExecuteOrDelayUntilScriptLoaded(function() {
filePreviewManager.previewers.extensionToPreviewerMap.pdf = [embeddedWACPreview, WACImagePreview];
embeddedWACPreview.dimensions.pdf = { width: 379, height: 252 };
}, 'filePreview.js');
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment