Developers can run pdf2wordx directly from its source code without installing the package from PyPI. This is the recommended approach when contributing fixes, adding features, or simply customizing the application for personal use. All you need is Python, a terminal, and the two runtime dependencies listed inDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/dev2forge/pdf2wordx/llms.txt
Use this file to discover all available pages before exploring further.
requirements.txt. The setup takes under two minutes on a machine that already has Python installed.
Setup
Clone the repository
Clone the pdf2wordx repository from GitHub and navigate into the project directory:
Run all subsequent commands from the root of the cloned repository (the
pdf2wordx/ directory). The entry point script uses paths relative to this root, such as ./src/pdf2wordx/favicon.ico and ./src/pdf2wordx/log.log.(Optional) Create and activate a virtual environment
Create a virtual environment named Then activate it for your platform:You should see the
.venv in the project root:(.venv) prefix appear in your terminal prompt, confirming the environment is active.Install dependencies
Install the two runtime dependencies declared in This installs:
Tkinter itself is part of the Python standard library and does not need to be installed via pip. On some Linux distributions, you may need to install it separately with your system package manager (e.g.,
requirements.txt:| Package | Version | Purpose |
|---|---|---|
pdf2docx | 0.5.8 | Core PDF-to-Word conversion engine |
chromologger | 0.1.8 | Lightweight file logger used for error tracking |
sudo apt install python3-tk).Run the application
Launch the app from the repository root:The pdf2wordx window should appear, centered on your screen, ready to use.
The entry point when running from source is
./src/pdf2wordx/_pdf2wordx.py, not src/pdf2wordx/__init__.py. The __init__.py only exports the run() function for use when pdf2wordx is installed as a package.Project structure
The entire application lives undersrc/pdf2wordx/. Here is the full source layout:
log.log file is created at ./src/pdf2wordx/log.log the first time the application runs and is used to record runtime errors via chromologger.
Key modules
_pdf2wordx.py — Application entry point
_pdf2wordx.py — Application entry point
This is the top-level module and the file you run directly. It defines the
App class, which inherits from Window (defined in files/interfaz.py). The App.__init__() constructor:- Sets the window dimensions (
500×300), background color (#001223), and title ('PDF2WORDX'). - Loads the application icon from
favicon.ico. - Instantiates
Funcsfor business logic andWidgetsfor widget management. - Defines all 12 widget configurations in
op_elementsand their placement coordinates inpack_op. - Inserts the default filename
document-pdf2wordxinto the entry field.
command is wired to a method on App (self.fileSet, self.fileOutSet, self.convertFile, self.help, self.osl), which in turn delegate to the appropriate Funcs methods.The module-level run() function instantiates App with a fresh Tk() root and calls app.loopWindow() to enter the Tkinter main loop. This is the function exported by __init__.py for PyPI installs.files/interfaz.py — Window and Widgets classes
files/interfaz.py — Window and Widgets classes
Contains two classes that abstract away Tkinter boilerplate:
Window — Sets up the root Tk window with the given dimensions, background color, title, and resizability flags. Its private __centerWindow() method calculates the screen dimensions at runtime and returns an offset geometry string so the window always opens at the center of the display:Widgets — Manages dynamic widget creation and placement. Given a list of widget types (e.g., [Label, Button, Entry, ...]), a list of option dicts, and a list of placement dicts, widgetsCreate() instantiates each widget, stores it in widgetsList, and places it on the canvas using Tkinter’s place geometry manager. The getText(pos) helper reads the current value from any Entry widget by index.files/functions.py — Funcs class (business logic)
files/functions.py — Funcs class (business logic)
All application logic that is not pure UI lives in the
Errors in all methods are caught, logged to
Funcs class:| Method | Responsibility |
|---|---|
_askFile(button) | Opens a PDF file picker; stores the selected path and base name; enables the next button. |
_fileNameOut(txt) | Constructs the output filename by appending .docx to the entry field value. |
_askDirOut(button) | Opens a directory picker; assembles the full output path; enables the Convert button. |
_convertFile(button) | Async. Instantiates pdf2docx.Converter, calls .convert(), closes it, and disables the action buttons on success. |
_setTextLabel(label, prefix, txt) | Updates a Label widget’s text to display status information. |
_activeButton(button) | Calls button.configure(state='normal') to enable a disabled button. |
_disableButton(button) | Accepts a single Button or a list of Button objects and sets each to state='disabled'. |
msgbox(path, win_title) | Reads a plain-text file from path and displays its content in a showinfo dialog. |
log.log via chromologger, and surfaced to the user as showerror dialogs.files/info/ — Help text and license notice
files/info/ — Help text and license notice
Two plain-text resource files are read at runtime by
Funcs.msgbox():help— Contains the four-step usage instructions shown when the user clicks the “Ayuda” (Help) button.NOTICE— Contains the open-source attribution notice for the libraries used by pdf2wordx, shown when the user clicks the “OSL” button.
encoding='utf-8' and their full contents are passed directly to tkinter.messagebox.showinfo().