Skip to content

feat: add flip PDF operation - #214

Open
chrisriv10 wants to merge 1 commit into
mithun-srinivas:mainfrom
chrisriv10:feat/flip-pdf
Open

feat: add flip PDF operation#214
chrisriv10 wants to merge 1 commit into
mithun-srinivas:mainfrom
chrisriv10:feat/flip-pdf

Conversation

@chrisriv10

Copy link
Copy Markdown

Which issue does this close?

Closes #199

What changed

Adds a new Flip PDF operation (src/operations/flip-pdf/) that mirrors every page of a PDF:

  • Horizontal — mirrors left ↔ right
  • Vertical — mirrors top ↔ bottom
  • Both — mirrors both axes

Uses pdf-lib with supported xScale/yScale negative scaling + translation (not the unsupported transformationMatrix). Preserves original page dimensions, supports multi-page PDFs, fully client-side with no new dependencies.

Acceptance criteria

  • Pages are mirrored on the chosen axis in the exported PDF
  • Works on multi-page PDFs
  • Runs fully offline
  • Follows the plugin pattern: self-contained src/operations/flip-pdf/{meta.js,index.jsx,helpers.js}
  • Reuses shared components (Dropzone, useJob, Progress, Note, DownloadButton, usePdfPageCount)
  • Auto-discovered via registry globs (no central wiring)
  • Order: 6 (appears right after Rotate PDF)

Checklist

  • Runs fully offline: no network calls, no CDNs, no external assets (strict CSP connect-src 'self')
  • Follows the plugin pattern and reuses shared components where relevant
  • npm run build passes locally

Proof

  • npm run lint ✅ (0 errors, 19 pre-existing warnings)
  • npm run format:check
  • npm run build ✅ (559 modules, 51 prerendered pages)
  • npm run test ✅ (40 tests in 4 files)

Manual verification with asymmetric test PDF (400×300, 2 pages):

  • Horizontal: LEFT ↔ RIGHT swapped, TOP/BOTTOM unchanged
  • Vertical: TOP ↔ BOTTOM swapped, LEFT/RIGHT unchanged
  • Both: both axes flipped
  • Page count preserved (2 → 2), dimensions unchanged (400×300)

Copilot AI lite review requested due to automatic review settings September 3, 2026 21:48
@vercel

vercel Bot commented Sep 3, 2026

Copy link
Copy Markdown

@chrisriv10 is attempting to deploy a commit to the Mithun Srinivas' projects Team on Vercel.

A member of the Team first needs to authorize it.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flip PDF (mirror pages horizontally or vertically)

2 participants