nupdf.gui ========= .. py:module:: nupdf.gui .. autoapi-nested-parse:: nuPDF graphical user interface. Provides a :class:`Form` dialog built with PyQt5 that wraps the :mod:`nupdf.core` functions for merging and rotating PDF/image files. The UI is divided into four labelled sections: 1. **Input Files** — add, reorder, and remove files (drag-and-drop supported). 2. **Options** — merge, bookmarks, recto-verso interleaving. 3. **Rotation** — optional clockwise rotation by angle and/or page range. 4. **Output** — choose where to save the resulting PDF. Entry point ----------- Call :func:`main` to launch the application, or compile to a standalone executable with PyInstaller:: pyinstaller --onefile --windowed --name="nuPDF" nupdf/gui.py For a directory-based (faster startup) build:: pyinstaller --onedir --windowed --name="nuPDF" nupdf/gui.py Attributes ---------- .. autoapisummary:: nupdf.gui.SUPPORTED_EXTENSIONS Classes ------- .. autoapisummary:: nupdf.gui.Form Functions --------- .. autoapisummary:: nupdf.gui.main Module Contents --------------- .. py:data:: SUPPORTED_EXTENSIONS :value: ('.pdf', '.PDF', '.jpg', '.jpeg', '.JPG', '.JPEG', '.png', '.PNG', '.gif', '.GIF', '.raw', '.RAW') .. py:class:: Form(parent: PyQt5.QtWidgets.QWidget = None) Bases: :py:obj:`PyQt5.QtWidgets.QDialog` Main nuPDF dialog window. The UI is split into four :class:`~PyQt5.QtWidgets.QGroupBox` sections: * **Input Files** — add files or a folder, reorder, remove. * **Options** — merge toggle, bookmark toggle, recto-verso interleaving. * **Rotation** — clockwise angle and optional page-range filter. * **Output** — output file path selector. Drag-and-drop from the OS file manager is supported. Files already present in the list are not added a second time. :param parent: Optional parent widget. .. py:attribute:: select_files_btn .. py:attribute:: select_folder_btn .. py:attribute:: list_widget .. py:attribute:: up_btn .. py:attribute:: down_btn .. py:attribute:: remove_btn .. py:attribute:: clear_btn .. py:attribute:: merge_checkbox .. py:attribute:: bookmark_checkbox .. py:attribute:: recto_verso_checkbox .. py:attribute:: same_file_checkbox .. py:attribute:: angle_input .. py:attribute:: pages_input .. py:attribute:: set_saving_path_btn .. py:attribute:: saving_path_input .. py:attribute:: run_btn .. py:attribute:: status_label .. py:method:: get_files() -> None Open a multi-file dialog and append selected files to the list. .. py:method:: get_folder() -> None Open a folder dialog and recursively add all supported files found. .. py:method:: run() -> None Validate inputs, then execute the merge / rotate operation. Reads all UI controls and calls :func:`~nupdf.core.merge_pdfs` and/or :func:`~nupdf.core.rotate_pages` as required. The status label is updated at each step. Any error is shown in a :class:`~PyQt5.QtWidgets.QMessageBox` so the window stays open for the user to correct the problem. .. py:function:: main() -> None Launch the nuPDF application.