Document conversion is hanging using Java

Hi,
We are encountering the same issue (documents hanging during conversion) while converting various file formats such as .docx, .xlsx, .pptx, etc., into PDFs. This issue is occurring only in our production environment (which primarily runs on ELB), not locally. Additionally, please note that we recently upgraded from version 22.8.1 to 23.11.1.

Hi @Mahesh_Amle, we are working on it. It seems to be some problem with a directory tree iterating. I will update you when we fix IT.

Hi @Mahesh_Amle
We are also facing the same issue , could you please help us that which file system you are using ?
We also switched to 22.8.1 to 24.1 version .
This issue is occurring since 23.6.1 version for us.

Hi @sandeepsuthari , @Mahesh_Amle
Can you please try this jar and share the log?

Hi @vsevolod.orefin
Thanks for sharing the jar with us. We’ve been trying it out locally, but we’re facing some issues with MSG and EML files when converting them into PDFs. Specifically, the images aren’t showing properly on the converted PDFs; instead, we’re seeing some cross marks in place of the images. Could you provide any insights or suggestions on this? Also attached are screenshots of the image present in the original msg file and in the converted PDF file using this jar.
Original Image in MSG file.PNG (64.1 KB)

Image in converted pdf file.PNG (2.2 KB)

Can you please attach an eml file also?
And to reproduce the issue, I think you should try to do it on the machine where you already had the problem.

Hello @vsevolod.orefin
Please find the MSG file
MSG FILE

Thanks.

Thanks @Mahesh_Amle , I will check and update you.

Hi @vsevolod.orefin do you have any update on this?

@Mahesh_Amle I’m still working on it

Hi @vsevolod.orefin do you have any update on this?

I think today I will be able to say about images issue, and continue investigation of the hanging.

@Mahesh_Amle one of the possible reasons may be that you have the working directory in the root of the container / OS filesystem.
So please try to change it, for example you can create the app directory for your jar and change the working directory:
WORKDIR “/app”

Hi @vsevolod.orefin
We’re working on integrating the latest version of GroupDocs Conversion (24.11) into our project, but we’ve noticed slow performance and intermittent freezes during conversion. Could you please investigate this issue?

Thanks.

Hello @Vaibhavj22 ,

We’re very sorry to hear that you are experiencing such issues. In order to help you and investigate this problem further, we need additional information from you. Could you please clarify whether this issue occurs with specific document types or with all types in general? Additionally, could you let us know the version of the GroupDocs.Conversion for Java you were using before encountering this issue, also the Java version you are currently using, and whether you have configured the -Xmx setting to improve JVM performance?

Hello,
We are currently using GroupDocs Conversion version 23.11.1 in our project and recently attempted to update to the latest version (24.11). we’ve encountered some performance issues, including slowness and occasional hang-ups during the conversion process for certain file types. Yesterday, we uploaded a batch of around 100 files for conversion, but the process got stuck after approximately 50 files. This issue primarily affects file formats such as .ppt, .pptx, .pps, .eml, .msg, .doc, .docx, and others.

Thanks.

Hello @Vaibhavj22 ,

Thank you for the details provided. We’ll begin investigating the issue, but to speed up the process, we kindly ask you to share a few example files that you believe lead to the process hanging. It would also be very helpful if you could include the code snippet you’re using for the conversion, so we can confirm the exact settings applied.

We look forward to your additional input to assist you promptly.

Hi @evgen.efimov
We have used the following ConvertSetting, LoadOptions, and PdfConvertOptions. Please review them and let us know if additional configuration options could help improve performance. Kindly provide your recommendations.

//this is convert-setting
private ConverterSettings getConverterSettings() {
ConverterSettings converterSetting = new ConverterSettings();
List fontDiretories = new ArrayList<>();
fontDiretories.add(custoFontDirectory);
converterSetting.setFontDirectories(fontDiretories);
converterSetting.getFontDirectories().addAll(fontDiretories);
return converterSetting;
}

// this is get load-options method
private LoadOptions getLoadOptions(String inputFileExtension,boolean isthumbnail) {

	if(SHEET_FORMATS.contains(inputFileExtension)) { // for "xls, xlsx, csv, ods"
		SpreadsheetLoadOptions loadOptions = new SpreadsheetLoadOptions();
		if(isthumbnail) {
			loadOptions.setConvertRange(A1:G30);
		}
		loadOptions.setSkipEmptyRowsAndColumns(true);
		loadOptions.setOnePagePerSheet(true);
		return loadOptions;
	}
	if(DOC_FORMATS.contains(inputFileExtension)) { // for "doc,docx,odt,docm,dot,dotx,dotm,rtf,txt,ott"
		 WordProcessingLoadOptions wloadOptions = new  WordProcessingLoadOptions(); 
		 return wloadOptions;
	}
	
	return null;
}

//This is pdf conversion code
public String convertToPdf(String inputFilePath, boolean isthumbnail) {
Converter converter = null;
try {
ConverterSettings converterSettings = getConverterSettings();
LoadOptions loadOptions = getLoadOptions(FilenameUtils.getExtension(inputFilePath),isthumbnail);

		if(Objects.nonNull(loadOptions)) {
			converter = new Converter(inputFilePath, loadOptions, converterSettings);
		} else {
			converter = new Converter(inputFilePath,converterSettings);
		}
		
		File outputFile = outputPath + "GDOC_xxxxxxx",".pdf");
		
	    PdfConvertOptions convetOptions = new PdfConvertOptions();
		
		if(isthumbnail) {
			convetOptions.setPageNumber(1);//start conversion from page 1
			convetOptions.setPagesCount(1);//convert upto pages
		}
		converter.convert(outputFile.getAbsolutePath(), convetOptions);
		converter.dispose();
		return outputFile.getAbsolutePath();
	}
	catch(Exception e){
	} finally {
		if(converter != null) {converter.close();}
	}
}

Hi @evgen.efimov
We have uploaded the files to the following folder: GD-Issued Files - Google Drive . Could you please check them? The conversion process is taking some time, and the output PDF from the .eml and .msg files we shared does not display the images the same way as in the original files.we were verified with current (23.11.1) and latest version(24.11) we will wait for a positive response.

Hello @Vaibhavj22 ,

We greatly appreciate your assistance and are thankful for the information and test files you provided. We have registered your issue in our ticket tracking system under the ID CONVERSIONJAVA-2655. We will get back to you as soon as we have the results of our investigation.