APD Toronto
asked on
Automatically Reducing Font Size in TCPDF
Hi Experts
Using TCPDF's HTML feature, how can I make a td a specific length, in mm, then if the text for that td to automatically reduce the font size.
I seen this feature in fillable PDFs, but I need to apply it now in TCPDF.
Using TCPDF's HTML feature, how can I make a td a specific length, in mm, then if the text for that td to automatically reduce the font size.
I seen this feature in fillable PDFs, but I need to apply it now in TCPDF.
ASKER
Thanks Frank,
do you have any insight on the second part of my question
do you have any insight on the second part of my question
if the text for that td to automatically reduce the font size.
I seen this feature in fillable PDFs, but I need to apply it now in TCPDF.
Automatically reduce the font size? Why would you want to do this? If nothing is displayed, you want consistent td heights correct? I don't know what you want to accomplish by reducing the font size and when would the automatic adjust occurs *i.e, under what circumstances/criteria?
ASKER
The circumstance where I would want to reduce the font size if the comment is very very very long (related to my other question that you are helping me with).
This is essentially a manifest for drivers, and if the comment is very long I need to reduce the font size in order to keep the row size the same. In other words, the client does not want 1 row to be on a half a page, where the other rows can fit 26 rows per page.
This is essentially a manifest for drivers, and if the comment is very long I need to reduce the font size in order to keep the row size the same. In other words, the client does not want 1 row to be on a half a page, where the other rows can fit 26 rows per page.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
can you attach a css with tcpdf, or I need it inline?
ASKER
and can you explain how that reduce the font size?
Inline it, and it justifies the width of the td and sets the textsize to a percentage of its parent td. The inline block doesn't allow it to spill over or misshape the element
The best way to think when using TCPDF in terms of usability, is that you want to write it similar HTML to 4 and not 5 with CSS3. Think emails, specificity, and nothing fancy/best practice at all.