How do a make a pdf report with dynamic Body section

I am working on generating a PDF report that includes a header, body, and footer sections using Scriptcase 9.11.0011. The body section should dynamically adjust its height based on the number of lines. The input data is coming from a master-detail form.

However, I am encountering a problem where the body section is static and does not grow to accommodate additional lines. The printer I am using is an 80mm receipt printer with a print area of 72 x 140 mm.

PDF Report Configuration:

  • Header: 66 units
  • Footer: 30 units
  • Body: Should grow by 5 units per line (which I believe is appropriate)

Currently, the body section can only display up to 5 detail records. If there are more than 5 lines, the additional lines overflow into the footer section, but the body does not adjust in size.

My expectation:

  • The body should expand dynamically based on the number of lines, with 5 units allocated per line.
  • The footer should remain at a fixed height of 30 units.
  • I would like to avoid any overflow into the footer.

Can anyone suggest how to resolve this issue? A sample or video tutorial would be extremely helpful.

Thank you in advance! :wink:

Hi @lassekbplus

Start using TCPDF.

For that kind of printer I use Mike42 library.

Regards

1 Like

Ok, and thank you @gbillot3.
I saw Jamies video on TCPDF, but he did not go into the multiline solution. I had hoped I could use Scriptcases own tools for making a multiline report.
I will dive into TCPD and learn something new.
Kind Regards

You need 1 lookup for the master data and 1 for the details.

Multicell
https://tcpdf.org/examples/example_005/

BR

1 Like

mike42_example.txt (6.3 KB)

Hi @lassekbplus

This is a method example to print with mike42 library in SC.

BR

how to use this library?

best regards

https://youtu.be/SXF-3rV0W9E?si=qB9SPlMlGuat5VGn

https://github.com/mike42/escpos-php