loleaflet: map.getPageSizes - returns the size of each page

In twips and pixels
This commit is contained in:
Mihai Varga 2015-10-15 19:17:18 +03:00
parent 3ba0bd6aeb
commit 1588dd5f5d
3 changed files with 12 additions and 5 deletions

View file

@ -203,6 +203,8 @@ Writer pages:
+ options = {autoUpdate: true} - automatically updates the previews
map.removePreviewUpdate(id)
+ id = the preview's id
map.getPageSizes()
+ returns {twips: [Bounds], pixels: [Bounds]}
- events
map.on('pagenumberchanged', function (e) {}) where:

View file

@ -1422,6 +1422,12 @@ var map = L.map('map', {
<td>Returns the document type.</td>
</tr>
<tr>
<td><code><b>getPageSizes</b>()</code></td>
<td><code><nobr>{twips: <a href="#bounds">[Bounds]</a>,<br>
pixels: <a href="#bounds">[Bounds]</a>}</nobr></code></td>
<td>Returns an object describing the size of each page in twips and pixels.</td>
</tr>
<tr>
<td><code><b>scroll</b>(
<nobr>&lt;Number&gt;<i>x</i>,</nobr>
<nobr>&lt;Number&gt;<i>y</i>,</nobr>

View file

@ -164,11 +164,10 @@ L.Map.include({
return this._docLayer._docPixelSize;
},
getPageSize: function (page) {
if (this._docLayer._partPageRectanglesPixels && this._docLayer._partPageRectanglesPixels.length > page) {
return this._docLayer._partPageRectanglesPixels[page];
}
return null;
getPageSizes: function () {
return {
twips: this._docLayer._partPageRectanglesTwips,
pixels: this._docLayer._partPageRectanglesPixels};
},
getDocType: function () {