ข้ามไปยังเนื้อหา

PDF เป็น Markdown

แปลง PDF เป็น Markdown พร้อมกู้หัวข้อ รายการ และตารางกลับมา

ประมวลผลบนเครื่องของคุณ

เครื่องมือนี้ทำงานในเบราว์เซอร์ของคุณทั้งหมด ไฟล์ของคุณไม่ถูกอัปโหลดเลย และคุณตรวจสอบได้เองในแท็บเครือข่ายของเบราว์เซอร์ ตรวจสอบด้วยตัวเอง เปิดแท็บเครือข่ายของเบราว์เซอร์แล้วดู คุณจะเห็นคำขอเล็ก ๆ หนึ่งรายการที่ถามว่าคุณยังมีโควตางานเหลืออยู่หรือไม่ ซึ่งมีแค่ชื่อเครื่องมือกับค่าแฮช ไม่ใช่ตัวไฟล์

เครื่องมือนี้ทำอะไร

This reads a PDF's text and writes it out as Markdown, working out which lines are headings, where paragraphs begin and end, and which blocks are lists or tables. A PDF stores none of that - only characters at coordinates - so the structure is inferred from geometry, except where the document has a bookmark outline, which is used instead because it is the author's own account of the structure. The result is one .md file that re-flows; it does not reproduce the original pagination or layout.

Reach for it when a document has to become editable text again: a report going into a wiki, documentation that arrived as a PDF and now needs to live in a repository beside the code, or notes you would rather search and rewrite than scroll through.

วิธีทำงาน

  1. Drop the PDF onto this page. The first five pages are checked for a text layer, so a scan is caught before you download an empty file.
  2. Leave Use the bookmark outline on when the document has one. A real outline is more reliable than any guess made from type size.
  3. Choose what else to detect: headings where no bookmark covers them, lists, and tables written as Markdown pipe tables.
  4. Under advanced options, add a front matter block if the file is headed for a static site, and set a page range if you only want part of the document.
  5. Press Convert to Markdown. The .md file downloads on its own.

A line becomes a heading when it is set larger than the body text around it, is short, and is followed by prose - three conditions rather than one, because any of them alone promotes running heads and figure captions by mistake. Bookmarks override the lot, which is why a document with a proper outline converts noticeably better than one without.

Paragraphs are rebuilt by asking why each line ended. A line that runs to the right edge of its column was broken by the typesetter, so the next line is joined onto it; a line that stops short ended on purpose, so a new paragraph starts. Hyphens at a line end are rejoined only when the continuation begins with a lowercase letter, which is what stops Coca- and Cola being welded into a word that was never in the document.

Tables are the least certain part of the conversion. Column boundaries are found by clustering the horizontal positions of text runs, so a real table converts cleanly while a two-column page layout can occasionally be read as one.

Extraction runs through PDF.js in a Web Worker inside your browser. What would be uploaded here is the document's text, which is usually the confidential part. Nothing about the text is sent, and the one request a run makes asks whether you have tasks left - a tool name and a hash of the bytes.

สิ่งที่เครื่องมือนี้ทำไม่ได้

  • Images are not extracted. The output is text and structure only; if you want the pages as pictures, PDF to image is the tool for that.
  • Layout is not preserved. Columns, text boxes and absolute positioning collapse into a single reading order, which is what Markdown is for and what makes it re-flow.

คำถามที่คนมักถาม

เครื่องมือตัดสินอย่างไรว่าอะไรคือหัวข้อ
ถ้า PDF มีโครงบุ๊กมาร์ก บุ๊กมาร์กเหล่านั้นจะกลายเป็นหัวข้อ และความลึกของมันจะกลายเป็นระดับหัวข้อ จึงไม่มีการเดา ส่วนที่ไม่มีโครงบุ๊กมาร์ก บรรทัดจะถูกยกขึ้นเป็นหัวข้อเมื่อมันใหญ่กว่าเนื้อความรอบข้าง สั้น และตามด้วยข้อความปกติ ทั้งสองแหล่งมีสวิตช์เปิดปิดของตัวเอง
ตารางถูกแปลงด้วยไหม
แปลง โดยเขียนเป็นตารางแบบ pipe ของ Markdown เมื่อตัวตรวจจับมั่นใจในคอลัมน์มากพอ ตำแหน่งข้อความถูกจัดกลุ่มจากขอบทั้งสองด้าน คอลัมน์ตัวเลขที่ชิดขวาจึงถูกพบเช่นเดียวกับที่ชิดซ้าย ถ้าตัวเลขเหล่านั้นควรอยู่ในสเปรดชีต PDF เป็น CSV เป็นทางที่ดีกว่า
รูปภาพในเอกสารของฉันจะเป็นอย่างไร
ถูกทิ้งไว้ Markdown อ้างถึงรูปภาพแทนที่จะบรรจุมันไว้ในตัวเอง การนำรูปมาด้วยจึงหมายถึงการเขียนโฟลเดอร์ไฟล์ควบคู่ไปกับ .md แต่การแปลงนี้ให้ไฟล์ข้อความไฟล์เดียวที่สมบูรณ์ในตัวเองแทน
PDF ของฉันเป็นไฟล์สแกนแล้วไม่มีอะไรออกมาเลย เพราะอะไร
หน้าที่สแกนมาคือภาพถ่ายของข้อความ ไม่มีอักขระให้ตัวแปลงอ่าน เครื่องมือจึงหยุดพร้อมคำอธิบายแทนที่จะเขียนเอกสารเปล่า ให้ใช้ OCR PDF ก่อนแล้วค่อยแปลง
เอกสารของฉันถูกอัปโหลดเพื่อแปลงไหม
ไม่ ข้อความถูกดึงออกมาในเบราว์เซอร์ของคุณ และ Markdown ก็ถูกเขียนที่นั่นเช่นกัน โดยไม่มีคำขอออกนอกเครื่องในขั้นตอนใดเลย คุณตรวจสอบเองได้ไม่ต้องเชื่อคำพูด เปิดแท็บเครือข่ายดูระหว่างแปลง หรือตัดการเชื่อมต่อทั้งหมดแล้วแปลงก็ยังได้

เครื่องมือที่เกี่ยวข้อง