نص إلى PDF
صُفّ ملف .txt أو .log أو .csv في صورة قائمة PDF.
تعمل هذه الأداة داخل متصفحك بالكامل. لا يُرفع ملفك أبدًا، ويمكنك التحقق من ذلك في تبويب الشبكة بمتصفحك. تحقّق بنفسك: افتح تبويب الشبكة في متصفحك وراقب. سترى طلبًا صغيرًا واحدًا يسأل إن كان لديك مهام متبقية — اسم أداة وبصمة تجزئة، وليس الملف أبدًا.
ماذا تفعل هذه الأداة
This sets a plain text file as a PDF, one line of the file to one line of the page. The defaults are those of a code listing rather than a letter - monospace, 10 pt, wrapping on - because almost nobody converts prose this way. People convert a log, a configuration file, a CSV or a source file, usually because something else insists on receiving it as an attachment or a printout.
Reach for it when a text file has to travel as a document: a log going onto a support ticket, a configuration file that has to sit in a change record, a CSV a colleague wants to read rather than open in a spreadsheet, or a source file heading for someone with nothing to open it in.
كيف تعمل
- Drop your .txt, .log, .csv or .md files onto this page. Up to 50 at a time, each up to 50 MB.
- Choose the typeface. Monospace is the default and is what keeps the columns of a log or a CSV lined up; sans and serif are there for the rare file that is actually prose.
- Set the type size and line spacing. 10 pt is the default; 8 pt fits noticeably more on a sheet and is worth it for a long log.
- Decide about long lines. Wrapping folds anything wider than the column so it stays visible; with wrapping off, an over-long line is clipped at the page edge instead, which is the honest rendering of a file whose lines are meant to be lines.
- Turn on line numbers if you expect to refer to a particular line, then press Convert.
- Each file downloads as its own PDF.
Wrapping is the one option that changes what the document means, which is why it is offered rather than decided for you. A folded long line stays readable but stops being one line, and anyone counting lines or diffing the output against the original will notice. An unwrapped line is truthful about the file and runs off the sheet. Both are right sometimes: wrap a log you want to read, leave it unwrapped for a file where line boundaries carry meaning.
When wrapping is on, the fold is done carefully. Tabs are expanded to four spaces before anything is measured, the continuation is indented to match the leading whitespace of the line it came from, and the break is preferred at a space so a long path or identifier is not cut in half mid-word. The number of characters that fit is worked out from the actual width of a monospace digit at your chosen size, not guessed.
Line numbers are padded to the width of the largest number in the file and followed by two spaces, so they form a straight column and the text stays aligned all the way down. They are drawn as part of the text rather than in a margin, which means they come with you when you copy a line out of the finished PDF. That is what you want when quoting a line to somebody, and not what you want if you are going to paste the listing back into an editor.
The file is decoded as UTF-8, and a byte-order mark at the start is stripped - a BOM is a mark, not a character, and left in place it renders as an invisible-width glyph at the top of the first page in some viewers. Bytes that are not valid UTF-8 become the replacement character rather than aborting the conversion, so a file saved in an older Windows or Japanese encoding will convert but will show damage where the accented characters were. Windows, Unix and classic Mac line endings are all recognised as breaks.
The embedded font is Noto Sans Mono or Noto Sans, subsetted to the characters your file actually uses, which is what keeps a converted log at tens of kilobytes rather than megabytes. It does not cover Chinese, Japanese, Korean, Arabic or Indic scripts. Turning embedding off falls back to Courier, Helvetica and Times, which are WinAnsi only, and there a replacement character comes out as a question mark.
ما لا تستطيع هذه الأداة فعله
- Chinese, Japanese, Korean, Arabic and Indic scripts are outside the embedded font's coverage, because the faces that would cover them are tens of megabytes each.
أسئلة يطرحها الناس
- ماذا يحدث للأسطر الأطول من الصفحة؟
- مع تفعيل الطيّ تُطوى إلى السطر التالي، مُزاحةً لتحاذي بداية السطر الأصلي ومقطوعةً عند مسافة إن وُجدت. ومع تعطيله تُقصّ عند حافة الصفحة، فيكون لكل سطر في الملف سطر واحد في الصفحة ولا يظهر الطرف البعيد من سطر شديد الطول إطلاقًا. عطّله حين تكون حدود الأسطر مهمة، وفعّله حين تكون سهولة القراءة هي المهمة.
- لماذا الخط ثابت العرض هو الافتراضي؟
- لأن الخط ثابت العرض هو الوحيد الذي يُبقي الأعمدة محاذية، ومعظم ما يحوّله الناس هنا عمودي: سجلات بطوابع زمنية على أحد الطرفين، وملفات CSV، وملفات إعدادات، وشيفرة مُزاحة. وفي خط متناسب تتباعد تلك الأعمدة خلال أسطر قليلة. أما الخطان غير المذيّل والمذيّل فمتاحان للملف الذي يكون نثرًا حقًا.
- خرجت المحارف ذات الحركات رموزًا غريبة. لماذا؟
- يُفكّ ترميز الملف على أنه UTF-8. فإن كان محفوظًا بترميز أحادي البايت أقدم مثل Windows-1252، أو بترميز ياباني، فبايتات تلك المحارف ليست UTF-8 صالحة وتُستبدل بدل أن تُخمَّن. أعد حفظ الملف بترميز UTF-8 في محررك وحوّل من جديد. أما علامة ترتيب البايتات، إن وُجدت، فتُزال تلقائيًا.
- هل أستطيع تحويل عدة ملفات دفعة واحدة؟
- نعم، حتى 50 في تمريرة واحدة، ويصبح كل منها ملف PDF مستقلًا باسم الملف المصدر. وتنطبق إعدادات الصفحة وحجم الخط والطيّ وأرقام الأسطر عليها جميعًا، فتخرج مجلد سجلات متسقًا. أما حقل اسم الملف فينطبق عند تحويل ملف واحد فقط.
- هل يُرفع ملفي؟
- لا. تُفكّ البايتات وتُنسَّق في عامل ويب داخل متصفحك ويُكتب ملف PDF هناك. والطلب الوحيد الذي ترسله هذه الصفحة هو طلب خط Noto من مصدر هذا الموقع نفسه، وذلك فقط حين يكون تضمين Unicode مفعّلًا. افتح تبويب الشبكة في متصفحك وحوّل شيئًا إن كنت تفضّل أن تتحقق بدل أن تصدّق قولنا.