离线 · 无上传 · 浏览器本地完成Offline · no uploads · runs in the browser
PDF 转文本(.pdf → .txt)——本地提取文字层,不上传PDF to text locally — the text layer, no OCR
先把最容易被忽略的一条说清楚:能提出文字的 PDF,是「字原本是文字」的那一类——从 Word、LaTeX、网页导出的 PDF。扫描件与拍照件是像素,里面并没有文字层,提取出来自然是空的;把它变成文字需要 OCR,而 OCR 模型要几十 MB、需要联网下载,与「一个字节都不出本机」的前提直接冲突,所以本项目不带,也不会假装能带。The part most pages leave out: PDF text extraction works on PDFs whose words were always words — exports from Word, LaTeX, or a web page. A scan or a photo is pixels with no text layer inside, so extraction returns nothing. Turning that into text needs OCR, and an OCR model runs to tens of megabytes downloaded over a network, which contradicts the premise that not a byte leaves your machine. So this extension has none and does not pretend otherwise.
这条链路怎么走How the route runs
PDFPDF HTMLHTML 纯文本 (TXT)plain text (TXT)
共 2 步,由扩展的路径搜索自动选出,中间产物不落盘。2 steps, chosen by the extension's own path search; intermediate results never touch the disk.
会保留什么What carries over
- 文字层按阅读顺序提取,pdf.js 在你的机器上完成解析The text layer is extracted in reading order, parsed by pdf.js on your own machine
- 链接标注保留为超链接,并按协议白名单过滤——javascript: 与 data: 这类由 PDF 自带的可点击地址会被剔除Link annotations survive as hyperlinks, filtered by a scheme allowlist — javascript: and data: targets carried by the PDF are removed
- 同一份 PDF 还能转成 Markdown(保留标题与段落层级)或 HTML,比纯文本更可后续加工The same PDF can also go to Markdown, which keeps heading and paragraph hierarchy, or to HTML, both easier to keep editing than bare text
如实说明的限制What it does not do
- 扫描件、拍照件、图片型 PDF 提取为空——没有 OCR,也不会替你猜Scans, photographs and image-only PDFs come out empty — there is no OCR and no guesswork in its place
- 版式不进 TXT:分栏、页眉页脚、字体、颜色、嵌入图片都会消失;PDF 里的表格只是排过版的字符,不是结构化表格Layout does not enter TXT: columns, headers and footers, fonts, colour and embedded images are gone; a table in a PDF is typeset characters, not structure
- 因此 PDF → CSV / JSON / Excel 在界面上是置灰的,不是点了才报错(PDF 不携带表格结构,见 utils/core/conversion-policy.ts)That is why PDF → CSV / JSON / Excel is greyed out in the picker instead of failing after you click: a PDF carries no table structure (see utils/core/conversion-policy.ts)
- 带密码的 PDF 不会静默处理,读取失败会给出该文件的错误提示A password-protected PDF is not handled silently; a file that cannot be read reports its own error
实操提示Working with it
- 多份 PDF 可以一批处理,单个上限 100 MB,一批最多 200 个文件Several PDFs run in one batch, 100 MB per file and 200 files per run
- 需要「每页一张图」的产物请走 PDF → 图片,多页会一页一张装进 ZIPFor one-image-per-page output take the PDF to image route instead, which yields one page per image inside a ZIP
常见问题Questions people actually ask
为什么转出来几乎是空的?Why did I get almost nothing back?
几乎总是因为它本来就是图片。判断方法:在原来的 PDF 里用鼠标选一下文字——选不动就是扫描件,需要 OCR(本项目不提供)。Almost always because the PDF was an image all along. Test it in the original file: try selecting a word with the mouse. If nothing selects, it is a scan and needs OCR — which this project does not provide.
表格能被还原成 Excel 吗?Can the tables be recovered into Excel?
不能,这条是刻意的。PDF 的表格只有视觉排布,没有行列结构,硬转只会产出错位的垃圾表格。要结构化数据请回到导出 PDF 之前的源文件(Excel / CSV / JSON),或用 PDF → 文本后手工整理。No, and deliberately. A PDF table is a visual arrangement with no row/column structure, so forcing it yields a misaligned mess. Go back to the file the PDF was exported from (Excel, CSV, JSON), or tidy the extracted text by hand.
PDF 里的图片能提取出来吗?Can the images inside be extracted?
不能按对象取出。要图片请走 PDF → 图片,它把每一页整页栅格化成 PNG(多页装 ZIP)。Not as embedded objects. For images take PDF to image, which rasterises each page to PNG and ZIPs the pages together.
不需要账号,也不需要联网:装好扩展后点图标,在新标签页里打开工作台,文件从磁盘直接选。No account and no network: install the extension, click its icon, and the workbench opens in a new tab reading straight off your disk.
从 Chrome 应用商店安装Install from the Chrome Web Store 安装步骤Install steps GitHub 源码Source on GitHub