0

I have an HTML file containing a slideshow, and I would like to print it in PDF. What I do so far is opening the file with Brave Browser and printing it in PDF from Brave (this only works with browsers with a Chromium base). I would like to automate this, so that I can print it with a single script.

I can open the file in Brave with:

brave-browser html_file.html

I am now wondering if I can print the page in PDF using Brave from the command line. Is this possible? More generally, can we replicate actions in browsers from the command line?

6
  • Did you check brave-browser documentation? Maybe it has a command line option like "-print" or something?
    – raj
    Aug 11, 2020 at 13:34
  • I couldn't even find a list of possible options here, unless I didn't search at the right place. Sorry I don't know where to find this information
    – bretauv
    Aug 11, 2020 at 13:46
  • Well.. this documentation is very minimal :( I found something here by searching for "brave-browser command line options": support.brave.com/hc/en-us/articles/… . It refers to Windows version of Brave, but I think options are the same. Seems there is --print-to-pdf option...
    – raj
    Aug 11, 2020 at 16:35
  • It's strange because adding --incognito after the command in my post opens the HTML file in a private window (as expected) but --print-to-pdf does not work. Could you test it?
    – bretauv
    Aug 12, 2020 at 8:35
  • I can't because I don't have that browser. I just found some info that I shared with you.
    – raj
    Aug 12, 2020 at 13:02

0

You must log in to answer this question.

Browse other questions tagged .