Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

PDF creation with multiple pages

Explorer ,
Oct 30, 2020 Oct 30, 2020

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:

<cfset ProductDescriptionNumberOfLines = ceiling(Evaluate(len(Description)/33)) >
then pagebreak is based on that. 
 
Here's an old post seems to be asking for the same solution:
157
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
no replies

Have something to add?

Join the conversation
Resources