EML to PDF conversion issue in Java

@Vaibhavj22 I actually work on it. I think I will fix it this week.

Hi @vsevolod.orefin @atir.tahir

We tried to use the latest version (24.11) for file conversion from document to PDF. However, we’re facing issues with certain file types like .eml, .msg, and .odp. The images are not being exported correctly in the output PDF (broken images showing or blank space showing instead of images in output PDF), and with .msg to PDF conversion, the images are not displaying properly. Additionally, the output PDF does not match the formatting of the original .msg file. We’re aiming to set up our code with the latest version, but the conversion process is not working as expected. Furthermore, some file types are showing slower conversion speeds. Could you please advise if there’s anything else we should try to resolve these issues? Please update as soon as possible.

Thanks!

@Vaibhavj22 I actually work on this issue and update you as soon as possible.

@vsevolod.orefin
Is there any update on this issue? (eml, msg to pdf conversion issue.)

Thanks!

Hi @Vaibhavj22 , did you try 25.1?

Hi @vsevolod.orefin
We have tested version 25.1 with our application, and even with that, the issue of misplaced images and formatting problems during EML and MSG to PDF conversion persists.

Thanks

I’m checking and will update you today.

The fix will be included into GroupDocs Conversion for Java 25.2

Hi @vsevolod.orefin
We’re glad to see that the issue with EML and MSG to PDF conversion, as previously reported, has been resolved in version 25.2. Thank you for your continued support.
However, there’s still a minor issue with the output PDF. Specifically, while the right and top margins appear in the output PDF, the left and bottom margins are not applied as expected, and the content seems to be cut off on the left and bottom sides of the page.
Our expected result is for the output PDF to have equal margins applied on all sides (top, bottom, left, and right) with the same point values.
We’ve tried all available options, including PdfConvertOptions, PdfOptions, PdfFormattingOptions, PdfPageLayout, and PdfPageMode, but have not been able to achieve the desired result.
Could you please provide guidance or suggest a solution to address this margin issue?

Thank You!
Vaibhav

Hi @Vaibhavj22 , let me take a look and update you.

Hi @vsevolod.orefin
Upon review, we observed that the margin issue arises specifically when custom page height and width are applied during PDF conversion. This behaviour appears consistently after setting these dimensions. Could you kindly review this scenario to determine the cause or suggest a workaround?

Thank You!
Vaibhav

Thanks for the clarification, @Vaibhavj22
Let me update my example and test it

@Vaibhavj22 I reproduced the issue and investigate it.

Hi @vsevolod.orefin
We’re encountering a new issue with GroupDocs conversion. When converting an EML file to PDF, we receive the following font-related error:
Caused by: com.groupdocs.conversion.internal.c.a.pd.exceptions.FontEmbeddingException: Font embedding is prohibited because of font license restrictions (AvenirNextLTPro-Bold)

We have already tried the font-related configuration options provided in the documentation, but the error still persists.

Additionally, we are seeing the following error when using GroupDocs Viewer:

com.groupdocs.viewer.exception.GroupDocsViewerException:
com.groupdocs.viewer.internal.c.a.w.cR: The document appears to be corrupted and cannot be loaded.

These issues are occurring with the latest versions of the library, whereas everything works as expected with version 23.11.1.

Could you please advise on how to resolve these errors in the latest versions?

Thank You!
Vaibhav Jadhav

Hello @Vaibhavj22,

In order to assist you with resolving these issues, could you please share the sample code you’re using for both GroupDocs.Conversion and GroupDocs.Viewer, as well as the file that causes the problem? This would significantly speed up our investigation, as the cause of these errors is not immediately clear. We’ll be waiting for your response.

Here is a Redmine ticket for this issue: Saltov Redmine (related to margin issue)

Hi @vsevolod.orefin
We are currently encountering an issue with GroupDocs Viewer (version 24.3) when attempting to retrieve dimensions from an EML file. Upon execution, we receive the following error message:

com.groupdocs.viewer.internal.c.a.w.cR: The document appears to be corrupted and cannot be loaded.

We are using the following code snippet to extract the dimensions:

try (Viewer viewer = new Viewer(inputFilePath)) {
ViewInfoOptions viewInfoOptions = ViewInfoOptions.forPdfView();
ViewInfo viewInfo = viewer.getViewInfo(viewInfoOptions);

  			convetOptions.setPageWidth(viewInfo.getPages().get(0).getWidth());
  			if (FilenameUtils.getExtension(inputFilePath).equals("eml")) {
  				convetOptions.setPageHeight((int) (viewInfo.getPages().get(0).getHeight() * (viewInfo.getPages().size() * 0.6)));
  			} else {
  				convetOptions.setPageHeight(viewInfo.getPages().get(0).getHeight() * viewInfo.getPages().size());
  			}
  		}

The EML file can be accessed here: :link: EML File – Google Drive

Could you please advise if we are missing anything or suggest a solution to resolve this error?

Thank You!
Vaibhav

Hello @Vaibhavj22 ,

We apologize for the inconvenience caused.
Could you please confirm the exact version of GroupDocs.Viewer for Java you are using? Version 24.3 is not part of the official release history.
Here is the full list of currently available versions: releases.
It’s possible that you are using GroupDocs.Total for Java 24.3 instead?

Hi @evgen.efimov
Sorry, it’s my mistake. We are currently using Groupdocs Viewer version 24.12.

Thank You!
Vaibhav

@Vaibhavj22 ,

Thank you for the clarification.
To make further communication regarding this issue more convenient, we have created a dedicated thread on our support forum.
We will get back to you there as soon as we recheck the case with the correct version of the library.