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

Markdown إلى PDF

حوّل ملفات .md إلى PDF، مع إبقاء العناوين فهرسًا.

تتم المعالجة على جهازك

تعمل هذه الأداة داخل متصفحك بالكامل. لا يُرفع ملفك أبدًا، ويمكنك التحقق من ذلك في تبويب الشبكة بمتصفحك. تحقّق بنفسك: افتح تبويب الشبكة في متصفحك وراقب. سترى طلبًا صغيرًا واحدًا يسأل إن كان لديك مهام متبقية — اسم أداة وبصمة تجزئة، وليس الملف أبدًا.

ماذا تفعل هذه الأداة

This reads a Markdown file and lays it out as a PDF directly, without going through HTML on the way. Headings, lists, tables, block quotes, links and fenced code blocks all come across, and the headings also become a real PDF outline. Markdown has no pages of its own, so the pagination is created here rather than reproduced from anywhere - the paper size, margins and theme you pick are what decide where the breaks fall.

Use it when the reader has no Markdown reader: a README that has to go into a tender pack, meeting notes an editor wants as an attachment, a specification circulating for comment, or documentation you want on paper with a table of contents that works.

كيف تعمل

  1. Drop your .md or .markdown files onto this page. Up to 20 at a time, each up to 50 MB.
  2. Pick a theme. Plain sets 11 pt with 1.45 line spacing, Book loosens to 11.5 pt and 1.6 for something read end to end, and Technical tightens to 10 pt and 1.35 for reference material that gets scanned rather than read.
  3. Choose the paper size, orientation and margins. Normal margins are 56 points on every side.
  4. Leave bookmarks from headings on so the finished PDF opens with a working outline, and turn page numbers off if the document already numbers itself.
  5. Under advanced options, decide whether YAML front matter at the top of the file should supply the document title.
  6. Press Convert. Each file becomes its own PDF and the downloads start on their own.

The parser walks Markdown into the document model directly and never renders it to HTML first. That sounds like an implementation detail and is not: a Markdown-to-HTML-to-PDF route escapes the content twice, and every escaping bug in that round trip shows up later as a stray ampersand or a visible line-break tag in somebody's finished document. Going straight to the model means the text you wrote is the text that gets measured.

Headings become the PDF outline, which is the thing that makes a long Markdown document usable as a PDF at all. A forty-page specification without an outline is a scroll bar and nothing else. One hash through six become outline entries at the matching depth, so the structure you already have in the file is the navigation the reader gets, with no extra step and nothing to maintain separately.

GitHub-flavoured extensions are on, so tables, strikethrough, task lists and bare URLs behave the way they do on GitHub rather than being left as literal punctuation. Fenced code blocks are set in Noto Sans Mono at 92 per cent of the body size, on a tinted wash, and a block longer than the remaining space is split across pages with the wash redrawn rather than being pushed whole onto the next sheet. Long code lines are folded, with the continuation indented to match the line it came from and the break preferred at a space so an identifier is not cut in half.

Images referenced by the Markdown are not embedded, and raw HTML blocks are not rendered. A Markdown file points at its pictures by path or by URL rather than containing them, and going out to fetch one would be exactly the outbound request this tool exists not to make. Convert the pictures separately with Images to PDF and join the results with Merge PDF if they need to be in the same document.

The Book theme asks for a serif face, and it is worth knowing what that gets you. With Embed a Unicode font on, which is the default, there is no Noto Serif in the embedded set, so serif borrows the sans faces and what you actually gain is the looser leading and the larger type. Turn embedding off and the text really is set in Times Roman, at the cost of every character outside the WinAnsi range.

ما لا تستطيع هذه الأداة فعله

  • Images referenced by the Markdown are not embedded. Fetching them would mean an outbound request; convert them with Images to PDF and combine the results instead.
  • Raw HTML inside the Markdown is not rendered. Structure written as Markdown converts; structure written as HTML tags does not.

أسئلة يطرحها الناس

أي نكهة من Markdown تفهمها الأداة؟
CommonMark مع امتدادات GitHub: الجداول، والشطب، وقوائم المهام، والعناوين المجردة التي تتحول إلى روابط. وتُعالَج العناوين والقوائم المرقّمة وغير المرقّمة والقوائم المتداخلة والاقتباسات والخطوط الأفقية والشيفرة داخل السطر وكتل الشيفرة المسوّرة. أما مقدمة YAML أعلى الملف فتُقرأ عنوانًا للمستند حين يكون ذلك الخيار مفعّلًا، بدل طباعتها كجدول.
هل تصبح عناويني جدول محتويات؟
نعم. مع تفعيل الإشارات المرجعية من العناوين، تصبح العناوين من علامة شبّاك واحدة إلى ست مداخلَ في فهرس ملف PDF بالعمق المقابل، فيحصل القارئ على لوحة تنقّل مبنية من البنية الموجودة في ملفك أصلًا. فلا شيء يُضاف إلى Markdown ولا شيء يُحدَّث يدويًا.
لماذا الصور في ملف Markdown مفقودة؟
لأن ملف Markdown يشير إلى صوره بدل أن يحتويها، وجلبها يعني أن هذه الصفحة سترسل طلبًا نيابة عنك - وهو الشيء الوحيد الذي ترفضه كل أداة هنا. أما النص والجداول والقوائم والروابط والشيفرة فتُحوَّل كلها. وإن كانت الصور مهمة، فمرّرها عبر أداة صور إلى PDF واجمع المستندين بأداة دمج PDF.
كيف تُصفّ كتل الشيفرة المسوّرة؟
بخط Noto Sans Mono بنسبة 92 بالمئة من حجم المتن، على خلفية ملوّنة خفيفة، مع توسيع علامات الجدولة إلى أربع مسافات قبل قياس أي شيء. والسطر الأعرض من العمود يُطوى لا يُقصّ، ويُزاح تكملته لتحاذي السطر الذي جاءت منه، ويفضّل الطيّ أن يقع عند مسافة كي يبقى المعرّف الطويل قطعة واحدة.
هل يُرفع مستندي لتحويله؟
لا. يُفكّ ترميز الملف ويُحلَّل ويُنسَّق في عامل ويب داخل متصفحك، ويُكتب ملف PDF هناك أيضًا. والشيء الوحيد الذي تجلبه هذه الصفحة إطلاقًا هو خط Noto من مصدر هذا الموقع نفسه، وبعد أن يخزّنه متصفحك يعمل التحويل والاتصال مُطفأ.

أدوات ذات صلة