Aspose PDF for java 21.12 version is producing docx files which on editing messes up the character spacing and line spacing when content is within a list.
API code used
public static void ConvertPDFtoWordDocAdvanced()
{
Path pdfFile = Paths.get(_dataDir.toString(), "Sample-Report.pdf");
Path docFile = Paths.get(_dataDir.toString(), "Sample-Report.docx");
Document pdfDocument = new Document(pdfFile.toString());
DocSaveOptions saveOptions = new DocSaveOptions();
// Specify the output format as DOC
saveOptions.setFormat(DocSaveOptions.DocFormat.Docx);
// Set the recognition mode as Flow
saveOptions.setMode(DocSaveOptions.RecognitionMode.Flow);
// Enable the value to recognize bullets during conversion process
saveOptions.setRecognizeBullets(true);
pdfDocument.save(docFile.toString(), saveOptions);
}
Attached sample pdf and output word document generated.
Sample-Report.pdf (333.7 KB)
Sample-Report.docx (4.5 MB)