Last active
November 24, 2024 14:40
Convert Word DOC to EPUB using Java. For further details: https://kb.aspose.com/words/java/convert-word-doc-to-epub-using-java/
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
import com.aspose.words.*; | |
import java.awt.*; | |
public class Main | |
{ | |
public static void main(String[] args) throws Exception // Convert DOCX to EPUB in Java | |
{ | |
new License().setLicense("License.lic"); //To avoid watermark | |
Document wordDoc = new Document("SampleFile.docx"); | |
HtmlSaveOptions optionsForEpub = new HtmlSaveOptions(); | |
optionsForEpub.setDocumentSplitCriteria(DocumentSplitCriteria.HEADING_PARAGRAPH); | |
optionsForEpub.setSaveFormat(SaveFormat.EPUB); | |
wordDoc.save("output.epub", optionsForEpub); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment