After having consistency issues when rendering a PDF from an async task, I wanted to try manually triggering the conversion as shown
here. However, I'm encountering the same null reference error mentioned in
this post, even though I'm accessing MVCToPDF within the controller action as seen in a reply to
this post.
I'm using v20.2.90. Here's code I'm using to test this functionality with:
Code: C#
[CombinedColumnPrintLayout]
[RenderAsPDF(ResultAsDownload = true, AutoFormsAuthentication = true, AutoConvert = false)]
[OutputCache(NoStore = true, Duration = 0, VaryByParam = "None", Location = OutputCacheLocation.Client)]
public async Task<ActionResult> TestDownload(long id)
{
HtmlToPdf.Options.OutputArea = new RectangleF(.0f, .2f, 8.5f, 10.6f);
HtmlToPdf.Options.FooterHtmlFormat = "";
var summary = await _mediator.Send(new SampleGet.Query(id));
MVCToPDF.RenderAsPDF();
return View();
}
Any ideas why MVCToPDF would be null here?