To obtain pdf via chrome

/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --headless --disable-gpu --print-to-pdf index.html

To autocrop the pdf to the smallest size

pdf-crop-margins -s -u -p 0 output.pdf 