You are browsing as a guest. Sign up (or log in) to start making projects!

34m 25s logged

PDF Toolkit — Development Log 2

CLI Complete

The first usable version of the PDF Toolkit CLI is now complete.

I created cli.py and connected all of the PDF operations that were already implemented to a single interactive interface.

The CLI is built using Questionary for the terminal menu and Tkinter file dialogs for selecting input and output files.

Available Operations

The CLI currently supports:

  • Merge PDFs
  • PDF → Image
  • Split PDF
  • Extract Pages
  • Exit

Each operation can now be selected directly from the terminal.

File Selection

Instead of requiring users to manually type file paths, the CLI uses Tkinter file dialogs to select files and folders.

For example, when merging PDFs, the user can:

  1. Select multiple PDF files
  2. Choose the output location
  3. Create the merged PDF

The same approach is used for the other operations where appropriate.

PDF → Image

The CLI asks the user for the page number and then allows them to choose where the generated image should be saved.

Split PDF

For splitting PDFs, the user can select:

  • The input PDF
  • The output folder
  • The output filename prefix

This keeps the generated files organized.

Extract Pages

The CLI also supports the page selection syntax implemented in the extraction function.

For example:

1-5

or:

1,3,5-8

The selected pages are then saved into a new PDF.

Current Status

The core PDF operations are now implemented and accessible through the CLI.

The project has moved from individual PDF functions to an actual usable command-line application.

What’s Next

The next step is to improve the CLI experience and make the tool more reliable.

Possible improvements include:

  • Better error handling
  • Input validation
  • Success/error messages
  • Cleaner terminal output
  • More tests
  • Additional PDF operations
  • Packaging the project for easier installation and distribution
0
23

Comments 0

No comments yet. Be the first!