Hi Sweta,
1. These are both good ideas and we're considering adding them for a future WebViewer release (no timeline right now). It is possible for you to implement as mentioned in another post but it would take some work.
2. For this I slightly modified the code in onDoubleTap as it does something similar. You could add functions to ReaderControl like the following. Calling zoomToFitWidth(0, 0) should place it at the top.
getFitWidth: function() {
var me = this;
var currentZoom = me.docViewer.GetPageZoom(me.currentPageIndex);
var totalPageWidth = 0;
me.forEachPageInWrapper(me.currentPageIndex, function(i) {
var page = me.doc.GetPageInfo(i);
totalPageWidth += page.width * currentZoom;
});
var zoomChange = exports.innerWidth / totalPageWidth;
return zoomChange * currentZoom;
}
zoomToFitWidth: function(x, y) {
var currentZoom = this.docViewer.GetPageZoom(this.currentPageIndex);
var newPageZoom = this.getFitWidth();
var offset = this.c.$e.offset();
var width = this.c.$e.width();
var height = this.c.$e.height();
var locX = (x - offset.left) - width / 2;
var locY = (y - offset.top) - height / 2;
var scaledLocX = locX * (newPageZoom / currentZoom);
var scaledLocY = locY * (newPageZoom / currentZoom);
var offsetX = locX - scaledLocX;
var offsetY = locY - scaledLocY;
this.c.tX += offsetX;
this.c.tY += offsetY;
this.setZoomLevel(newPageZoom, false);
}
3. You could modify MobileReaderControl.js so that this isn't required. Look for the onSwipe function and in the first if statement remove
me.isZoomedIn() and
me.recentlyZoomed from the if check. This isn't going to be exactly what you want with a continuous layout as the zoom level will jump back to fit page after swiping, but may be an improvement for you. Swipes can be a bit sensitive so consider taking a look at tweaking jQuery Mobile's
swipe options if you decide to use it.
Matt Parizeau
Software Developer
PDFTron Systems Inc.