I have a problem with word templates that include rich text and html tags.
we write our templates out quickly with unformatted salesforce merge fields and check they come through ok, we then add formatters such as date, currency and :html.
the unformated RT merge fields come out in the correct font (normal style) but when we add }:html} it always goes to Times New Roman 12.
The text comes from a clean RT field with only bold tags, we have checked the formatting in the word document.
We have also found that adding .... tags in a plain text field and then applying the :html formatter also results in Time New Roman 12pt
I am at my wits end as my client is refusing to pay for 50 templates we have created because it doesn't follow they corporate style.
I think i ought to make to make it clear that if we are to add font details to the HTML then the template reacts correctly. However, we want the document to be driven by the template and not by the HTML. Salesforce doesn't allow us to particular when we entered. We wanted it to be neutral and take it lead from the template.
I discussed the case with our developers. We have a task "To inherit document font in HTML formatter" in our roadmap, but it has a low priority for now. Could you confirm if you're trying to achieve the following: the inserted html to inherit the font of the place it is being inserted into in the DOCX?
We'll probably prioritize and complete the task sooner to improve the formatter.
I know that is a 'MUST' for my client and also from their supplier Arcus global who i understand is a re-seller of Plumsail. Thank you i will report back to Arcus and the Client and hope the update can be expedited
The inserted HTML has font properties from the default style (“Normal” in Word by default). If you don’t want this to happen and want HTML to dictate the styles, use the formatter with the false parameter:
:html(false)
Currently, the fomatter takes font-family, font size, color, alignment, boldness/italic/underline from the default style. If you need some other properties from the “Normal” style, please let us know and we will see what we can do.
Hello @Petr
I wanted to share that we are having an issue with the :html in reports that we created and have been using since 2022. Would this be the same issue? The bolds and italics are not working and the font changes in the output.
Attached is a sample JSON and reports where you can see the bolding isn't working.
Is this the same issue PhillSkill is facing and will the fix resolve this as well? Thank you. html test.txt (167 Bytes) html test.docx (13.0 KB)
By default the HTML formatter takes the formatting from Word. So, if you add this token {{1.display}:html} and then apply a JSON with some HTML formatting, the formatting will be changed to the Word default settings.
To change the behavior add the HTML token with the false option, like this:
{{1.display}:html(false)}
In that case, the HTML formatting will be taken from the JSON.
The result:
Please give it a try and let us know if some issues persist.
Hi this looks great, but it does not work for me.
I have fields in Word
{{ActivityDetail}:html(false)}
{{Dependancies}:html(false)}
The formatting in Word is using Aptos Font but the output is Verdana which is being pulled from the SharePoint html formatting. I was really hoping this solution would work and resolve consistancy issues
We updated the parameters and now it's the following:
html or html(MixStyle) - the document’s default style is applied, and inline HTML styles override the default style partially or fully, depending on the style properties specified. Text alignment, font, size, and color are taken from the HTML style if they are specified there.
html(DocumentStyle) - the document’s default style is applied, and all inline HTML styles are ignored.