$(document).on('viewerLoaded', function(){
if($.mobile){
var params = window.ControlUtils.getQueryStringMap();
if(params.getBoolean('auto_load') === false){
var doc = params.getString('d');
var streaming = false;
var decrypt = window.CoreControls.Encryption.Decrypt;
var decryptOptions = {p: YOUR_PASSWORD_HERE, type: 'aes'};
window.ControlUtils.byteRangeCheck(function(status) {
// if the range header is supported then we will receive a status of 206
if (status === 200) {
streaming = true;
console.warn('HTTP range requests not supported. Switching to streaming mode.');
}
window.readerControl.loadDocument(doc, streaming, decrypt, decryptOptions);
}, function() {
// some browsers that don't support the range header will return an error
streaming = true;
window.readerControl.loadDocument(doc, streaming, decrypt, decryptOptions);
});
}
}
});