M2Doc, Problems with pictures in description fields

I am facing an annoying problem
Users copy-paste a picture into the Descriptions fields of a item (for ex: Logical function)

When exporting this using template/M2Doc and fromHTMLBodyString() it does not work so nice, I got lot’s of pages in error with word complaining of wrong ASCII Code …

Usually Word die or is getting more and more slow & busy
Is there a way to recognize this copy paste and generate a cut & light image instead ?

I tried to go use a workaround so I saved the picture as a JPG, create a folder in template folder put the JPG inside and insert the JPG using the add image button

Image is displayed in the description display but when I try the export I have an error message


As I am a little bit stubborn I found a “solution” I did what it asked and created a template\template\picture…JPG
(but keeping in my description fields the “right” path : template\picture…JPG

and the export works …


Is there a more simple solution ? :slightly_smiling_face:

You can add the URI to use as the root in fromHTMLBodyString():
You can also provide a relative uri ‘…/asserts/’. The relative URI is better for portability (it you move you template for instance).
But it would be nice to support this kind of embedded images. I opened a ticket:

1 Like

I’ve checked the implementation available in the nightly build. Works great! Thanks.

Thank you for your feedback. The release of M2Doc 3.1.1 with this fix should be today or tomorrow.