Skip to content

furtib/pdf_multitool

Repository files navigation

pdf-multitool

Tests

A browser-based PDF multitool to select pages from separate PDF files and concatenate them into a single file.

Features

  • Merge PDFs: Open multiple PDF files and select individual pages to combine.
  • Annotate: Draw, add text, and erase annotations directly on PDF pages.
  • Reorder: Drag and drop to reorder files and selected pages.
  • Persistent State: Automatic session saving using IndexedDB (localforage).

Project Structure

The project has been refactored into a modern, modular architecture:

  • src/main.js: Application entry point and initialization.
  • src/modules/:
    • state.js: Global state management and persistence.
    • drawing.js: Annotation tools and canvas logic.
    • viewer.js: PDF rendering and viewer interactions.
    • selection.js: Page selection queue management.
    • undo.js: Undo/redo history system.
    • export.js: PDF generation and merging.
    • file-handler.js: File input processing.
    • ui.js: Layout and sidebar interactions.
    • utils.js: Shared UI helpers.

Testing

This project uses both unit tests and end-to-end tests to ensure reliability.

Unit Tests

We use Vitest for fast unit testing of core logic (math utilities, undo/redo, state management).

To run unit tests:

npm run test:unit

End-to-End Tests

We use Playwright for verifying user workflows in the browser.

To run end-to-end tests:

npm test

Prerequisites

Ensure you have dependencies and browsers installed:

npm install
npx playwright install

About

A tool to select pages from separate pdf files and concatanate them into a single file. !!!VIBE CODED!!!

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors