ข้อความเป็น 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.
คำถามที่คนมักถาม
- บรรทัดที่ยาวเกินหน้ากระดาษจะเป็นอย่างไร
- ถ้าเปิดการตัดบรรทัด บรรทัดนั้นจะถูกพับลงบรรทัดถัดไป ย่อหน้าให้ตรงกับจุดเริ่มของบรรทัดเดิม และตัดที่ช่องว่างเมื่อมีให้ตัด ถ้าปิดไว้ บรรทัดจะถูกตัดทิ้งที่ขอบหน้า สิ่งที่คุณเห็นจึงเป็นหนึ่งบรรทัดบนหน้าต่อหนึ่งบรรทัดในไฟล์ และปลายของบรรทัดที่ยาวมากจะไม่ถูกแสดงเลย ปิดไว้เมื่อขอบเขตของบรรทัดมีความหมาย และเปิดไว้เมื่อความอ่านง่ายสำคัญกว่า
- ทำไมค่าเริ่มต้นถึงเป็นฟอนต์โมโนสเปซ
- เพราะฟอนต์โมโนสเปซเป็นแบบเดียวที่ทำให้คอลัมน์ตรงกัน และสิ่งที่คนส่วนใหญ่นำมาแปลงที่นี่ก็เป็นข้อมูลแบบคอลัมน์ ทั้งไฟล์ log ที่มีเวลาอยู่ซ้ายสุด ไฟล์ CSV ไฟล์ตั้งค่า และซอร์สโค้ดที่ย่อหน้าไว้ ถ้าใช้ฟอนต์ที่ความกว้างไม่เท่ากัน คอลัมน์เหล่านั้นจะเหลื่อมกันภายในไม่กี่บรรทัด ฟอนต์ซานส์และเซริฟมีให้เลือกไว้สำหรับไฟล์ที่เป็นร้อยแก้วจริง ๆ
- อักขระที่มีเครื่องหมายกำกับเสียงของฉันกลายเป็นสัญลักษณ์แปลก ๆ เพราะอะไร
- ไฟล์ถูกถอดรหัสเป็น UTF-8 ถ้าไฟล์ถูกบันทึกด้วยการเข้ารหัสแบบไบต์เดียวรุ่นเก่าอย่าง Windows-1252 หรือด้วยการเข้ารหัสภาษาญี่ปุ่น ไบต์ของอักขระเหล่านั้นจะไม่ใช่ UTF-8 ที่ถูกต้อง และจะถูกแทนที่แทนที่จะถูกเดา ให้บันทึกไฟล์ใหม่เป็น UTF-8 ในโปรแกรมแก้ไขของคุณแล้วแปลงอีกครั้ง ส่วนเครื่องหมายลำดับไบต์ถ้ามีจะถูกตัดออกให้อัตโนมัติ
- ฉันแปลงหลายไฟล์พร้อมกันได้ไหม
- ได้ สูงสุด 50 ไฟล์ในครั้งเดียว และแต่ละไฟล์จะกลายเป็น PDF ของตัวเองที่ตั้งชื่อตามไฟล์ต้นทาง การตั้งค่าหน้า ขนาดตัวอักษร การตัดบรรทัด และเลขบรรทัดใช้กับทุกไฟล์ โฟลเดอร์ของไฟล์ log จึงออกมาเหมือนกันทั้งชุด ส่วนช่องชื่อไฟล์ใช้ได้เฉพาะเมื่อคุณแปลงไฟล์เดียว
- ไฟล์ของฉันถูกอัปโหลดไหม
- ไม่ ไบต์ของไฟล์ถูกถอดรหัสและจัดหน้าใน Web Worker ภายในเบราว์เซอร์ของคุณ และไฟล์ PDF ถูกเขียนขึ้นที่นั่น คำขอเดียวที่หน้านี้ส่งออกคือการดึงฟอนต์ Noto จากโดเมนของเว็บไซต์นี้เอง และส่งเฉพาะเมื่อเปิดการฝังฟอนต์ Unicode เปิดแท็บเครือข่ายในเบราว์เซอร์แล้วลองแปลงดูได้ ถ้าคุณอยากตรวจสอบมากกว่าจะเชื่อคำเรา