Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation


GitHub Release GitHub Stars Java Script Environment

An interactive Linux Terminal simulator built entirely inside a PDF file using Adobe Acrobat JavaScript (AcroForms).

No installation, no internet, and no virtual machines required. Just open the PDF and start typing Linux commands!

🎥 Live Demo

Check out the full capabilities of Linux.pdf in action:

Linux pdf Demo

💻 Compatibility & Supported Readers

Since this project relies heavily on advanced Acrobat JavaScript (AcroForms), performance and functionality vary depending on the PDF reader you use:

(+) Fully Recommended (Best Experience)

  • Adobe Acrobat Reader (Desktop) - Smooth performance and 100% features support.
  • PDF-XChange Editor - Excellent script execution.
  • Firefox - It usually works correctly.

(-) Supported with Limitations (Browsers)

  • Modern Web Browsers (Chrome, Edge, Opera) - Will run the core simulation but you might experience slight rendering lag or minor feature restrictions eg. sending the command with Enter.

🛠️ How to Rebuild

In my experience, I used this method; there are other shorter methods, but this one is free :)

Step 1: LibreOffice Writer

  • From Form add:
    • Text Box, with name CommandLine (The inputs bar)
    • Push Button, with name SubmitButton (Enter button)
  • Design your file as you wish (im not good at it).

Step 2: Modify Terminal Hieght

In base.js you need to edit the TERMINAL_HEIGHT variable to the size of terminal you will make.

var TERMINAL_HEIGHT = 28; // 28 lines only in my case

Step 3: PDF-XChange Editor

  • Go to Form
  • Create Text, with properties:
    • Field Name: TerminalScreen
    • Read Only: Yes
    • Check Spelling: No
    • Multi Line: Yes
  • Click Document JavaScript > Add > Paste the code of base.js
  • Click Select Fields
  • Edit properties:
    • For TerminalScreen
      • Change Validation to Custom Action.
      • In Validation Action paste the code of process_command.js
    • For SubmitButton
      • Actions > Mouse Down > Add > Run a JavaScript
      • Actions > Mouse Down > Reset a Form > Deselect "TerminalScreen"
      • And paste the code of process_command.js

📋 Supported Commands

Currently, Linux.pdf supports a variety of core Unix commands:

  • ls - List directory contents (supports relative paths like ls folder/sub).
  • cd - Change directories (supports .. and deep path navigation).
  • pwd - Print current working directory.
  • touch / mkdir - Create files and directories dynamically in memory.
  • cat / head / tail - View and read simulated file contents.
  • echo - Display text or redirect output to files using >.
  • cp / mv - Copy, move, or rename items within the simulated filesystem.
  • rm / rmdir - Delete files or empty directories securely.
  • clear, help, whoami, uname, man.

📝 License

This project is open-source and available under the MIT License.

About

An interactive Linux Terminal simulator built entirely inside a PDF file

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages