I'm trying to make PDF's of some webpages on the same site but since the website is behind Windows Authentication it failes. I can load the page markup using a HttpRequest and WindowsIdentity.Impersonate() but when the PDF plugin tries to create the PDF this is, naturally, without any stylesheets.
I'm using TuesPechkin and wkhtmltopdf to generate the PDF's. This is a ASP.NET webforms solution. Any suggestions?
I think the LoadSettings class is where you want to look. If the
Username
andPassword
properties don't propagate through to the external resources (CSS, images, etc.) you can try setting up a basicAuthentication
header yourself in theCustomHeaders
dictionary and setting theRepeatCustomHeaders
property totrue
.