跳到正文
DEV Community· Muhammad Ali·· 3 小時前AI 評分43

我用 Next.js 和 Python 開發免費 PDF 工具集,並分享 PDF 開發心得

I built a free PDF toolkit with Next.js and Python (and what I learned about PDFs)

AI 導讀

MyPDFLabs 上線,提供約 26 種線上 PDF 工具,涵蓋編輯、整理、轉換、簽署、OCR 和 PDF 對話等功能。核心工具毋須註冊、不會加上浮水印,支援 500MB 以下檔案,並在處理後自動刪除上載檔案。網站以 Next.js 建構前端,並用 Python 處理 PDF。

正文

A few weeks ago I started building MyPDFLabs, a free set of online PDF tools. It's live now, and I'd like to share what it does, how it's built, and what I learned about PDFs along the way. I'd also really like your feedback.

Why I built it

Every time I needed to rotate, merge or sign a PDF, the same things got in the way: a sign-up wall, a watermark on the result, or a small file size limit. I wanted a tool where you open the page, upload the file and get the result.

So I built one.

What it does

MyPDFLabs has around 26 tools in the browser:

  • Edit and create PDFs: change text, add images, shapes and signatures
  • Organize: merge, split and extract pages, rotate, delete and reorder pages, add page numbers
  • Convert: PDF to Word, Excel and images, and Word, Excel, PowerPoint and images to PDF
  • Protect and clean up: compress, watermark and stamp, redact, encrypt and unlock, flatten
  • Sign and fill forms
  • OCR for scanned documents
  • Chat with PDF, to ask questions about a document
  • An ATS-friendly resume builder with 50+ templates

The core tools need no registration and add no watermarks. Files up to 500MB are supported, and uploaded files are deleted automatically after processing.

The stack

  • Frontend: Next.js (React)
  • Backend: Python, for the heavy PDF processing
  • Hosting: a VPS I manage myself

I split it this way because the browser is good for the interface and quick interactions, while Python has strong libraries for the real PDF work.

What makes PDF tools tricky

If you've never built with PDFs, here's what surprised me.

A PDF isn't a document like Word is. It describes where to draw each piece of text on a page. There are no paragraphs that reflow. That's why editing a sentence is much harder than it looks, because the file has no idea the sentence exists.

Fonts are a common problem. If the original font isn't embedded or available, text can shift when you edit it. Checking the result after saving matters.

Long documents need care. An editor that works for a 5-page file can struggle with a 200-page one. I test mine with large PDFs because pages and thumbnails have to load without freezing the browser.

Scanned PDFs are just pictures. To edit or search them, you first need OCR to turn the image into real text.

Privacy is a design decision, not a feature. People upload contracts, IDs and CVs. That's why uploaded files get deleted after processing, and why I don't ask for an account.

What I'd like feedback on

The site is still new, so I'd love honest opinions:

  1. Which tool would you use most?
  2. Is anything confusing, slow or broken?
  3. What PDF tool is missing?
  4. If you've built PDF tooling yourself, how did you handle text editing and fonts? I'd like to compare notes.

Try it

You can find everything at mypdflabs.com. If you only want to try one thing, open the PDF editor.

Thanks for reading, and I'll reply to every comment.

來源:DEV Community · dev.to