Hello.
The part regarding the calculation of paper size (https://github.com/Igor-Vladyka/leaflet.browser.print/blob/d8052cb02e338fe907d8e67cd4d5002f2227162c/src/leaflet.browser.print.helpers.js#L49C1-L78C4) is correct from A0 to A4 in A-format, but incorrect from A5.
The proposed correction is below.
if (switchSides) {
- w = w / (mode.options.pageSeriesSize - 1 || 1);
+ w = w / Math.pow(2,Math.floor(mode.options.pageSeriesSize / 2));
- h = h / (mode.options.pageSeriesSize + 1);
+ h = h / Math.pow(2,Math.floor(mode.options.pageSeriesSize / 2) + 1);
} else {
- w = w / mode.options.pageSeriesSize;
+ w = w / Math.pow(2,Math.floor(mode.options.pageSeriesSize / 2));
- h = h / mode.options.pageSeriesSize;
+ h = h / Math.pow(2,Math.floor(mode.options.pageSeriesSize / 2));
}
Hello.
The part regarding the calculation of paper size (https://github.com/Igor-Vladyka/leaflet.browser.print/blob/d8052cb02e338fe907d8e67cd4d5002f2227162c/src/leaflet.browser.print.helpers.js#L49C1-L78C4) is correct from A0 to A4 in A-format, but incorrect from A5.
The proposed correction is below.