i'm trying to get a dynamic page footer on every page, though finding it extremely difficult has anyone found a clean way todo this?
getting a page footer in a pdf?
Collapse
X
-
Comment
-
Comment
-
Dompdf is a great library. It's not a simple task to render PDFs. The fact that it renders HTML pretty good while being open sourced and not requirng any 3rd party software, we should show gratitude to the developers.If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.👍 1Comment
-
i did it with a <3, so yeah, I appreciate development time,
Though it's proving to be an absolute nightmare to get a dynamic footer and page numbers, prhaps its just your implementation of it that makes it so hard to work with. i had to edit the vendor options to turn on certain functions to almost get the page numbers working, as it wouldn't do it via the normal CSS route
would be great to have an libarary that supports css 3 and html 5 nativaly
Comment
-
This is for those who read this in the future. There's nothing difficult, no problems with conditional logic in the footer. Everything works. Page numbers does work. The total number of pages is not supported.
https://forum.espocrm.com/forum/deve...097#post124097
Overly emotional language with 'absolute nightmare' etc, is what I always ask to abstain to use, especially on the forum where one expects others to help. It's toxic. I will be removing posts with such language in the future.👍 1
-
-
i am using this inside a template helper, and it puts page numbering on all pages above 2 but not on the first one
<script type="text/php">
if (isset($pdf)) {
$font = $fontMetrics->get_font("Open Sans", "normal");
$x = 560;
$y = 825;
$text = "{PAGE_NUM} / {PAGE_COUNT}";
$pdf->page_text($x, $y, $text, $font, 6, [0,0,0]);
}
</script>Comment
-
I looked into it years ago. I remember the limitation with total page numbers, it was not implemented back then, I think it's still valid. It's quite a small downside. What is dynamic footer, I think neither me nor others are fully sure there understood.If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.Comment
-
Page numbers are kind of important for larger documents, as once you print them out, you don't know the order or if you have all of them
i mean that it changes based on variables, so we have 2 different companies we send out invoices from and i need to change the footer to reflect the company, that i am doing just fine via a template helper, though i can't get it on every page, but that isn't as important as the page numbering
i tried doing page numbering via espo footer and it wasn't able to display the total number of pages and i couldn't use variables in it eitherComment
-
> i couldn't use variables in it either
What are variables. Placeholders? They work fine for me. Placeholders are printed in the footer on the second page.
If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.Comment
-
Here is the discussion about it: https://github.com/dompdf/dompdf/iss...ment-740015376
Not sure if the workaround still works or how to use it.
There are not many free PHP PDF libaries around.TCPDF is in maintance mode and has only a few new commits. There is a successor available called tc-lib-pdf.
But it has only a stable release recently. It's still work in progress and I don't know if its on par with tcpdf yet and what are the advantages or disadvantages of the new version.👍 1Comment

Comment