Skip to content
This repository has been archived by the owner on Jan 2, 2023. It is now read-only.

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

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

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

ghost opened this issue Aug 5, 2014 · 3 comments
Labels
Milestone

Comments

@ghost
Copy link

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 Bug & solution: --window-status causes endless loop with --header-html, --footer-html, ... Bug & solution: --window-status causes endless loop with --header-html, --footer-html, toc, ... Aug 5, 2014
@ashkulz
Copy link
Member

ashkulz commented Sep 11, 2014

Thanks for the analysis!

@ashkulz ashkulz added the Verified The issue is verified. label Sep 11, 2014
@ashkulz ashkulz added this to the 0.12.2 milestone Sep 11, 2014
@ashkulz ashkulz changed the title Bug & solution: --window-status causes endless loop with --header-html, --footer-html, toc, ... --window-status causes endless loop with --header-html Sep 11, 2014
@ashkulz ashkulz closed this as completed in e02ff7e Jan 3, 2015
@ashkulz ashkulz added Fixed and removed Verified The issue is verified. labels Jan 3, 2015
@ashkulz
Copy link
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
Copy link
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
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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

1 participant