I read both, you mentioned Elementor and a div in the first post, so I hypothesized that the image cropping as per your addition in the second post) had been cropped by elementor, keeping the internal reference the same thus resulting in a different image in the PDF. That could be an explanation for why the image looked different in the PDF.
In your second post you only mentioned cropping to a square and a div. The default output of this plugin is not in a div. Again an assumption from my end, but I thought that perhaps you were confusing the logo on your site with the logo in the PDF. Is this perhaps a custom template where you added this div?
Regardless, it does sound like Elementor is doing something to the output of the logo (cropping), so I think my suggestion to upload a separate logo to use for the PDF would prevent this issue. Note that for the PDF file, the plugin reads a file directly from your server whereas the HTML preview reads the file from your site (with a URL). Usually this is identical, but if the theme or a plugin is modifying the output or content of one of them, this can create a discrepancy.
Let us know if uploading a separate logo resolves the issue!