Currently, I am working on an Angular project in Linux and have had great success with the jsPDF library. The PDF export generated on Linux is exactly what I hoped for: Linux Export - good
However, when I ran the same code on Windows and Mac machines, the exported PDF file turned out to be about 200% larger than expected as shown here: Windows/Mac Export - bad
I spent a considerable amount of time adjusting scaling, implementing a scaled ratio, managing to get the first page to display correctly. Unfortunately, subsequent pages got clipped starting from the halfway point of the previous page. Additionally, the fix that worked on one machine looked terrible when viewed back on the Linux system.
Do you have any insights on why there may be differences in rendering between the various operating systems? Has anyone else faced this issue before? Could it be a known bug with the library or did I miss something while reading its documentation?
Below is a snippet of the code responsible for exporting the PDF in my genreateReport.ts
file:
[Code snippet from genreateReport.ts]
Here's how the generateReport.html
file looks:
[HTML structure from generateReport.html]
If you're feeling adventurous, here's some CSS you can play around with:
[CSS styles for the design elements]