EML to PDF conversion issue in Java

Hello, We are facing an issue with eml to pdf conversion, Conversion is successful but pdf get generated with cut edges.
please find the attached files for your reference – (https://drive.google.com/drive/folders/1FhGNCylE73EMKRD5hSII6ZY3DsZ0gngO?usp=sharing)
We have tried it with groupDcos.Conversion in JAVA , please let us know any configuration required for it.

Thanks.

1 Like

@Pratiksha_Thakurdas

Please take a look at these output PDFs.zip (169.4 KB). Do you expect such outputs?

@Atir_Tahir
Yes, exactly.

@Pratiksha_Thakurdas

We generated this result using following code and API version 22.3:

License lic = new License();
lic.setLicense("D:/GroupDocs.Conversion.lic"); 
Converter converter = new Converter("D:/Review Feedback received_ 5396_test (300).eml"); 
PdfConvertOptions options = new PdfConvertOptions(); 
converter.convert("D:/converted2.pdf", options); 

You can request a temporary license and avoid all the API limitations.

Hello @Atir_Tahir

As per your recommendation we are using updated GroupDocs API version (22.8.1) but now we are facing other issues.
if multiple images are sequentially placed one after other in a single row of input eml file in output pdf they are getting placed one above the other.
And if eml file contains information along with header and footer image pdf file get generated with 3 pages i.e single image on each page.
they are supposed to be there in pdf file as that of the eml file.
please find the attached eml file for your reference -
( https://drive.google.com/drive/folders/1FhGNCylE73EMKRD5hSII6ZY3DsZ0gngO?usp=sharing )

Please kindly suggest how can we achieve the same.
Thanks.

@Pratiksha_Thakurdas

Could you please share your output PDF files? Also share the conversion code that you are using.

Please find the output pdf files
( https://drive.google.com/drive/folders/1FhGNCylE73EMKRD5hSII6ZY3DsZ0gngO )
and conversion code is as following

	try {
		// Load source file EML for conversion
		Converter converter = new Converter("E:\\EML\\Ex-2(header_and_footer).eml");
		
		ConverterSettings converterSettings = new ConverterSettings();
		
		// Prepare conversion options for target format PDF
		PdfConvertOptions convertOptions = new PdfConvertOptions();
		
		// Convert to PDF format
		converter.convert("E:\\EML\\Ex-2(header_and_footer).pdf", convertOptions);
		
		System.out.println("eml to pdf conversion done");
	} catch (Exception e) {
		System.out.println(e);
	}

Thanks.

1 Like

@Pratiksha_Thakurdas

This issue is reproduced at our end. Therefore, we’ve logged it in our internal issue tracking system. Your investigation ticket ID is CONVERSIONJAVA-1822.

Hello @Atir_Tahir
kindly please let us know is there any updates on this issue.

@Pratiksha_Thakurdas

This ticket is in progress. We’ll notify you in case of any update.

@Pratiksha_Thakurdas

To keep the image proportions, Converter wraps the rows of the table to the next page.
If you want to keep whole content on one page, you should fit the html by setting images width in pixels,
or you can change the page size for conversion:

 convertOptions.setPageSize(PageSize.CUSTOM);
 convertOptions.setWidth(640);
 convertOptions.setHeight(1150);

Also you can hide the message header:

  EmailLoadOptions loadOptions = new EmailLoadOptions();
  loadOptions.setDisplayHeader(false);
  // Load source file EML for conversion
  Converter converter = new Converter("Ex-2(header_and_footer).eml", loadOptions);

@Atir_Tahir
if multiple images are sequentially placed one after other in a single row of input eml file in output pdf they are still getting placed one above the other.
will you please provide details regarding how we can fit the html by setting images width in pixels.

Thank you.

@Pratiksha_Thakurdas

We are further investigating this scenario.

@Atir_Tahir
Please let us know is there any update on this issue

@Pratiksha_Thakurdas

This scenario is still under investigation.

@Pratiksha_Thakurdas

You have to adjust the height of images or rows of a table with images so that they correspond to the height of a standard page in a PDF document.

@Atir_Tahir
Thank you for responding. It would be really great if you could provide the details regarding adjusting the height of images with respective height of standard page in PDF document.

1 Like

@Pratiksha_Thakurdas

We are looking into this scenario. You’ll be notified about the outcomes.

@atir.tahir
Kindly please let us know is there any update on this issue

@Pratiksha_Thakurdas

We’ll notify you in case of any update.