Last active
December 18, 2015 10:59
-
-
Save manute/5772239 to your computer and use it in GitHub Desktop.
Scribd Integration api javascript with gsp layout grails
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<g:applyLayout name="userProfile"> | |
<html> | |
<head> | |
<script type="text/javascript" src='http://www.scribd.com/javascripts/scribd_api.js'></script> | |
</head> | |
<body> | |
<div class="colIzq fleft"> | |
<div id='embedded_doc'></div> | |
<script type='text/javascript'> | |
//FROM DOCUMENT SCRIBD : | |
//doc_id -> id of document , for example 2659 | |
//scribd_api_key -> api key from scribd account | |
var scribd_doc = scribd.Document.getDoc(doc_id, scribd_api_key); | |
var onDocReady = function(e){ | |
// scribd_doc.api.setPage(3); | |
// scribd_doc.api.setZoom(4); | |
} | |
//Customize visor | |
scribd_doc.addParam('height', 420); | |
scribd_doc.addParam('width', 530); | |
scribd_doc.addParam('auto_size', true); | |
//Buttons share and embed | |
scribd_doc.addParam('allow_share', false); | |
scribd_doc.addParam('mode', 'slideshow'); | |
scribd_doc.addParam('jsapi_version', 2); | |
// Attach event listeners | |
scribd_doc.addEventListener('docReady', onDocReady); | |
// Write the instance | |
scribd_doc.write('embedded_doc'); | |
</script> | |
</div> | |
<div class="colDer fright"> | |
</div> | |
</body> | |
</html> | |
</g:applyLayout> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment