Skip to content
Back to skills

Convert Pdf To Images

ASecurity

Imported skill convert_pdf_to_images from anthropic

  • 3 stars
  • 0 votes
  • 1 copy
  • 7 views
  • Added September 11, 2026
ai-agents

Security analysis

A100/100

Scanned September 11, 2026

npx -y skills add bitwikiorg/skills.md --skill convert_pdf_to_images --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Convert Pdf To Images?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Convert Pdf To Images
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/bitwikiorg-convert-pdf-to-images/badge)](https://www.skillsdirectory.com/skills/bitwikiorg-convert-pdf-to-images)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
description: Imported skill convert_pdf_to_images from anthropic
name: convert_pdf_to_images
signature: 095a0105a718af75ede309cb03f84a20c81d17f1727f7686fd4b294f1f40294f
source: /a0/tmp/skills_research/anthropic/skills/pdf/scripts/convert_pdf_to_images.py
---

import os
import sys

from pdf2image import convert_from_path


# Converts each page of a PDF to a PNG image.


def convert(pdf_path, output_dir, max_dim=1000):
    images = convert_from_path(pdf_path, dpi=200)

    for i, image in enumerate(images):
        # Scale image if needed to keep width/height under `max_dim`
        width, height = image.size
        if width > max_dim or height > max_dim:
            scale_factor = min(max_dim / width, max_dim / height)
            new_width = int(width * scale_factor)
            new_height = int(height * scale_factor)
            image = image.resize((new_width, new_height))
        
        image_path = os.path.join(output_dir, f"page_{i+1}.png")
        image.save(image_path)
        print(f"Saved page {i+1} as {image_path} (size: {image.size})")

    print(f"Converted {len(images)} pages to PNG images")


if __name__ == "__main__":
    if len(sys.argv) != 3:
        print("Usage: convert_pdf_to_images.py [input pdf] [output directory]")
        sys.exit(1)
    pdf_path = sys.argv[1]
    output_directory = sys.argv[2]
    convert(pdf_path, output_directory)

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.