Using phantom js to render a html page into pdf/image. sudo apt-get install phantomjs fixing QXcbConnection: Could not connect to display run the command with these environment parameters QT_QPA_PLATFORM=offscreen phantomjs