I have a design page in a .cshtml document that displays correctly in all major browsers (FireFox, Chrome, and IE). It utilizes basic CSS for styling and looks great in HTML format.
Now, I am attempting to convert one of its DIV elements to PDF. However, I am encountering challenges such as white spaces and page breaks. I have explored various options:
jsPDF: While it worked fine with regular content, it struggled greatly with HTML tables. Even after removing the large tables, it failed to properly render images and caused the tables to break incorrectly at page ends.
Windows Print: Another approach involved using the Windows print feature through JavaScript. Unfortunately, this method automatically included the site logo image on every page of the PDF, causing overlaps with the data lines.
nReco: I also experimented with nReco tools for converting HTML to PDF, only to find myself facing the same issues as mentioned above.
What could be the missing piece here? How can I potentially resolve these challenges?