imgkit icon indicating copy to clipboard operation
imgkit copied to clipboard

OSError: wkhtmltoimage exited with non-zero code 1. error: Unknown long argument --orientation

Open Taukurade opened this issue 5 years ago • 2 comments

Im using code from example

body = """
<html>
  <head>
    <meta name="imgkit-format" content="png"/>
    <meta name="imgkit-orientation" content="Landscape"/>
  </head>
  Hello World!
  </html>
"""
	imgkit.from_string(body,'name.jpg')

and i get error:

OSError: wkhtmltoimage exited with non-zero code 1. error:
Unknown long argument --orientation

Name:
  wkhtmltoimage 0.12.5 (with patched qt)

Synopsis:
  wkhtmltoimage [OPTIONS]... <input file> <output file>

Description:
  Converts an HTML page into an image,

General Options:
      --crop-h <int>                  Set height for cropping
      --crop-w <int>                  Set width for cropping
      --crop-x <int>                  Set x coordinate for cropping
      --crop-y <int>                  Set y coordinate for cropping
  -H, --extended-help                 Display more extensive help, detailing
                                  less common command switches
  -f, --format <format>               Output file format (default png)
      --height <int>                  Set screen height (default is calculated
                                    from page content) (default 0)
  -h, --help                          Display help
      --license                       Output license information and exit
      --log-level <level>             Set log level to: none, error, warn or
                                  info (default info)
      --quality <int>                 Output image quality (between 0 and 100)
                                    (default 94)
  -q, --quiet                         Be less verbose, maintained for backwards
                                     compatibility; Same as using --log-level
                                   none
  -V, --version                       Output version information and exit
      --width <int>                   Set screen width, note that this is used
                                    only as a guide line. Use
                   --disable-smart-width to make it strict.
                 (default 1024)
Contact:
  If you experience bugs or want to request new features please visit
  <https://github.com/wkhtmltopdf/wkhtmltopdf/issues>

Taukurade avatar Jan 01 '20 13:01 Taukurade

I'm having the same problem, with the same input.

gil-opplane avatar Apr 15 '20 17:04 gil-opplane

delete name values

body = """
<html>
  <head>
    <meta  content="png"/>
    <meta  content="Landscape"/>
  </head>
  Hello World!
  </html>
"""
imgkit.from_string(body,'name.jpg')

chenjinzhi1990 avatar Jun 10 '20 07:06 chenjinzhi1990