Page 1 of 1

Activate PrintSetting fitInPage per default

PostPosted: Thu Aug 26, 2021 4:53 am
by Phylanx
Hi!

Upon upgrading JCEF to version 4147 I activated the chromium print dialog per default.
Now the customers asked if the "fit in page" setting can be applied automatically.

Following soluations are OK:

1. Always activate the fit in page per default (if available)
2. if 1. is not possible remember the setting like in Chrome.

Ad 1.:
Is there a setting/code place somewhere deep down in the chromium printing dialog where I can set this setting this by default?

Ad 2.:
We already had a discussion about that, see viewtopic.php?f=17&t=18036
The problem was that the UserPrefs.json is not written/used correctly in JCEF (didn't verify on CEF alone).
Has something changed with the implementation of the Chrome Runtime instead of the Alloy Runtime?
Are there other news you are aware of on this?

Re: Activate PrintSetting fitInPage per default

PostPosted: Thu Aug 26, 2021 8:50 am
by magreenblatt
The comments in the thread you link still seem relevant.

Re: Activate PrintSetting fitInPage per default

PostPosted: Fri Aug 27, 2021 12:46 am
by Phylanx
That is - I guess - for the UserPrefs topic.

More important for me is the possibility to automatically or programatically set the "fit in page" in the print dialog without prefs.
Do you know a code place where I can start searching?

Re: Activate PrintSetting fitInPage per default

PostPosted: Fri Aug 27, 2021 9:49 am
by magreenblatt
CefPrintViewManager::GetDefaultPrintSettings is likely a good starting point.