简体   繁体   English

使用IIS7的wkhtmltppdf的Cookie

[英]Cookie for wkhtmltppdf using IIS7

I'm using wkhtmltopdf creating PDF from my html site. 我正在使用wkhtmltopdf从我的html网站创建PDF。 This works fine in development but when I upload it to the webserver with IIS7 I have the problem with the user. 这在开发中效果很好,但是当我使用IIS7将其上传到Web服务器时,用户遇到了问题。

In the site I use the windows authentification to log on the current user and also display the username on the site. 在站点中,我使用Windows身份验证登录当前用户,并在站点上显示用户名。

But the problem is that wenn the pdf is generating the current user isn't used so that I get an error. 但是问题是,没有使用pdf生成当前用户,所以我得到了一个错误。 I don't want to use a temp-user for login (wkhtmltopdf.exe --username...) because this would be displayed on the website and also on the pdf. 我不想使用临时用户登录(wkhtmltopdf.exe --username ...),因为这将显示在网站上以及pdf上。

Already tried the impersonate 已经尝试过模仿

<system.web>
<authentication mode="Windows"/>
<identity impersonate="true"/>
</system.web>

but then I get 但后来我明白了

You are not authorized to view this page due to invalid authentication headers

I looked around and tried for a while but get no working solution for me to create a cookie or something like that and give it to wkhtmltopdf to create the pdf with the current user logged on. 我环顾了一下,尝试了一段时间,但没有任何有效的解决方案来创建Cookie或类似的东西,并将其提供给wkhtmltopdf以在当前用户登录的情况下创建pdf。 Thanks for your help 谢谢你的帮助

如果使用的是表单身份验证,则可以使用--cookie选项将ASP.NET_SessionId cookie传递给wkhtmltopdf。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM