تخطَّ إلى المحتوى

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 مخطط علامات مرجعية، تصبح تلك العلامات هي العناوين ويصبح عمقها مستوى العنوان، فلا يُخمَّن شيء. وحيث لا يوجد مخطط، يُرفَّع السطر إلى عنوان حين يكون أكبر من نص المتن المحيط به، وقصيرًا، ويتبعه نثر عادي. ولكل من المصدرين مفتاحه الخاص.
هل تُحوَّل الجداول؟
نعم، إلى جداول أنابيب في Markdown، حين يكون الكاشف واثقًا كفاية من الأعمدة. تُجمَّع المواضع من حافتَي النص معًا، فتُكتشف أعمدة الأرقام المحاذاة إلى اليمين كما تُكتشف المحاذاة إلى اليسار. وإن كانت الأرقام مكانها جدول بيانات، فأداة PDF إلى CSV هي الطريق الأفضل.
ماذا يحدث للصور في مستندي؟
تُترك خلفنا. فـ Markdown يشير إلى الصور ولا يحتويها، ونقلها معه يعني كتابة مجلد ملفات إلى جانب ملف .md، بينما ينتج التحويل ملفًا نصيًا واحدًا مكتفيًا بذاته.
ملف PDF عندي مسح ضوئي ولا يخرج منه شيء. لماذا؟
الصفحة الممسوحة ضوئيًا صورة للنص: لا توجد حروف يقرأها المحوّل، لذا تتوقف الأداة مع شرح بدل كتابة مستند فارغ. شغّل أداة OCR للـ PDF أولًا ثم حوّل.
هل يُرفع مستندي لتحويله؟
لا. يُستخرج النص في متصفحك ويُكتب Markdown فيه أيضًا، دون أي طلب خارجي في أي مرحلة. ويمكنك التحقق بدل التصديق: راقب تبويب الشبكة أثناء التحويل، أو اقطع الاتصال تمامًا وحوّل على أي حال.

أدوات ذات صلة