$(document).bind("documentLoaded", function(event) {
readerControl.setCurrentPageNumber(4);
});
$(document).bind("documentLoaded", function(event) {
var custom = JSON.parse(window.ControlUtils.getCustomData());
readerControl.setCurrentPageNumber(custom.startPage);
});
var custom = JSON.parse(window.ControlUtils.getCustomData());
ReaderControl.config.StartPageNum = custom ? custom.StartPageNum : 1;
$(document).bind("documentLoaded", function(event){
//document finished loading
readerControl.setCurrentPageNumber(ReaderControl.config.StartPageNum);
});
var custom = JSON.parse(window.ControlUtils.getCustomData());
var startPageNum = custom ? custom.StartPageNum : 1;
$(document).bind("documentLoaded", function(event){
//document finished loading
readerControl.setCurrentPageNumber(startPageNum);
});
We were replying at the same time :)
I tried what you had there for the custom, exactly as you had it and it did work. I tried it all over the place in ReaderControl.js starting right under
var CoreControls = exports.CoreControls;
var custom = JSON.parse(window.ControlUtils.getCustomData());
ReaderControl.config.StartPageNum = custom ? custom.StartPageNum : 1;
$(document).bind("documentLoaded", function(event){
//document finished loading
readerControl.setCurrentPageNumber(ReaderControl.config.StartPageNum);
});
No matter what I tried I would get page 1 (I didn't see any errors in the console and I did get the viewer).
-Chris
On Tuesday, August 27, 2013 3:06:37 PM UTC-4, Matt Parizeau wrote:
var viewerElement = document.getElementById('viewer');
var myWebViewer = new PDFTron.WebViewer({
type: 'html5,flash,silverlight',
initialDoc: "pathtoxod"
}, viewerElement);
$(viewerElement).on('documentLoaded', function(evt) {
setTimeout(function() {
myWebViewer.setCurrentPageNumber(4);
}, 0);
});