Home > Net >  There was a problem wkhtmltopdf exported web pages to PDF
There was a problem wkhtmltopdf exported web pages to PDF

Time:09-25

Everybody is good, I was hoping to upstairs in the experiment of tutorial document batch export to PDF, convenient view so that I can print to print, because there are too many documents so I chose the tools to batch export wkhtmltopdf PDF, but I have a few problems in use process,

Such as I want to export the https://www.shiyanlou.com/courses/1/labs/1/document, it is lab building teaching documents, but in the view of teaching before the document is generally going to login, so I use wkhtmltopdf export this page, the export of website is actually the login screen, this question should be how to solve?

CodePudding user response:

I want to download page should be such a


But through the command line run wkhtmltopdf https://www.shiyanlou.com/courses/1/labs/1/document D: h.p df this instruction, the actual PDF file is

CodePudding user response:

Setting cookies to wkhtmltopdf before export

CodePudding user response:

After login to export the bai, no login don't go to any export page, messed up!

CodePudding user response:

Blocked by login, fill in the browser's cookies

CodePudding user response:

Intercept is your page code to intercept him, to the login page to do some operation, can also be as the above said to add a cookie;
Stick a my way:
 
The public function itemplan_pdf () {
$this - & gt; Do_login ();
$item_plan=new ItemPlan ();
Return $item_plan - & gt; The detail (input (" id "));
}
  • Related