I am trying to figure out how to create the "Comb of Characters" effect, which exists in PDF, but does it in PHP for the standard text input field HTML = "text". Here, the text is distributed through the text field based on the maximum length of the text field and the width of the text field.
PDF definition:
Character Crest Distributes user-entered text evenly across the width of the text field.
Suppose I had 4 digits (the number of digits can be dynamic, so 2, 4, 8, 9, 10, 11, etc.). I wanted to propagate the following input field
<input type="text" style="width: 150px; height: 30px;" />
How can I do it? I am sure that mathematics is behind this, but I have no idea what mathematics is. Hoping that someone should have done this before. Please, no external libraries and nothing.
EDIT
While the RamRaider version works using javascript / CSS, I was hoping to get this in PHP.
The goal is for it to work as
<input type="text" style="width: 150px; height: 30px;" value="<? echo $answer; ?>"/>
So an example output would look like
<input type="text" style="width: 150px; height: 30px;" value="1 2 3 4"/>
I know that I will have to manually add spaces between each character, in which the math is very confusing.
source share