EML to PDF conversion issue in Java

@Pratiksha_Thakurdas

For example, you have 3 images:

  1. header.jpg 650x107 px
  2. block1.jpg 650x915 px
  3. block2.jpg 650x58px

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.

Thank you.

1 Like

@Pratiksha_Thakurdas

We are further investigating this scenario.

@Pratiksha_Thakurdas

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 )

could you please help us with this.

Thank you.

@Pratiksha_Thakurdas

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.

Thank you.

1 Like

@Pratiksha_Thakurdas

We are further invesitgating it. You’ll be notified in case of any update.

@atir.tahir
Please let us know if there is any update on this issue

@Pratiksha_Thakurdas

Your ticket is still under investigation.

Hello @atir.tahir

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.

Kindly please let us know.
Thank you.

@Pratiksha_Thakurdas

Since, your ticket is still under investigation. We’ll take a look at this scenario as well.

Hello @atir.tahir

Is there any update on this issue please let us know

Thank you.

@Pratiksha_Thakurdas

We’ll notify you as soon as we have any update on the ticket.

Hello @atir.tahir
is there any update on this EML to PDF conversion issue and if not yet then could you please suggest ETA of resolution.

Thanks.

@Pratiksha_Thakurdas

This ticket is still under investigation. We’ll soon share a workaround or ETA of resolution.

Hello @atir.tahir
kindly please let us know any updates on this?

@Pratiksha_Thakurdas

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.

1 Like

@Pratiksha_Thakurdas

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.