Announcement

Collapse
No announcement yet.

WYSIWYG images PDF-exported too small

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • WYSIWYG images PDF-exported too small

    The images put into wysiwyg fields are printed too small in PDF exports.

    In the backend form, the image is reasonable in size (first picture) but on the pdf page it is printed very small. I've tried both, PNG and JPG.
    Is there maybe a css class that can be used and wrapped around the field in the html template? Like
    HTML Code:
    <div class="img-fluid">{{{wysiwyg}}}</div>
    Thanks in advance.
    Cheers

  • #2
    Not sure why yours is so tiny when PDF... for me it work fine. It is however too wide for me though, as it expand to width for some image.

    I just tested with my Knowledge Database export, I checked out the code and mine one look like this for the WYSIWYG:

    <img style="width: 450px;" src="?entryPoint=attachment&amp;id=19231293010>

    My PDF template is simple, no fuss:

    {{{body}}}

    Can you try a various different image? And also test it knowledge database as it is a default entity that you can use.

    Comment


    • #3
      Thanks for the info. I'll try more images and see how I can maybe influence their rendering size.
      Is it possible to see the generated HTML document right before the conversion into PDF?

      And side question - is it possible to use html template files instead of copy-pasting the html code into the template editor? Would be much more handy.

      Edit:
      I've played around with the image placement. As soon as I hit one of the (re-)size buttons in the interface (see picture below) the images become small. I assume that these set the "width" attribute of the image which does not accept % as unit and is therefore interpreted as pixels.
      Click image for larger version  Name:	Untitled.png Views:	0 Size:	8.8 KB ID:	78209






      HTML Code:
      <img src="foobar.jpg" width="100%" />
      will therefore be printed 100px wide. What could work, given the parent container has a reasonable width and a static or absolute display property, is:
      HTML Code:
      <img src="foobar.jpg" style="width: 100%;" />
      To better understand this behavior it would be great to get a peek at the html document before pdf conversion.

      Thanks and Cheers
      Last edited by hybit; 01-13-2022, 02:35 PM.

      Comment


      • espcrm
        espcrm commented
        Editing a comment
        You probably have to report the bug for the 100% width = 100px.

        As for PDF Conversion I doubt it at this stage and it being left for dead for sometime now; also considering the PDF library is a 3rd party library (new major milestone version for the library is still in-progress but stale in development last I check).

        An alternative you can use the telecastg extension which will print PDF using your web-browser engine... similar to a preview I guess. If you stay v6 EspoCRM you can use the free version, but if you are on v7 then you would need to pay for it as his business model has changed.
    Working...
    X