Improper Alignment due to default package setting

Proper alignment package settings

In a report generation software, with the option available “Export as PDF” the reports are exported in PDF formats that can be downloaded. Not quite, whenever the reports were exported to PDF formats, the PDF files lacked readability as there was an improper alignment issue.

When we looked into the improper alignment, we found the issues were due to the default settings of the PDFMake package content. The application collects contents from data centers and generates the PDF report.

We use an API call to invoke the data centres that responds with a . JSON format(encrypted) with a 64 — bit base. Only after the code’s been decoded, it employs the PDFMake Package 0.1.54 to generate the PDF report.

Still, we did not get an expected outcome. Moreover, the report could not be manually aligned. By default, the contents in the report were left aligned. While re checking it was found that the package did not employ the properties “preserveLeadingSpaces and preserveTrailingSpaces”.

Proper alignment package settings

After restarting the execution, the contents still lacked alignment. We identified this was because of the default font style “ROBOTO” that comes with the PDFMake Package. To overcome this, download and include the “LUCIDA CONSOLE” font style. Now we got a perfectly aligned readable PDF report.

Centizen

A Leading IT Staffing, Custom Software and SaaS Product Development company founded in 2003. We offer a wide range of scalable, innovative IT Staffing and Software Development Solutions.

Contact Us

USA: +1 (971) 420-1700
Canada: +1 (971) 420-1700
India: +91 63807-80156
Email: contact@centizen.com

Centizen

A Leading IT Staffing, Custom Software and SaaS Product Development company founded in 2003. We offer a wide range of scalable, innovative IT Staffing and Software Development Solutions.

Twitter-logo
Linkedin
Facebook
Youtube
Instagram

Contact Us

USA: +1 (971) 420-1700
Canada: +1 (971) 420-1700
India: +91 63807-80156
Email: contact@centizen.com