Answer the question
In order to leave comments, you need to log in
Layout html template for export to pdf?
I am compiling a document template for subsequent export to PDF
an example of a document:
in the fields marked 1,2,3, text will be substituted, the length of the text can be different, that is, there may be a different number of lines of text, but no more than what is marked in the document, that is No. 1 has 2 lines, No. 2 has 5 lines, etc. If there is not enough text, empty underlined lines should be displayed.
first tried to use underscore and so on. the ends of the lines turned out to be of different lengths depending on the line breaks, after that I made a background in the block where the lines are located in the form of a repeating picture imitating underlining.
that is, in html this thing was defeated, but problems appeared when saving to pdf. I use the mPDF library, the lines are displayed normally in it, but it does not support the css position:absolute property (more precisely, it does, if the parent of the element is body) Supported css properties , and without position:absolute it is impossible to make labels for lines.
so it turns out that again nothing happens) I'm suffering all day, help with advice on how to display lines without a background image and all sorts of bicycles.
Answer the question
In order to leave comments, you need to log in
Tables to implement "underlining" and a monospace font (fixed width) for inline text.
Due to the fixed text size, it will be possible to calculate the maximum number of characters per line without any problems and break it into lines.
Judging by the form, it's easier for you to do this on js using jspdf and not torment the server)
https://parall.ax/products/jspdf
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question