Generate PDF Behind Authentication Wall

后端 未结 3 1202
被撕碎了的回忆
被撕碎了的回忆 2020-12-09 18:02

I\'m trying to generate a PDF using WKHTMLTOPDF that requires me to first log in. There\'s some on this on the internet already but I can\'t seem to get mine working. I\'m i

3条回答
  •  爱一瞬间的悲伤
    2020-12-09 18:45

    You might be interested in trying to render to PDF with phantomjs.

    phantomjs rasterize.js http://blah.com/ webgl.pdf
    

    You can find rasterize.js here. Basically, you write some javascript to log in on the login page, then you do the PDF creation.

    However, the output is not the same as wkhtmltopdf. You could just save the HTML to a file, and then render with wkhtmltopdf if the phantomjs PDF output is too awful.

提交回复
热议问题