This project is a Java-based desktop application that converts Microsoft Word documents (.doc and .docx) to PDF files. It uses the docx4j library for handling Word documents and Apache FOP for PDF conversion. The graphical user interface (GUI) is built using Swing.
- Add multiple Word documents for batch conversion.
- Select an output directory for the converted PDF files.
- Supports both .doc and .docx formats.
- Maps fonts to ensure proper rendering in the PDF files. ( Still in progress )
- Java 8 or higher
- Maven 3.6 or higher
git clone https://github.com/Hikaru-e/docx2pdf.git
cd docx2pdf
Use Maven to build the project and create a runnable JAR file.
mvn clean package
After building the project, you can run the application using the generated JAR file located in the target
directory.
java -jar target/docx2pdf-1.0-SNAPSHOT-shaded.jar
- Launch the application.
- Click on "Add Files" to select Word documents (.doc or .docx) for conversion.
- Click on "Browse" to choose an output directory where the converted PDF files will be saved.
- Click on "Convert to PDF" to start the conversion process.
- The application will notify you upon successful conversion of each file.
src/main/java/org/example/Main.java
: The main class containing the application logic and GUI.src/main/resources/
: Contains additional resources such as icons and styles.pom.xml
: Maven project file containing dependencies and build configuration.
The project relies on the following main dependencies:
- docx4j: For handling Word documents.
- Apache FOP: For converting documents to PDF.
All dependencies are defined in the pom.xml
file and are managed by Maven.