New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--window-status causes endless loop with --header-html #1892

Closed
ghost opened this Issue Aug 5, 2014 · 3 comments

Comments

Projects
None yet
1 participant
@ghost

ghost commented Aug 5, 2014

As soon as --header-html and/or --footer-html is used together with --window-status, no data is returned, the command never stops.

Found the problem/solution by studying the sourcecode...

The html of --header-html and/or --footer-html also has to set the window.status to the same value as main page, e.g. with <script>window.status = 'myrandomstring';</script>. Then --window-status feature works as expected.

The problem can be seen in file multipageloader.cc in void ResourceObject::loadFinished(), it is connected to all resources in pdfconverter.cc, including header and footer (hfLoader) and compares (windowStatus != settings.windowStatus) for all resources, btw. also for toc --xsl-style-sheet if used.

Would suggest to use the current ResourceObject::loadFinished() for pageLoader and a different one without waitWindowStatus() check for measuringHFLoader hfLoader tocLoader1 and tocLoader2.

This also solves #1725 and an old ticket https://code.google.com/p/wkhtmltopdf/issues/detail?id=938

wkhtmltopdf 0.12.1, 32-bit for Windows XP/2003 or later

@ghost ghost changed the title from Bug & solution: --window-status causes endless loop with --header-html, --footer-html, ... to Bug & solution: --window-status causes endless loop with --header-html, --footer-html, toc, ... Aug 5, 2014

@ashkulz

This comment has been minimized.

Member

ashkulz commented Sep 11, 2014

Thanks for the analysis!

@ashkulz ashkulz added the Verified label Sep 11, 2014

@ashkulz ashkulz added this to the 0.12.2 milestone Sep 11, 2014

@ashkulz ashkulz changed the title from Bug & solution: --window-status causes endless loop with --header-html, --footer-html, toc, ... to --window-status causes endless loop with --header-html Sep 11, 2014

@ashkulz ashkulz closed this in e02ff7e Jan 3, 2015

@ashkulz ashkulz added Fixed and removed Verified labels Jan 3, 2015

@ashkulz

This comment has been minimized.

Member

ashkulz commented Jan 4, 2015

A release candidate 0.12.2-rc-71e97c1 is available, which should fix this issue. Please report back if your issue is not solved with the above build.

@ashkulz

This comment has been minimized.

Member

ashkulz commented Jan 10, 2015

0.12.2 has been released, which includes changes related to this issue.

ashkulz added a commit that referenced this issue Jan 14, 2015

fix wkhtmltoimage ignoring --javascript-delay and --window-status
This was due to e02ff7e, which
attempted to solve #1892. However, this caused a regression as no
corresponding changes were made in wkhtmltoimage.

Fixes #2142
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment