/* 2026-12-04 性能:提前宣告关键脚本。app.js 原先只在 body 末尾出现, 浏览器要解析完整份 HTML 才会开始下载(首屏 HTML 约 35KB)。 preload 让下载与 HTML 解析并行,而 defer 语义不变(DOM 就绪后按序执行)。 */
EN

PDF to Word

Extract the text layer of a PDF into an editable .docx, keeping paragraphs, heading sizes and original page breaks — converted in your browser.

FAQ

Why does the layout break after converting to Word?

It follows from how the format works: a PDF records where each glyph sits, not which paragraph or table cell it belongs to, so multi-column pages, tables and mixed image-text blocks rebuild out of order. Start with Keep every line to get all the content across, then restyle inside Word; Smart mode gives the best result for prose such as reports and contracts.

Can a scanned PDF be converted?

No. A scan, or a PDF made by photographing a document, contains only images with no text layer, so there is nothing to extract. Test it by opening the file in a reader and trying to select a sentence - if nothing selects, it is a scan. Those files need OCR first, and this tool says so rather than producing an empty document.

Why do Chinese characters come out as question marks?

The fonts in the source PDF did not embed a ToUnicode map, so the mapping from character codes back to characters is missing and every extraction tool can only recover the codes themselves. It is common in files exported by some virtual printers and older office suites. Re-export from the original document, or run OCR first.

Is the file uploaded, and is there a page limit?

Nothing is uploaded - parsing and generation run locally in the browser and work offline, with no daily quota. There is no server-side page or size cap, but a few hundred pages consume a lot of memory and may stall a low-spec device, so split very large jobs into batches.

About this tool

Extracts the text layer of a PDF into an editable .docx. Text is read page by page with its coordinates, grouped into lines, then rebuilt into paragraphs from line spacing and font size; lines set in a noticeably larger font become bold headings, and the original page breaks are kept.

Parsing and generation both run in your browser, so the file is never uploaded.

What this can and cannot do, up front. A PDF stores where each glyph is drawn, not which paragraph or line it belongs to. Converting to Word means inferring that structure back, so the result is an approximate rebuild rather than a copy.

  • Kept: the text itself, paragraph order, original page breaks, and the size difference between headings and body text.
  • Lost: images, table borders, headers and footers, comments, form fields, bookmarks, footnote anchors.
  • May scramble: two-column pages are read top to bottom by coordinate, so columns interleave; vertical text, word art and formulas usually survive only as text or drop out.

Scans cannot be converted, and that is structural. A scanned page, or one produced by photographing a document, holds only images with no text layer. The quick test: open the PDF in any reader and try to select a sentence with the mouse - if nothing selects, it is a scan. Those files need OCR first, and this tool says so instead of handing you an empty document.

Why Chinese text sometimes comes out as question marks. CJK text in a PDF is usually stored as CID codes, and restoring characters depends on the ToUnicode map embedded in the font. If the software that produced the PDF did not embed that map (common with some virtual printers and older office suites), every extraction tool can only recover the codes themselves. The fix is the original source document or OCR - it is not something this page can patch.

Choosing a paragraph mode.

  • Smart (default): a new paragraph starts when line spacing jumps or the font size changes, which reads closest to the original. Good for reports, contracts and books.
  • Keep every line: every line break in the PDF becomes its own paragraph. Good for tables, code listings and price lists, where alignment carries meaning and Smart mode would fuse the rows together.

How paragraphs are inferred. Glyphs that share a baseline are clustered into a line; lines are then sorted by vertical position and adjacent baselines compared. A gap close to the median continues the paragraph, a clearly larger gap starts a new one, and an abrupt font size change also breaks it (the switch between heading, caption and body). The rules work well on prose and misread documents that fake paragraphs with table cells - by then the layout semantics are already gone and coordinates cannot recover them.

Why not use an online converter instead. Files handled here tend to be contracts, CVs, invoices and reports. Uploading them to a third-party server hands over the original; this runs entirely locally, works offline, and has no daily quota.

Limits worth knowing:

  • The ceiling is your RAM: no server-side page or size cap, but a few hundred pages consume a lot of memory and may stall a low-spec device. Split very large jobs into batches.
  • Password-protected PDFs must be unlocked first: the content streams stay encrypted, so extraction yields garbage or fails outright.
  • The output is a plain text document: no style sheet, no table of contents, no cross-references - apply whatever formatting you need inside Word.

The file is saved under the same name as the PDF with a .docx extension.