Skip to content

Instantly share code, notes, and snippets.

@groupdocs-com-kb
Last active November 22, 2023 13:34
Convert PDF to DOCX Using Java. For more information, please follow link: https://kb.groupdocs.com/conversion/java/convert-pdf-to-docx-using-java/
import com.groupdocs.conversion.Converter;
import com.groupdocs.conversion.filetypes.WordProcessingFileType;
import com.groupdocs.conversion.licensing.License;
import com.groupdocs.conversion.options.convert.WordProcessingConvertOptions;
public class ConvertPDFtoDOCXUsingJava {
public static void main(String[] args) {
// Set License to avoid the limitations of Conversion library
License license = new License();
license.setLicense("GroupDocs.Conversion.lic");
// Import PDF document
Converter converter = new Converter("input.pdf");
WordProcessingConvertOptions options = new WordProcessingConvertOptions();
options.setFormat(WordProcessingFileType.Docx);
// Save the DOCX to disk
converter.convert("result.docx", options);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment