Skip to content

Commit

Permalink
[ADD] US letter #757
Browse files Browse the repository at this point in the history
  • Loading branch information
Viglino committed Apr 7, 2022
1 parent 7f83719 commit 23e6301
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/control/PrintDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -724,6 +724,7 @@ ol_control_PrintDialog.prototype.paperSize = {
'A2': [420,594],
'A3': [297,420],
'A4': [210,297],
'US Letter': [215.9,279.4],
'A5': [148,210],
'B4': [257,364],
'B5': [182,257]
Expand Down Expand Up @@ -824,7 +825,13 @@ ol_control_PrintDialog.prototype.setSize = function (size) {
if (!size) return;

if (typeof(size) === 'string') {
size = size.toLocaleUpperCase();
// Test uppercase
for (var k in this.paperSize) {
if (k && new RegExp(k, 'i').test(size)) {
size = k;
}
}
// Default
if (!this.paperSize[size]) size = this._size = 'A4';
this._input.size.value = size;
size = [
Expand Down

0 comments on commit 23e6301

Please sign in to comment.