mirror of
https://github.com/electron/electron.git
synced 2026-05-02 03:00:22 -04:00
fix: honor pageRanges when printing (#25064)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user