Created
January 17, 2020 11:30
-
-
Save aspose-com-gists/6b3fd2f622633cffc7e000b4d33bb027 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Load source PDF file | |
Document doc = new Document("input.pdf"); | |
// Save resultant DOC file | |
doc.save("output.doc", SaveFormat.Doc); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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