Tuesday, October 28, 2025

How to convert images to pdf using img2pdf in ubuntu operating system

Have you ever captured multiple screenshots from a video — maybe a tutorial, lecture, or online course — and wanted to combine them into one organized PDF?
In this guide, you’ll learn how to easily convert your VLC Media Player screenshots into a single, well-ordered PDF file using a simple command-line tool on Ubuntu.

This method is fast, reliable, and keeps your image quality intact — perfect for study notes, presentations, or archiving your learning material.



🧰 Step 1: Install img2pdf

img2pdf is a lightweight, open-source utility that converts image files directly into PDF format without compressing or distorting the original images.

Install it using:

Once installed, you’re ready to start working with your screenshots.


📂 Step 2: Navigate to Your Screenshot Folder

Go to the folder where VLC saved your screenshots:

cd /path/to/your/screenshots

To verify the files are there, run:

ls -lh

🧩 Step 3: Combine Screenshots into a PDF

To merge all screenshots into one PDF, run:

This command creates a file named video_screenshots.pdf in the same directory.


🧠 Step 4: Confirm the PDF File

To make sure the file was successfully created, run:

ls -lh video_screenshots.pdf

Example output:

-rw-r--r-- 1 user user 120M Oct 27 14:35 video_screenshots.pdf

🖥️ Step 5: Open the PDF

You can view your newly created PDF directly from the terminal:

This will open the file in your default PDF viewer.


⏱️ Step 6: Create the PDF in the Correct Time Order (Oldest → Newest)

If your screenshots aren’t named in order, or filenames got mixed up, you can arrange them by capture time before converting:

img2pdf $(ls -1tr *.png) -o video_screenshots.pdf

💡 Explanation:

  • ls -1t → sorts files by modification time (newest first)

  • -r → reverses the list (so oldest first)

  • img2pdf $(...) → merges images in that time order

✅ This ensures your PDF pages appear exactly in the sequence you captured them — ideal for video summaries or step-by-step learning notes.


🏁 Conclusion

And that’s it! 🎉
You’ve successfully combined your VLC video screenshots into a neatly organized, high-quality PDF — all from your Ubuntu terminal.

This workflow is perfect for:

Once you get the hang of it, you can even automate the process with a small script — making it just one command to turn all your video screenshots into a single, ready-to-share PDF.

No comments:

Post a Comment

Understanding the Agentic Capabilities of Gemini 3 Pro

If you thought the jump from Gemini 1.5 to 2.5 was significant, Google’s latest release might just redefine your expectations entirely. Offi...