MIT License

项目介绍

TwoBall/PaperSplit 是一个托管在 GitHub 上的开源项目,主要使用 JavaScript 编写,采用 MIT License 许可证,目前获得 39 个 Star、12 次 Fork。

仓库全名
TwoBall/PaperSplit
开源许可证
MIT License
Star 数
39
Fork 数
12
未关闭 Issue
1

README 摘要

PaperSplit English | 中文指南 📖 English PaperSplit is a lightweight, privacy-focused web tool designed to split A3 exam papers or documents into A4 format. It runs entirely in your browser, ensuring your data remains private and secure. ✨ Key Features Smart Import: Supports drag-and-drop for A3 PDFs or images (JPG/PNG). Visual Splitting: Provides an intuitive red splitter line to manually adjust the cut position…

完整内容见 GitHub 原始 README 或本页 。

常见问题

PaperSplit 用什么语言开发?

主要使用 JavaScript 编写,采用 MIT License 许可证,目前有 39 个 Star。

PaperSplit 可以免费商用吗?

仓库采用 MIT License 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 PaperSplit 的源码?

可以直接克隆仓库:git clone https://github.com/TwoBall/PaperSplit.git,默认分支为 master;安装与运行步骤见仓库 README。

PaperSplit 最近还在维护吗?

仓库最近一次更新为 6月20日,当前有 1 个未关闭 Issue;Star 数为 39,可作为社区活跃度的参考。

关于

A privacy-focused web tool to split A3 PDFs into A4 pages. ✂️ 一个注重隐私的 A3 转 A4 试卷拆分工具,支持去除密封线。

描述取自 GitHub 官方 API,中文内容由 GitRead 中文社区 编辑团队整理。

简要分析

热度分
63
价值分
26
活跃状态
活跃

语言占比

CSS
HTML
JavaScript

贡献者

README

PaperSplit Logo

PaperSplit

English | 中文指南

📖 English

PaperSplit is a lightweight, privacy-focused web tool designed to split A3 exam papers or documents into A4 format. It runs entirely in your browser, ensuring your data remains private and secure.

✨ Key Features

  • Smart Import: Supports drag-and-drop for A3 PDFs or images (JPG/PNG).
  • Visual Splitting: Provides an intuitive red splitter line to manually adjust the cut position between pages.
  • Seal Line Removal:
    • Dedicated “Remove Seal Line” mode.
    • Smart Detection: Odd pages default to left, even pages default to right.
    • Adjustable seal area that is automatically cropped during export.
  • Batch Application:
    • Apply to Same Type: One-click apply settings to all Odd or all Even pages.
    • Apply to All: Apply current configuration to every page.
  • HD Export: Generates high-quality A4 PDF documents using jsPDF, with selectable page-fit modes (standard A4 with margins, stretch-to-fill, or original crop size).
  • Responsive Design: Works perfectly on both PC and mobile devices.

🚀 Quick Start

1. Install Dependencies

This project uses npm for dependency management.

npm install
2. Start Development Server
npm run dev

