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

Command line size limitation #23

Open
A---- opened this issue Oct 9, 2017 · 0 comments
Open

Command line size limitation #23

A---- opened this issue Oct 9, 2017 · 0 comments

Comments

@A----
Copy link
Contributor

A---- commented Oct 9, 2017

There's a finite amount of characters that can be used on the command line. This limit varies across systems and all but if a user adds too many pages, this can cause the process to fail or output unexpected results.

wkhtmltopdf seems to handle this issue by providing the --read-args-from-stdin parameters, with the following documentation:

Reading arguments from stdin:
  If you need to convert a lot of pages in a batch, and you feel that
  wkhtmltopdf is a bit too slow to start up, then you should try
  --read-args-from-stdin,

  When --read-args-from-stdin each line of input sent to wkhtmltopdf on stdin
  will act as a separate invocation of wkhtmltopdf, with the arguments specified
  on the given line combined with the arguments given to wkhtmltopdf

  For example one could do the following:

  echo "http://qt-project.org/doc/qt-4.8/qapplication.html qapplication.pdf" >> cmds
  echo "cover google.com http://en.wikipedia.org/wiki/Qt_(software) qt.pdf" >> cmds
  wkhtmltopdf --read-args-from-stdin --book < cmds

See there: https://wkhtmltopdf.org/usage/wkhtmltopdf.txt

Also, I wonder if it would be possible to “demonize” the process by never closing the stdin of wkhtmltopdf, printing/flushing a line whenever a PDF is required.

@jhonnymertz jhonnymertz added this to the 1.1.0.RELEASE milestone Oct 9, 2017
@jhonnymertz jhonnymertz added the bug label Oct 9, 2017
@jhonnymertz jhonnymertz removed this from the 1.2.0.RELEASE milestone Oct 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants