SetAutoResizeEnabled and resulting width

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

SetAutoResizeEnabled and resulting width

Postby Elvner » Mon Jan 11, 2021 7:36 am

When using SetAutoResizeEnabled with offline rendering min_size set to (1,1) and max_size set to arbitrary large value - CEF tries to autosize source page not the same way it renders it without autosize, but to minimal possible width.
Code: Select all
test test test
test2 test2 test2


becomes
Code: Select all
test
test
test
test2
test2
test2


up to CEF adding scroller in resulting image but not increasing width. Is it possible to overcome this behaviour and render the HTML same way as without autosize?
Elvner
Newbie
 
Posts: 2
Joined: Mon Jan 11, 2021 7:20 am

Re: SetAutoResizeEnabled and resulting width

Postby magreenblatt » Mon Jan 11, 2021 12:59 pm

You should use CSS to specify the constraints for rendering the page. For example, put the text in a <div style="min-width: 100px">
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: SetAutoResizeEnabled and resulting width

Postby Elvner » Tue Jan 12, 2021 4:07 am

I have limited control over incoming HTML, isn't it possible to change AutoSize behavior to match default rendering (overall or by some settings)? And to be honest that way it's much less useful overall.

Or return OnContentsSizeChange (because with this behavior of AutoSize it's impossible to emulate OnContentsSizeChange via AutoSize).
Elvner
Newbie
 
Posts: 2
Joined: Mon Jan 11, 2021 7:20 am


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 50 guests

cron