feat: allow specifying pageSize for print (#22014)
This commit is contained in:
parent
385388dd6b
commit
928175bdfe
5 changed files with 48 additions and 2 deletions
|
@ -1897,6 +1897,12 @@ void WebContents::Print(gin_helper::Arguments* args) {
|
|||
options.Get("duplexMode", &duplex_mode);
|
||||
settings.SetIntKey(printing::kSettingDuplexMode, duplex_mode);
|
||||
|
||||
// We've already done necessary parameter sanitization at the
|
||||
// JS level, so we can simply pass this through.
|
||||
base::Value media_size(base::Value::Type::DICTIONARY);
|
||||
if (options.Get("mediaSize", &media_size))
|
||||
settings.SetKey(printing::kSettingMediaSize, std::move(media_size));
|
||||
|
||||
// Set custom dots per inch (dpi)
|
||||
gin_helper::Dictionary dpi_settings;
|
||||
int dpi = 72;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue