Do you want to keep them at the same page?
A4 size is 210x297 mm, width to height relation is 210/297 = 0.707. So, to keep proportions total height of these 3 images should be 650 / 0.707 = 919 px.
But actual sum of image heights is 107 + 650 + 58 = 1080 px. So you should reduce total images height in 919/1080 = 0.851.
And header.jpg height should be 107 * 0.851 = 91 px,
block1.jpg 915 * 0.851 = 779 px,
block2.jpg 58 * 0.851 = 49 px.
You should specify these heights in the tags of your embedded html. We attached an example EML file EML.zip (3.4 KB)
Please take a look at it’s html code.
Hello @atir.tahir
Thank you for your response
Can you please provide java code snippet to change the image height in converted pdf
(instead of specifying heights in embedded html).
Different input eml file can contain n number of images, we are expecting solution that should works with different eml to pdf conversion.
It would be really helpful if you could provide generic solution.
Actually there is no generic solution for this scenario. Since, HTML files are not paged but PDF files are.
So, the converter has to split HTML content to pages. If a content element (for example image) doesn’t fit in current page, it will be moved to the next page.
You can try to print this html attachment for example from Chrome browser to PDF file. Set top and bottom margin 15 mm and check the result.
Hello @atir.tahir
We have tried to convert the provided eml ( Ex-2(header_and_footer)_new.eml ) file to pdf but it seems like still we are not getting desired output.
please find the files here
( https://drive.google.com/drive/folders/1FhGNCylE73EMKRD5hSII6ZY3DsZ0gngO )
For Ex-2(header_and_footer)_new.eml, you want “ICICI bank” image and “The orange book” cover/image on one/same page - like this screenshot.png (49.4 KB)? But Ex-2(header_and_footer)_new.pdf shows them on two different pages.
Hello @atir.tahir
thank you for your cooperation
We are expecting the converted pdf should be as similar as that of the input eml file.
If input eml file contains images/header or footer then those elements should be placed on same place in converted output pdf.
For example if images are placed one above other on the single same page then output pdf should follows this on same page and if images are placed sequentially in single row of single same page of eml file then converted pdf files should have those images in same manner.
In short we are expecting images or other contents of eml file should not get misplaced in converted output pdf.
Is there any update regarding how we can adjust the height in eml file so that after converting them into pdf we will be able to generate pdf as that of the eml file (images will get placed in pdf as they were in input eml file) programmatically using java.
Sorry for the inconvenience. Please be aware that this issue is rather complex, which is why it is taking time. We’ll share ETA of resolution as soon as we have it.
Hello @atir.tahir
We are facing same type of issue while converting MSG file to PDF. In the generated output PDF, formatting is all messed up (data is getting shifted to next page).
Could you please suggest how we can generate output PDF as same as the input MSG file?
Thank you.
We apologize for the inconvenience you’re experiencing, and we are actively working to resolve it. In addition, would you mind sharing this problematic MSG & the resultant PDF with us? Your assistance in providing it would greatly aid our investigation. Thank you for your cooperation.