Closed jcoleman1969 closed 5 years ago
Nice!
I think -delay
is fragile, because the necessary timeout differs depending on host machine specs, system load, input size, etc. In long-term, I'd want a callback for the page to fire when ready. For one-shots, -delay
is useful as-is.
I just noticed that -delay doesn't seem to work consistently in the release build. I'm not sure why it's different than the debug build, but maybe just doing a sleep in Client::OnLoadEnd() isn't allowing the message loop to run? I was thinking it may be better to set a flag in OnLoadEnd() that the load is finished and then call m_jobManager->Process() from elsewhere after the timeout has expired. Do you have any ideas on where we could call it from? Thanks!
I changed to using CefPostDelayedTask() instead of sleeping, and now --delay works reliably on both builds.
The CefRefPtr is declared as CefRefPtr
On Sun, Apr 14, 2019 at 4:41 PM Sebastian Pająk notifications@github.com wrote:
@spajak commented on this pull request.
In src/Client.cpp https://github.com/spajak/cef-pdf/pull/29#discussion_r275173359:
@@ -308,4 +322,16 @@ void Client::OnRenderProcessTerminated( DLOG(INFO) << "Client::OnRenderProcessTerminated"; }
+void Client::SetViewWidth(int viewWidth) +{
- RenderHandler renderHandler = (RenderHandler)(m_renderHandler.get());
Use CefRefPtr instead
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/spajak/cef-pdf/pull/29#pullrequestreview-226412366, or mute the thread https://github.com/notifications/unsubscribe-auth/AtaTBsPngZy22h01YdQgN8WFmdWz_Ecbks5vg5KEgaJpZM4a6tQ8 .
Yes. Change declaration. It should not break anything
Thanks. You could also update README if you can
-scale= to set pdfSettings.scale_factor
-delay= to delay after page load before rendering pdf (in my case allowed D3 charts to finish animating before creating the PDF)
-viewwidth= to set viewport width (in my case setting the width to 1600 fixed a table that was trying to size to 100% and getting cut off at 128px wide, which is the default)
-viewheight= added for parity, could be useful if element was specified as height=100%