Thank you for your feedback on the issue.
Firstly, to clarify, the provided testfile1.doc and testfile2.docx do have empty headers where the logos should be inserted. If you save the logos in the C:\Test folder and execute the code on the test documents, you'll be able to replicate the issue I mentioned.
I appreciate your point on setting the height and width explicitly, and I've tried this approach. However, the issue persists specifically with .doc files and .docx files in compatibility mode. Locking the aspect ratio was one of the methods I attempted to maintain the proportions, but it didn't rectify the problem.
Regarding the image formats, I understand the merits of SVGs and PNGs over JPEGs for scaling. But the main concern here isn't about the quality of the scaled image; rather, it's about the proportions of the logos being distorted exclusively in the .doc files and .docx files running in compatibility mode.
If you could help address this specific problem or point me towards any workarounds, it would be greatly appreciated.
|