Open the local URL shown in the terminal (usually http://localhost:5173).

3. How to Use
  1. Import: Click “Select File” or drag your file into the workspace.
  2. Adjust:
    • Move the Red Line to set the A4 split position.
    • Click “Remove Seal Line” to add a cut-off area if needed (draggable).
  3. Batch: Use “Same Type” or “All Pages” buttons to apply your settings to other pages.
  4. Export: Click “Export as PDF (A4)” to download your processed file.

🇨🇳 中文指南

PaperSplit (原 PDF Edit) 是一个基于 Web 的轻量级工具,专为将 A3 格式的试卷或文档拆分为 A4 格式而设计。它完全在浏览器端运行,确保数据隐私安全。

✨ 核心功能

  • 智能导入:支持拖拽上传 A3 PDF 文件或图片(JPG/PNG)。
  • 可视化分割:提供直观的红色分割线,可手动调整左右页面的分割位置。
  • 密封线处理:
    • 支持“去除密封线”模式。
    • 智能识别:奇数页默认在左侧,偶数页默认在右侧。
    • 可拖动调整密封线范围,导出时自动裁切该区域。
  • 批量应用:
    • 同类页:一键应用当前配置到所有奇数页或所有偶数页。
    • 所有页:一键应用到文档所有页面。
  • 高清导出:基于 jsPDF 生成高质量的 A4 PDF 文档,并可选择导出尺寸适配方式(标准A4等比留白 / 拉伸填满 / 原始裁剪尺寸)。
  • 响应式设计:完美适配 PC 和移动端操作,手机上也能轻松处理试卷。

🚀 快速开始

1. 安装依赖
npm install
2. 启动开发服务器
npm run dev

启动后,访问终端显示的本地地址(通常是 http://localhost:5173)。

3. 使用流程
  1. 导入:点击“选择文件”或直接拖拽文件到工作区。
  2. 调整:
    • 移动红色分割线确定左右分页界限。
    • 若有密封线需要去除,点击“去除密封线”,调整灰色虚线区域。
  3. 批量:调整好一页后,点击“同类页”或“所有页”将配置应用到其他页面。
  4. 导出:点击底部的“导出为 PDF (A4)”,文件将自动下载。

�️ Tech Stack / 技术栈

  • Core: Native JavaScript (ES6 Modules)
  • PDF Processing: pdfjs-dist (Rendering), jspdf (Generation)
  • Styling: CSS3 (Flexbox/Grid), Material Icons, Google Fonts
  • Build: Vite

�📂 Project Structure / 项目结构

/
├── index.html          # Entry HTML
├── style.css           # Global Styles
├── vite.config.js      # Vite Configuration
├── src/                # Source Code
│   ├── main.js         # Entry Point
│   ├── state.js        # State Management
│   ├── dom.js          # DOM Elements
│   ├── file-handler.js # File Upload & Processing
│   ├── viewer.js       # Canvas Rendering
│   ├── editor.js       # Split/Seal Line Logic
│   └── exporter.js     # PDF Export Logic
└── DEPLOY.md           # Deployment Guide

📄 License

MIT License

📅 Changelog / 更新日志

2026-06-20 (Export Fit Modes / 导出尺寸适配)

  • Selectable Export Fit: Added an “导出尺寸” selector with three modes — Standard A4 (fit, with margins) [default], Standard A4 (stretch to fill), and Original crop size (WYSIWYG). Dragging the split line off-center no longer forces non-A4 pages unless you choose WYSIWYG. 新增"导出尺寸"选择器:标准A4等比留白(默认)、标准A4拉伸填满、原始裁剪尺寸;切割线偏离中心也能稳定输出标准 A4。

2026-06-20 (Bug Fixes / 问题修复)

  • Render Race Fix: renderCurrentPage now uses a render token to discard stale concurrent renders, and the window-resize handler is debounced (150ms) — no more duplicate canvases / overlapping guide lines when resizing or switching pages quickly. 修复窗口缩放、快速翻页时画布与辅助线重影的问题。
  • Unsupported File Handling: File type is now validated before enabling controls; unknown formats show an alert and abort instead of leaving the UI half-enabled. resetState now also resets isPdf. 上传不支持的文件类型不再留下"半启用"状态。
  • Seal Line Symmetry: Even-page default seal position corrected from 0.8 to 0.85, symmetric with the odd-page 0.15. 修正偶数页默认密封线位置,与奇数页对称。
  • Export Geometry: Seal direction is now driven by seal.type (not its position relative to the split line), and the split point is clamped into the kept region — dragging a seal line across the split line can no longer leak the sealed area or produce inverted slices. 导出时密封方向由语义决定并钳制分割点,杜绝密封区外泄与反向切片。

2025-12-13 (Evening Update)

  • Bug Fix: Fixed seal line drag jumping issue using delta-based calculation.
  • UX Improvement: Auto-hide left thumbnail panel when no file is uploaded.
  • Config Adjustment: Optimized default seal line position to 0.15/0.85 for better accuracy.

2025-12-13

  • Mobile Support: Added touch event support for smooth split-line dragging on mobile devices.
  • UI Redesign: Replaced split-line dots with an arrow handle (↔) for better visibility and usability.
  • Style Optimization: Refactored style.css with cleaner structure and removed redundant code.
  • Branding: Updated project icon and header logo.

评论

暂无评论