-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WriteHTML issue when using it on Footer function #626
Comments
I think it's best to ask on websites like StackOverflow, here is not a support forum :) |
Are you sure the code is not wrong with that? Because I can confirm that it is. WriteHTML can't be used in footer, and is not documented anywhere, then it can be used. The issues goes here not in stackoverflow. Search in writeHTML function, and look for the breakpage that affects to use it on footer. |
Well, sorry for my misdiagnosis then I am not affiliated with tcpdf, but prefer to reply on new issues because you most probably will have no other reply I hope my reply helps you understand |
My alternative option was don't put this information in the footer, because the problem is on WriteHTML and the automatic page break. I change this little table to outside the footer zone and all works without problems on the body zone. It's the expected solution? No, but at least, it's working. Seems that by design, header and footer are not expected to use WriteHTML. This way is used in all the samples provided. My footer and header were changing it's height based on user configuration. Both parts seems that are working good (maybe requires some improvements, but it is reasonable). I add a function to check if I'm in first or last page. The users can enable 2 sub-section on the header, and 2 sub-section in the footer based on:
WriteHTML is always trying to verify that the table is inside the body, not in the header and not in the footer, but table it's in the footer. Why I want this table on the footer? Because its the total of an invoice, an seems the best place for all common templates. Now I'm positioning the Y to the similar expected coordinate before the table. But this is a workaround for a limitation in TCPDF. For this reason I don't want to go to StackOverflow. I know how to avoid this problem, but still it's a problem. I have not found any other easy way to get around this problem, other than restating the solution in another way that involves not using the footer. For me the solution applied is working, but I still think that this is needed to have more control on what you want to use. |
see this: tecnickcom/tcexam#425 (comment) |
When you have a body of a document long enough to occupy several pages, if you want the Footer function to be dynamic in height showing one content or another (for example, the totals of an invoice), if the last page requires a line break it does, but when writing the footer with the totals in a HTML table, the portion that page break returns to the previous one.
If you use a Cell instead of WriteHTML to representen a cell with the same block size, this problem doesn't happens.
I try to found more exactly what is happening, and seems to be a problem related on how WriteHTML works, and seems to not be in mind to be used on Footer.
Maybe and additional function to be used on Footer, or maybe a WriteHTML with an extra param to avoid page break may work.
I get this working, but only using Cell function with a specific text blocks on footer, and replacing the totals of the invoice to the final page. But I want to have it with a user option to be used on any page or only last page and I can't do that.
The text was updated successfully, but these errors were encountered: