I am rendering an HTML View in ASP.Net MVC to PDF using Rotativa ViewAsPdf
method. I am setting the ouput to be of A4 Size, Portrait and no margins, by setting:
new ViewAsPdf(MVCCfpFormatter.Members.Views.FlightPlansFullPagePrint, model)
{
// FileName = flightPlan.ListingItemDetailsModel.FlightDetails + ".pdf",
PageSize = Size.A4,
PageOrientation = Orientation.Portrait,
PageMargins = new Margins(0, 0, 0, 0),
PageWidth = 210,
PageHeight = 297
};
Then within the CSS, I am setting an element to have 210mm
width, which should spread the entire width of the page, yet in the output PDF, the 210mm
width is not representing the entire width of the PDF but less. By trial and error, the total width of the generated PDF seems to be around 246mm
.
Any ideas why this could be happening?