I'd like to make several pdfs from pages that are sitting behind a login page. When I try doing the basic info from their page:
var htmlToPdf = new HtmlToPdfConverter();
htmlToPdf.GeneratePdfFromFile("url-of-page", null, "export.pdf");
I get the page the site offers when you're not logged in.
And when I try giving it cookies (the site has 2):
var htmlToPdf = new HtmlToPdfConverter();
htmlToPdf.CustomWkHtmlArgs = " --cookie name1 value1";
htmlToPdf.CustomWkHtmlArgs = " --cookie name2 value2";
htmlToPdf.GeneratePdfFromFile("url-of-page", null, "export.pdf");
I get the log in page. As if I've entered something wrong, but I get the cookies 1
to 1
from Postman.
Am I using a wrong format for the name and value?
I tried going through an httpClient
, and the cookies work there and I get to the page, but I cant get the pictures and css when I do it like that.