Pdfexport from cmdline

How do you export a pdf of a dashboard from the terminal? I’ve tried curl, wget & google-chrome --headless (also tried screenshot with the last). I keep getting empty or unreadable pdf’s/screenshots. I want to export the graphite/icinga dashboard with cron.