Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// Load source PDF file
Document doc = new Document("input.pdf");
// Save resultant DOC file
doc.save("output.doc", SaveFormat.Doc);
// Load source PDF file
Document doc = new Document("input.pdf");
// Instantiate DocSaveOptions instance
DocSaveOptions saveOptions = new DocSaveOptions();
// Set output format
saveOptions.setFormat(DocSaveOptions.DocFormat.DocX);
// Set the recognition mode as Flow
saveOptions.setMode(DocSaveOptions.RecognitionMode.Flow);
// Set the horizontal proximity as 2.5
saveOptions.setRelativeHorizontalProximity(2.5f);
// Enable bullets recognition during conversion process
saveOptions.setRecognizeBullets(true);
// Save resultant DOCX file
doc.save("resultant.docx", saveOptions);
// Load source PDF file
Document doc = new Document("input.pdf");
// Save resultant DOCX file
doc.save("output.docx", SaveFormat.DocX);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.