Copy link to clipboard
Copied
I need to generate an invoice pdf. This invoice can have 1 to hundreds of items and each item description is different. One item can take up 1 line and another could be 9 lines. So, using a mod value based on the number of items doesn't solve the pagebreak issue. If just say show 5 records per page, these 5 records can barely take up space on a page or can take up more than 1 page.
I'm using CF 2018.
I use cfdocument that generate a pdf from HTML/CSS formatted page. Right now counting characters item description gets me closer to what I need it's still doesn't work 100% of the time.
This is my code estimate the number of lines used by item description:
Have something to add?