nupdf.gui

nuPDF graphical user interface.

Provides a Form dialog built with PyQt5 that wraps the 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 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

SUPPORTED_EXTENSIONS

Classes

Form

Main nuPDF dialog window.

Functions

main(→ None)

Launch the nuPDF application.

Module Contents

nupdf.gui.SUPPORTED_EXTENSIONS = ('.pdf', '.PDF', '.jpg', '.jpeg', '.JPG', '.JPEG', '.png', '.PNG', '.gif', '.GIF', '.raw', '.RAW')[source]
class nupdf.gui.Form(parent: PyQt5.QtWidgets.QWidget = None)[source]

Bases: PyQt5.QtWidgets.QDialog

Main nuPDF dialog window.

The UI is split into four 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.

Parameters:

parent – Optional parent widget.

select_files_btn[source]
select_folder_btn[source]
list_widget[source]
up_btn[source]
down_btn[source]
remove_btn[source]
clear_btn[source]
merge_checkbox[source]
bookmark_checkbox[source]
recto_verso_checkbox[source]
same_file_checkbox[source]
angle_input[source]
pages_input[source]
set_saving_path_btn[source]
saving_path_input[source]
run_btn[source]
status_label[source]
get_files() None[source]

Open a multi-file dialog and append selected files to the list.

get_folder() None[source]

Open a folder dialog and recursively add all supported files found.

run() None[source]

Validate inputs, then execute the merge / rotate operation.

Reads all UI controls and calls merge_pdfs() and/or rotate_pages() as required. The status label is updated at each step. Any error is shown in a QMessageBox so the window stays open for the user to correct the problem.

nupdf.gui.main() None[source]

Launch the nuPDF application.