edisonneza/jspdf-invoice-template

Printable safe area paddings - Magic numbers manual page break wrap around for invoice description footer aesthetic?

slimlime opened this issue · 3 comments

if (param.orientationLandscape && currentHeight + invDescSize > 183) {

if (!param.orientationLandscape && currentHeight + invDescSize > 270) {

Would we be correct in assuming that these magic numbers for 183mm and 270mm are directly proportional to the A4 dimensions for sizing?

both are 27mm below A4 paper dimensions 210mm 270mm

My first impression is that the y-coord (currentHeight) potentially near the end of page should wrap to the next page.

Appears to be a hard-coded 27mm condition which may equate to about three lines of text?

Printable "safe area" aesthetic adjustments?

--

There are other number constants used to adjust as well throughout the code, I thought I would suggest this as one of the more accessible places to refactor

and whether the code duplication aligns here

if (param.orientationLandscape && currentHeight + invDescSize > 173) {

if (!param.orientationLandscape && currentHeight + invDescSize > 270) {

Yeah, there is always a place for refactoring, and for sure I'll do it ASAP :)

Added in my TODO list. Reopen it if anything else.