fix: honor pageRanges when printing (#25064)
This commit is contained in:
parent
8f727b3569
commit
a4b6fce907
5 changed files with 146 additions and 15 deletions
|
@ -2069,8 +2069,9 @@ void WebContents::Print(gin::Arguments* args) {
|
|||
int from, to;
|
||||
if (range.Get("from", &from) && range.Get("to", &to)) {
|
||||
base::Value range(base::Value::Type::DICTIONARY);
|
||||
range.SetIntKey(printing::kSettingPageRangeFrom, from);
|
||||
range.SetIntKey(printing::kSettingPageRangeTo, to);
|
||||
// Chromium uses 1-based page ranges, so increment each by 1.
|
||||
range.SetIntKey(printing::kSettingPageRangeFrom, from + 1);
|
||||
range.SetIntKey(printing::kSettingPageRangeTo, to + 1);
|
||||
page_range_list.Append(std::move(range));
|
||||
} else {
|
||||
continue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue