pdf-compressor

Compress large PDF files by resizing pages and optimizing images.

345|12|Updated Apr 14, 2026
One-click install
npx skills add https://github.com/minicoohei/ai-agent-camp --skill pdf-compressor
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pdf-compressor
Source: https://github.com/minicoohei/ai-agent-camp/tree/main/.claude/skills/pdf-compressor
Command: npx skills add https://github.com/minicoohei/ai-agent-camp --skill pdf-compressor

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pdf2image, Pillow, img2pdf, and includes scripts (resource) components.

What problem does it solve?

Compress large PDFs by converting pages to optimized images and recombining them into a smaller document, saving bandwidth and storage.

Core Features & Use Cases

  • Resize pages to a target width while preserving aspect ratio.
  • Re-encode pages as JPEGs with a configurable quality to reduce size.
  • Ideal for web sharing, email attachments, and archiving large reports or manuals.

Quick Start

Provide the PDF path and run the script to compress it with default settings.

Frequently Asked Questions about pdf-compressor

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I compress a large PDF file for email attachments?

Compress a large PDF by converting its pages to optimized JPEG images and recombining them into a smaller document. This method significantly reduces file size for email attachments and web sharing.

What is the best way to resize PDF pages for web sharing?

The best way to resize PDF pages for web sharing is to adjust page width while preserving aspect ratio and re-encoding pages as JPEGs. This optimization ensures smaller file sizes for faster online distribution.

Do I need Python and specific libraries to compress PDFs?

Yes, you need Python and the pdf2image, Pillow, and img2pdf libraries to compress PDFs. These dependencies convert PDF pages to images, optimize them, and rebuild the smaller output file.

Can I control the JPEG quality when optimizing PDFs?

You can control JPEG quality during PDF compression to balance file size and visual clarity. Re-encoding pages as JPEGs with configurable quality settings allows precise optimization for archiving large reports.

Does compressing PDFs with image conversion preserve the original layout?

Compressing PDFs by converting pages to images preserves the visual layout by maintaining the original aspect ratio during resizing. The process rebuilds the document as a sequence of optimized page images.

Why are my PDF files still large after basic compression?

PDF files remain large when images are not properly optimized or resized. Converting pages to JPEGs with a target width and configurable quality reduces file size by re-encoding embedded images efficiently.