Pdf to docx conversion Paragraph numbering and bullets

Dear all,
We are performing an evaluation of PDF Java to perform the conversion of a text based pdf to a docx document. I’m using version 23.7

The purpose of the converted docx document is to allow for further editing, so RecognitionMode.Flow is most appropriate according to me.

I have the following piece of code to perform the conversion
public void convertToDocx(final InputStream inputDocument, final OutputStream docxDocument)
throws PdfConversionException {
logger.atInfo().log(“Start conversion of pdf document to docx.”);

	try {
		Document document = new Document(inputDocument);

		DocSaveOptions options = new DocSaveOptions();
		options.setFormat(DocSaveOptions.DocFormat.DocX);
		options.setMode(DocSaveOptions.RecognitionMode.Flow);
		options.setAddReturnToLineEnd(false);
		options.setRecognizeBullets(true);
		options.setCloseResponse(false);
		
		document.save(docxDocument, options);
		document.close();
	} catch (Exception e) {
		throw new PdfConversionException("Failure to convert pdf document.", e);
	}

	logger.atInfo().log("Completed conversion of pdf document to docx.");
}

I have also used the online conversion, at PDF To DOCX Converter Free. PDF To DOCX Online.

The problem I encounter is that with my conversion code, the numbered paragraphs (or bulleted paragraphs) the numbers are converted into plain paragraph. (basically are not considered as list anymore).
Also the paragraph endings are not correctly set.

When I look at the results from the online conversion, there the numbering (and bulletting) is maintained. Also the paragraph endings are more correct.
Given that we want to use the resulting docx documents for further editing these two features are kind of essential, especially the maintaining of the numbering.

Is there a way to achieve the same result as the online service?

I have attached zip file. It has following structure
sourceDocuments: The pdf documents to convert
online: The results from the conversion at this url PDF To DOCX Converter Free. PDF To DOCX Online.
pdf-java-23.7: The results from the code I posted above.

16796391_2023-08-02.zip (473.8 KB)

Many thanks for providing some assistance.
Patrick

@PatrickVB

Please note that online Aspose Free Apps implements .NET APIs in the code behind and the App that is producing expected results, uses Aspose.Words for .NET API. Also, the PDF to DOCX conversion is only available in .NET API for Aspose.Words. It is not supported in Java API.

About Aspose.PDF for Java, we tested the scenario in our environment and were able to reproduce the issue. We have logged a ticket as PDFJAVA-43006 in our issue tracking system to rectify this problem. We will look into its details and keep you posted with the status of its resolution. Please be patient and spare us some time.

We are sorry for the inconvenience.