Page 1 of 1

Printer Settings

PostPosted: Tue Dec 01, 2020 5:22 am
by Phylanx
Hi!

I'm currently upgrading to JCEF version 4147 and adding the new and fancy print dialog supported by chrome ("--enable-print-preview").
Now I saw that if I set the setting "fit in page" when printing PDFs, the settings is remembered while the java.exe is running, but as soon as I start a new java.exe the setting is lost.

I already found following CEF Issue for something similar (should be already in my version as this issue handles the settings between different browsers in the same java process):
https://bitbucket.org/chromiumembedded/ ... e-not-kept

In another issue I found the setting "CefSettings.persist_user_preferences = true" which looks exactly like the thing I would need.
https://bitbucket.org/chromiumembedded/ ... omatically
I didn't find it in the Java CefSettings class or any command line switch.

Is it possible to set this flag in JCEF too?
And if not, is it possible to default enable "fit in page" if available?

Re: Printer Settings

PostPosted: Tue Dec 01, 2020 11:47 am
by magreenblatt
You're welcome to add CefSettings.persist_user_preferences to JCEF and submit a PR. You might want to test with cefclient first to verify that it provides the functionality that you're seeking.

Re: Printer Settings

PostPosted: Wed Dec 02, 2020 1:34 am
by Phylanx
I could add the functionality in JCEF, (either adding "--persist-user-preferences" to command line in java or the settings.persist_user_preferences = true; hard coded in context.cpp), the UserPrefs.json is written into the cache directory.
Unfortunatly there is no content in it and the setting is not working.
There is some json structure in it but it is not filled (only filled variable is the pref_version).
Renamed file (json extension is not allowed) is attached.

Is there something that I have to implement additionally?

Re: Printer Settings

PostPosted: Wed Dec 02, 2020 4:38 am
by ndesktop
A good start would be something wired in AlloyBrowserMainParts::PostMainMessageLoopStart(), I suppose.