我想从登录页面后面的页面制作几个pdf 。当我尝试从他们的页面上获取基本信息时:
var htmlToPdf = new HtmlToPdfConverter();
htmlToPdf.GeneratePdfFromFile("url-of-page", null, "export.pdf");
当您未登录时,我会看到该网站提供的页面。
当我尝试给它 cookie 时(该网站有 2 个):
var htmlToPdf = new HtmlToPdfConverter();
htmlToPdf.CustomWkHtmlArgs = " --cookie name1 value1";
htmlToPdf.CustomWkHtmlArgs = " --cookie name2 value2";
htmlToPdf.GeneratePdfFromFile("url-of-page", null, "export.pdf");
我得到登录页面。好像我输入了错误的东西,但我从邮递员那里1
得到了饼干。1
我是否使用了错误的名称和值格式?
我尝试通过一个httpClient
,并且 cookie 在那里工作并且我到达页面,但是当我这样做时我无法获得图片和css 。