Hi all, Can anybody help me in resolving this iss...
# cfml-general
s
Hi all, Can anybody help me in resolving this issue. I am generating PDF using cfdocument tag of ColdFusion. I am rendering data in a table ( dynamic one ). If rows in the table exceed the current page , and continue on the next page , I want the table headers to be repeated on each of the page. I've tried this css
table { -fs-table-paginate: paginate !important; }
but no luck.
a
which version of ColdFusion / Lucee / Railo?
The css support in cfdocument was only really improved in recent versions. You may be able to do it using
<thead>
in your table.
s
I am using CF2021. for thead tag also, I ve tried some kinda css
thead {
display: table-header-group;
}
a
Just checked and ACF2023 was when they updated it to support CSS3
s
Oh, ok. But our server is on 2021. Is there any other way we can achieve that one? and its in cfdocument
a
If thead / tbody / tfoot isn't working then I don't think it's possible using cfdocument I'm afraid. Others may have got it to work though.
s
ok thanks for your response @aliaspooryorik
table { -fs-table-paginate: paginate !important; } Its working in Lucee, but not in CF
a
Lucee uses a completely different engine for generating PDFs (I think it's FlyingSaucer) https://github.com/flyingsaucerproject/flyingsaucer
s
Yes its using FS.
a
If you don't have to use cfdocument then there are several ways to generate PDFs. cfdocument is limited though (much better in ACF2023 though)
✅ 1
s
Yeah. but I'm just wondering why CF document generated pdf can't do most of the css styling. I've almost worked with many projects with pdf like this and its oh frustrating to do the css thing to matchit with exact design client wants.
a
It's because it used an old version of IText. Whilst it's nice to have a lot of stuff "out of the box" with ColdFusion - you are locked into whatever version of a library your version of ColdFusion has.
s
Appreciate the insight. I m gonna investigate more on this. Thank you @aliaspooryorik
a
We've had success with Playwright - although it can't handle documents with lots of pages.
s
Oh, great. Let me dig that too.
a
s
Thanks for sharing