6

I'm trying to use chrome headless print to pdf option to print some pdf Files in ubuntu and here's my command line :

google-chrome --headless --disable-gpu --print-to-pdf  http://www.google.com

Now if I ran it like that it runs perfecly and the file is generated.

BUT when I add the name of the file after --print-to-pdf :

google-chrome --headless --disable-gpu --print-to-pdf gen.pdf http://www.google.com

an error occur :

[1213/020159.194304:ERROR:headless_shell.cc(605)] Open multiple tabs is only supported when remote debugging is enabled.

Any solution to this ? thx.

OddDev
  • 1,521
  • 7
  • 23
  • 45

1 Answers1

8

You're missing an = between --print-to-pdf and gen.pdf.

This should work:

google-chrome --headless --disable-gpu --print-to-pdf=gen.pdf http://www.google.com

Similar question asked here

Emil Hernqvist
  • 188
  • 1
  • 7