README_WKHTMLTOIMAGE 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. =====================> wkhtmltoimage 0.10.0 beta4 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, Emmanuel Bouthenot, Benoit Garret and Mário Silva.
  16. ==================================> Synopsis <==================================
  17. wkhtmltoimage [OPTIONS]... <input file> <output file>
  18. ==============================> General Options <===============================
  19. --allow <path> Allow the file or files from the specified
  20. folder to be loaded (repeatable)
  21. --cookie <name> <value> Set an additional cookie (repeatable)
  22. --cookie-jar <path> Read and write cookies from and to the
  23. supplied cookie jar file
  24. --crop-h <int> Set height for croping
  25. --crop-w <int> Set width for croping
  26. --crop-x <int> Set x coordinate for croping
  27. --crop-y <int> Set y coordinate for croping
  28. --custom-header <name> <value> Set an additional HTTP header (repeatable)
  29. --custom-header-propagation Add HTTP headers specified by
  30. --custom-header for each resource request.
  31. --no-custom-header-propagation Do not add HTTP headers specified by
  32. --custom-header for each resource request.
  33. --debug-javascript Show javascript debugging output
  34. --no-debug-javascript Do not show javascript debugging output
  35. (default)
  36. --encoding <encoding> Set the default text encoding, for input
  37. -H, --extended-help Display more extensive help, detailing
  38. less common command switches
  39. -f, --format <format> Output file format (default is jpg)
  40. -h, --help Display help
  41. --htmldoc Output program html help
  42. --images Do load or print images (default)
  43. --no-images Do not load or print images
  44. -n, --disable-javascript Do not allow web pages to run javascript
  45. -n, --enable-javascript Do allow web pages to run javascript
  46. (default)
  47. --javascript-delay <msec> Wait some milliseconds for javascript
  48. finish (default 200)
  49. --load-error-handling <handler> Specify how to handle pages that fail to
  50. load: abort, ignore or skip (default
  51. abort)
  52. --disable-local-file-access Do not allowed conversion of a local file
  53. to read in other local files, unless
  54. explecitily allowed with --allow
  55. --enable-local-file-access Allowed conversion of a local file to read
  56. in other local files. (default)
  57. --manpage Output program man page
  58. --minimum-font-size <int> Minimum font size
  59. --password <password> HTTP Authentication password
  60. --disable-plugins Disable installed plugins (default)
  61. --enable-plugins Enable installed plugins (plugins will
  62. likely not work)
  63. --post <name> <value> Add an additional post field (repeatable)
  64. --post-file <name> <path> Post an additional file (repeatable)
  65. -p, --proxy <proxy> Use a proxy
  66. --quality <int> Output image quality (between 0 and 100)
  67. (default 94)
  68. --readme Output program readme
  69. -0, --disable-smart-width * Use the specified width even if it is not
  70. large enough for the content
  71. --stop-slow-scripts Stop slow running javascripts (default)
  72. --no-stop-slow-scripts Do not Stop slow running javascripts
  73. (default)
  74. --transparent * Make the background transparent in pngs
  75. --use-xserver * Use the X server (some plugins and other
  76. stuff might not work without X11)
  77. --user-style-sheet <url> Specify a user style sheet, to load with
  78. every page
  79. --username <username> HTTP Authentication username
  80. -V, --version Output version information an exit
  81. --width <int> Set screen width (default is 1024)
  82. (default 1024)
  83. --zoom <float> Use this zoom factor (default 1)
  84. Items marked * are only available using patched QT.
  85. =============================> Specifying A Proxy <=============================
  86. By default proxy information will be read from the environment variables: proxy,
  87. all_proxy and http_proxy, proxy options can also by specified with the -p switch
  88. <type> := "http://" | "socks5://"
  89. <serif> := <username> (":" <password>)? "@"
  90. <proxy> := "None" | <type>? <sering>? <host> (":" <port>)?
  91. Here are some examples (In case you are unfamiliar with the BNF):
  92. http://user:password@myproxyserver:8080
  93. socks5://myproxyserver
  94. None
  95. ===============================> Static version <===============================
  96. On the wkhtmltopdf website you can download a static version of wkhtmltopdf
  97. <http://code.google.com/p/wkhtmltopdf/downloads/list>. This static binary will
  98. work on most systems and comes with a build in patched QT.
  99. Unfortunately the static binary is not particularly static, on Linux it depends
  100. on both glibc and openssl, furthermore you will need to have an xserver
  101. installed but not necessary running. You will need to have different fonts
  102. install including xfonts-scalable (Type1), and msttcorefonts. See
  103. <http://code.google.com/p/wkhtmltopdf/wiki/static> for trouble shouting.
  104. ================================> Compilation <=================================
  105. It can happen that the static binary does not work for your system for one
  106. reason or the other, in that case you might need to compile wkhtmltoimage
  107. yourself.
  108. ================================> Installation <================================
  109. There are several ways to install wkhtmltoimage. You can download a already
  110. compiled binary, or you can compile wkhtmltoimage yourself.
  111. ==================================> Examples <==================================
  112. This section presents a number of examples of how to invoke wkhtmltoimage.
  113. To convert a remote HTML file to PNG:
  114. wkhtmltoimage http://www.google.com google.png
  115. To convert a local HTML file to PNG:
  116. wkhtmltoimage my.html my.png