I wish I could set the mobile reader to "Single Page" programatically, (As it happens when the user manually taps the top-right gear and then "Landscape Display" => "Single Page")
But if I call setLayoutMode, or setFitMode, right after creating the WebViewer, it gives me an error
"getInstance().set..." is not a function
And if I call these methods on the "on_document_load" callback it gives me a warning
"Unsupported method for this viewer type"
(Or something like that)
A:
To set to "Single Page" programmatically you can use code like this:
$(viewerElement).bind('ready', function(e) {
var viewerInstance = myWebViewer.getInstance();
viewerInstance.pageDisplay = viewerInstance.pageDisplayModes.Single;
viewerInstance.setPageMode();
}
Alternatively you could trigger the "Single Page" button's click event:
$(viewerElement).bind('documentLoaded', function(e) {
$('iframe')[0].contentWindow.$('#displaySingle').trigger('click');
}