Skip to content
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

Using HTML headers and footers causes large documents to fail #9

Closed
metmajer opened this issue Feb 2, 2020 · 0 comments · Fixed by #10
Closed

Using HTML headers and footers causes large documents to fail #9

metmajer opened this issue Feb 2, 2020 · 0 comments · Fixed by #10
Assignees
Labels
bug Something isn't working

Comments

@metmajer
Copy link
Member

metmajer commented Feb 2, 2020

We use wkhtmltopdf to convert HTML to PDF. Using externalized headers and footers in dedicated HTML files causes wkhtmltopdf to open a file reference to each of these files for every page in the resulting PDF file -- and does not close these references until the entire PDF document has been fully generated.

Consequently, this causes issues with larger documents, as we unavoidably either produce a buffer overflow, or reach a system-wide limit for the maximum number of open files (ref. ulimit -n ). See wkhtmltopdf/wkhtmltopdf#2093 for more information. For larger documents ( > 100 pages), this behavior has resulted in socket timeout exceptions and document generation times of > 20 minutes.

A scalable solution will need to replace externalized HTML header and footer with a simplified, textual representation so that each document produces only a single open file handle.

@metmajer metmajer self-assigned this Feb 2, 2020
@metmajer metmajer added the bug Something isn't working label Feb 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant