README_WKHTMLTOIMAGE 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. ======================> wkhtmltoimage 0.10.0 rc2 Manual <=======================
  2. This file documents wkhtmltoimage, a program capable of converting HTML
  3. documents into images.
  4. ==================================> Contact <===================================
  5. If you experience bugs or want to request new features please visit
  6. <http://code.google.com/p/wkhtmltopdf/issues/list>, if you have any problems or
  7. comments please feel free to contact me: <uuf6429@gmail.com>
  8. ==================================> License <===================================
  9. Copyright (C) 2010 wkhtmltopdf/wkhtmltoimage Authors.
  10. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
  11. This is free software: you are free to change and redistribute it. There is NO
  12. WARRANTY, to the extent permitted by law.
  13. ==================================> Authors <===================================
  14. Written by Jan Habermann, Christian Sciberras and Jakob Truelsen. Patches by
  15. Mehdi Abbad, Lyes Amazouz, Pascal Bach, Emmanuel Bouthenot, Benoit Garret and
  16. Mário Silva.
  17. ==================================> Synopsis <==================================
  18. wkhtmltoimage [OPTIONS]... <input file> <output file>
  19. ==============================> General Options <===============================
  20. --allow <path> Allow the file or files from the specified
  21. folder to be loaded (repeatable)
  22. --checkbox-checked-svg <path> Use this SVG file when rendering checked
  23. checkboxes
  24. --checkbox-svg <path> Use this SVG file when rendering unchecked
  25. checkboxes
  26. --cookie <name> <value> Set an additional cookie (repeatable)
  27. --cookie-jar <path> Read and write cookies from and to the
  28. supplied cookie jar file
  29. --crop-h <int> Set height for croping
  30. --crop-w <int> Set width for croping
  31. --crop-x <int> Set x coordinate for croping
  32. --crop-y <int> Set y coordinate for croping
  33. --custom-header <name> <value> Set an additional HTTP header (repeatable)
  34. --custom-header-propagation Add HTTP headers specified by
  35. --custom-header for each resource request.
  36. --no-custom-header-propagation Do not add HTTP headers specified by
  37. --custom-header for each resource request.
  38. --debug-javascript Show javascript debugging output
  39. --no-debug-javascript Do not show javascript debugging output
  40. (default)
  41. --encoding <encoding> Set the default text encoding, for input
  42. -H, --extended-help Display more extensive help, detailing
  43. less common command switches
  44. -f, --format <format> Output file format (default is jpg)
  45. --height <int> Set screen height (default is calculated
  46. from page content) (default 0)
  47. -h, --help Display help
  48. --htmldoc Output program html help
  49. --images Do load or print images (default)
  50. --no-images Do not load or print images
  51. -n, --disable-javascript Do not allow web pages to run javascript
  52. --enable-javascript Do allow web pages to run javascript
  53. (default)
  54. --javascript-delay <msec> Wait some milliseconds for javascript
  55. finish (default 200)
  56. --load-error-handling <handler> Specify how to handle pages that fail to
  57. load: abort, ignore or skip (default
  58. abort)
  59. --disable-local-file-access Do not allowed conversion of a local file
  60. to read in other local files, unless
  61. explecitily allowed with --allow
  62. --enable-local-file-access Allowed conversion of a local file to read
  63. in other local files. (default)
  64. --manpage Output program man page
  65. --minimum-font-size <int> Minimum font size
  66. --password <password> HTTP Authentication password
  67. --disable-plugins Disable installed plugins (default)
  68. --enable-plugins Enable installed plugins (plugins will
  69. likely not work)
  70. --post <name> <value> Add an additional post field (repeatable)
  71. --post-file <name> <path> Post an additional file (repeatable)
  72. -p, --proxy <proxy> Use a proxy
  73. --quality <int> Output image quality (between 0 and 100)
  74. (default 94)
  75. --radiobutton-checked-svg <path> Use this SVG file when rendering checked
  76. radiobuttons
  77. --radiobutton-svg <path> Use this SVG file when rendering unchecked
  78. radiobuttons
  79. --readme Output program readme
  80. --run-script <js> Run this additional javascript after the
  81. page is done loading (repeatable)
  82. -0, --disable-smart-width * Use the specified width even if it is not
  83. large enough for the content
  84. --stop-slow-scripts Stop slow running javascripts (default)
  85. --no-stop-slow-scripts Do not Stop slow running javascripts
  86. (default)
  87. --transparent * Make the background transparent in pngs
  88. --use-xserver * Use the X server (some plugins and other
  89. stuff might not work without X11)
  90. --user-style-sheet <url> Specify a user style sheet, to load with
  91. every page
  92. --username <username> HTTP Authentication username
  93. -V, --version Output version information an exit
  94. --width <int> Set screen width (default is 1024)
  95. (default 1024)
  96. --window-status <windowStatus> Wait until window.status is equal to this
  97. string before rendering page
  98. --zoom <float> Use this zoom factor (default 1)
  99. Items marked * are only available using patched QT.
  100. =============================> Specifying A Proxy <=============================
  101. By default proxy information will be read from the environment variables: proxy,
  102. all_proxy and http_proxy, proxy options can also by specified with the -p switch
  103. <type> := "http://" | "socks5://"
  104. <serif> := <username> (":" <password>)? "@"
  105. <proxy> := "None" | <type>? <sering>? <host> (":" <port>)?
  106. Here are some examples (In case you are unfamiliar with the BNF):
  107. http://user:password@myproxyserver:8080
  108. socks5://myproxyserver
  109. None
  110. ===============================> Static version <===============================
  111. On the wkhtmltopdf website you can download a static version of wkhtmltopdf
  112. <http://code.google.com/p/wkhtmltopdf/downloads/list>. This static binary will
  113. work on most systems and comes with a build in patched QT.
  114. Unfortunately the static binary is not particularly static, on Linux it depends
  115. on both glibc and openssl, furthermore you will need to have an xserver
  116. installed but not necessary running. You will need to have different fonts
  117. install including xfonts-scalable (Type1), and msttcorefonts. See
  118. <http://code.google.com/p/wkhtmltopdf/wiki/static> for trouble shouting.
  119. ================================> Compilation <=================================
  120. It can happen that the static binary does not work for your system for one
  121. reason or the other, in that case you might need to compile wkhtmltoimage
  122. yourself.
  123. ================================> Installation <================================
  124. There are several ways to install wkhtmltoimage. You can download a already
  125. compiled binary, or you can compile wkhtmltoimage yourself.
  126. ==================================> Examples <==================================
  127. This section presents a number of examples of how to invoke wkhtmltoimage.
  128. To convert a remote HTML file to PNG:
  129. wkhtmltoimage http://www.google.com google.png
  130. To convert a local HTML file to PNG:
  131. wkhtmltoimage my.html my.png