アプリケーションのページを PDF として保存しようとしています。ページには現在ログインしているメンバーに関するデータがありますが、ページの URL を wkhtmltopdf に渡すと、新しいプロセスがログインしていないため、そのデータを表示できません。
wkhtmltopdf を特定のメンバーとしてログインさせることはできますか? ユーザー名とパスワードのパラメーターを使用してみましたが、これらは基本的な http 認証用であり、効果がないようです。
https://github.com/codaxy/wkhtmltopdfを使用して wkhtmltopdf をラップしています。私の使用法:
string filename = "file.pdf";
MemoryStream memory = new MemoryStream();
PdfDocument document = new PdfDocument() { Url = Request.Url.AbsoluteUri };
PdfOutput pdfoutput = new PdfOutput() { OutputStream = Response.OutputStream };
PdfConvert.ConvertHtmlToPdf(document, pdfoutput);
Response.ContentType = "Application/pdf";
Response.AppendHeader("content-disposition", "attachment; filename=" + filename);
Response.End();