文件格式任意转换助手Transfer Any File

离线 · 无上传 · 浏览器本地完成Offline · no uploads · runs in the browser

PDF 转 Markdown——抽文字、留链接,离线完成PDF to Markdown offline — text out, links kept

要把一份 PDF 里的内容接着写进 README、笔记或工单,需要的是文字,而不是一张图片。这条链路是 PDF → HTML → Markdown:pdf.js 读出页面上的文本项、按位置把它们归成行,链接注释按协议白名单还原,最后由 Turndown 写成 Markdown。因此它对「能选中文字的 PDF」效果最好;扫描出来的图片型 PDF 里并没有文字可抽,那种文件需要的是 OCR,而不是转换。Getting content out of a PDF and into a README, a note or a ticket needs text, not a picture. This route is PDF → HTML → Markdown: pdf.js reads the text items on each page and assembles them into lines by position, link annotations come back as links behind a scheme allowlist, and Turndown writes the Markdown. That makes it good for PDFs whose text you can already select — a scanned PDF holds no text to extract, and what that needs is OCR, not conversion.

左右对照的预览与编辑视图
左右对照预览,下载前直接改Preview side by side, edit before you download

这条链路怎么走How the route runs

PDFPDF HTMLHTML MarkdownMarkdown

共 2 步,由扩展的路径搜索自动选出,中间产物不落盘。2 steps, chosen by the extension's own path search; intermediate results never touch the disk.

会保留什么What carries over

  • 文字逐个文本项读出,按 y 坐标归成行、按 x 间距补空格——不靠把整页拍成图片再认字Text is read item by item and assembled into lines by their vertical position, with spaces filled in from the horizontal gaps — no page image is recognised first
  • 文档自带书签时,书签标题命中的那几行写成对应层级的标题(最深取到第六层);没有书签时,短而整行大写的行会被认成二级标题Where the document carries bookmarks, the lines whose title matches one become headings at that depth (down to six levels); with no outline, a short line that is entirely capitals becomes an h2
  • PDF 里的链接注释还原成 Markdown 链接;协议不在白名单内的宁可不还原,也不留一个点开就跳走的地址Link annotations become Markdown links, and only for schemes on the allowlist — a link that would jump somewhere unexpected is left out rather than carried through
  • 表格如果本身是以文字排出来的,会作为文本行带过来A table that is genuinely made of text comes across as text lines
  • 产出是纯文本的 .md,可以直接进版本库、贴进笔记或聊天窗口The output is plain-text .md, so it can go straight into a repository, a note or a chat window

如实说明的限制What it does not do

  • 不做 OCR:图片型 PDF(扫描、拍照、打印成图片的)读不出文字,产出会接近空而不报错——这是「按内容形状办事」的取舍,不是失败No OCR: an image-only PDF (scanned, photographed, printed to a bitmap) has no text to read, so the result comes out close to empty without an error — a shape-of-content trade-off, not a failure
  • 行的先后取 pdf.js 给出的顺序,不做全局排序:多栏或文字绕排时,位置相近的行会按读出顺序串起来,所以这类文件需要人工归位Row order is the order pdf.js hands back, with no global sort: on multi-column or wrapped text, nearby lines string together in read order, so those files need tidying by hand
  • 标题层级只在书签或整行大写这两种形状下出现,多数 PDF 的正文全部落成普通段落;字号、颜色与分栏宽度不带过来Heading levels appear only from bookmarks or an all-caps line; most PDFs come out as plain paragraphs, and type sizes, colours and column widths do not survive
  • 页面上的图与矢量图形不进 Markdown(这条链路只走文字,也正因为如此它比整页栅格化快得多)Images and vector artwork on the page do not enter the Markdown — this route is text-only, which is also why it is far cheaper than rasterising the page
  • 页与页之间写成一条 Markdown 分隔线(`* * *`),页码若印在页面上则作为普通文本行留在原处;脚注没有对应物Pages are separated by a Markdown rule (`* * *`), a printed page number stays behind as an ordinary text line, and footnotes have no counterpart

实操提示Working with it

  • 一批最多 200 个文件,单个文件上限 100 MB;一条链路最多读 1000 页,超过会直接报错并说明要把文件拆开,而不是半途而废Up to 200 files per batch and 100 MB per file; one conversion reads at most 1000 pages and asks you to split the file beyond that rather than stopping halfway
  • 多个 PDF 一起转会逐个产出各自的 .md,想一次拿走就打成一个 ZIPSeveral PDFs yield one .md each, and the set can be taken as a single ZIP
  • 要的是「长得跟原件一样」而不是文字,那一条路是 PDF 转图片;想把 PDF 变成能改的文档,走 PDF 转 WordIf the goal is that it looks like the original, that is the PDF to image route; if it is a document you can keep editing, take PDF to Word

常见问题Questions people actually ask

扫描件能转成 Markdown 吗?Can a scanned document become Markdown?

不能。扫描件每一页是一张图片,里面没有可读的文字项,所以产出接近空白。要先把图片识别成文字(OCR),而这件事本扩展刻意不做——它不联网、也不带模型,与其给一份不可靠的结果,不如让你知道这条路到不了。No. A scan is one image per page with no text items to read, so the result comes out nearly empty. Getting text out of it means OCR, which this extension deliberately does not do: it has no network and ships no model, and an unreliable transcript is worse than a route that says where it stops.

为什么段落顺序乱了?Why is the paragraph order wrong?

最常见的原因是原件用了多栏或文字绕排:这一步只按 y 坐标把文本项归成行,行的先后仍是 pdf.js 读出来的顺序,不做全局排序,所以「先左栏后右栏」这种阅读顺序推不出来。这种文件转出来后建议当作素材用——人工归位比再造一个排版引擎轻。The usual cause is multiple columns or text that wraps around an object: lines are assembled from the vertical position of each item, but their order is the one pdf.js read out, with no global sort — so «left column first, then right» is not something this step can infer. Treat the output as raw material for such files; tidying it by hand is lighter than shipping a layout engine.

合同的 PDF 转成 Markdown,内容会被上传吗?If I turn a contract PDF into Markdown, is it uploaded?

不会。读 PDF 的 pdf.js、写 Markdown 的转换器都在扩展页面里跑,manifest 只有 storage 权限、没有 host 权限,产物里也没有把远端资源当代码执行的死路径;除了用户自己拖进来的文件,没有别的数据来源。No. pdf.js and the Markdown writer both run inside the extension page; the manifest carries the storage permission and no host permissions, and the bundle ships no path that executes remotely hosted code. Apart from the files you drop in, there is no other source of data.

不需要账号,也不需要联网:装好扩展后点图标,在新标签页里打开工作台,文件从磁盘直接选。No account and no network: install the extension, click its icon, and the workbench opens in a new tab reading straight off your disk.