I am using Rotativa ViewAsPdf to turn a .cshtml page into PDF.
When I run the code as debug, the PDF turns out the way I want. The page has tables and an image on the top.
Whenever I publish the application and try to generate the PDF as a different entry, the tables lines that separate columns from rows aren't there, and everything is mashed together, and the image will not display.
This is the POST details in question.
public async Task<IActionResult> PrintDetails(int? id)
{
if (id == null)
{
return NotFound();
}
var wC_Inbox = await _context.WC_Inbox
.FirstOrDefaultAsync(m => m.ID == id);
var report = new ViewAsPdf("Details", wC_Inbox)
{
FileName = "InitialInbox.pdf"
};
return report;
}
Here are the differences between the two PDFs that get generated. The one on the left is what is generated when running on debug, and the one on the right is the messed up one that gets generated on the production.