Image sizes in document template are ignored.

0
Hi, In a customer project, we use Document Templates to generate PDF output. Text is entered using the CKEditor plugin and used as input for the corresponding placeholders in de template. When inserting an image (as a link) and setting the width/height, these properties are completely ignored during document generation; the image is included in the pdf using its original size. In the CKEditor, the image is displayed correctly with the proper dimensions. If I add a border to the image, the border is displayed with the provided sizes in both the editor and the generated document.   Any pointers as of why this is happening (and how to fix it)   Thanks!
asked
1 answers
2

As it turned out, the CKEditor sets the image size in the ‘style’ attribute and not as separate width and height attributes. This is ignored when the document is generated with a result that the image is displayed in the original format and not the request size.

 

Mendix released a new version 2.4.4 of CKEditor where you have the option to use the width/height attributes or the style attribute for images. This fixed the issue.

 

Note that only the smallest value of a provided image size is honoured.

When you set the image size to 100 x 600, it will generate a document with the image size of 100 x (the height per the correct aspect ratio).

CKEditor will show the ‘stretched’ version in the editor but this is not how the template generator will produce the output.

answered