-
-
Notifications
You must be signed in to change notification settings - Fork 21
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
correctly render HTML Tags inside ListViewHelper items #251
Comments
I tried to put the
When I put HTML Tags inside the HtmlViewHelper then those are repected and rendered correctly into the PDF. It seems that this option, to render HTML tags correctly, needs to be added directly to the ListViewHelper? |
Hi @medarob, The ListViewHelper currently only renders text, but no HTML. If you want to render an HTML list, then you can use the HtmlViewHelper, but just a little differently: <pdf:html>
<ul>
<li>Hello</li>
<li><strong>Hello strong</strong></li>
</ul>
<ul>
<f:for each="{fruit1: 'apple', fruit2: 'pear', fruit3: 'banana', fruit4: 'cherry'}" as="fruit" key="label">
<li>{label}: {fruit}</li>
</f:for>
</ul>
</pdf:html> I hope this helps solving your issue. |
I used the HtmlViewHelper before and found that it has limited support to style the list. But here I couldn't
(Maybe I did something wrong and it's possible after all?) So I converted the |
I am not sure what default styles TCPDF applies, but it is possible to change certain styles by applying CSS properties like i {
font-style: italic;
}
ul {
list-style-type: square;
}
ul.with-image {
// see https://tcpdf.org/files/examples/example_006.phps
list-style-type: img|png|4|4|images/logo_example.png;
} The CSS you can provide inside a |
for HTML list only the following works, every other value will fallback to decimal
I can change Even |
Could it be that you are using a special font that does not support italic or bold? |
We use the font Roboto.
We don't have problems on the website with italic or bold. |
I think you needed to add the font styles explicitely like this (notice the i and b):
The filename is important here, so you would have to copy and rename the files. |
I use the Listviewhelper to generate a list of elements. The array is created automatically based on the input of an RTE field.
Here the editor can create a
<ul>
-list with different items and can also style the text, e. g. make it bold, italic.When I output the List the HTML is not being rendered correctly.
Here is my testcase:
Ist it possible to render the HTML from the list elements, so that the items will be bold, italic, etc.?
The text was updated successfully, but these errors were encountered: