Langsung ke konten
Skillpedia
PDF, Word & slide7.8k Β· #12939

pdf-report-workflow-cli

Fungsinya

Skill ini adalah alur kerja yang hanya menggunakan baris perintah untuk membangun laporan PDF dari file sumber. Skill ini cocok untuk orang yang bekerja di container atau pengaturan CI tanpa pustaka PDF Python.

Kapan dipakai

  • βœ“Saat pustaka PDF Python tidak tersedia di lingkungan.
  • βœ“Saat saya membangun alur dokumen di dalam container atau pekerjaan CI.
  • βœ“Saat saya perlu menggabungkan konten PDF yang sudah diverifikasi menjadi laporan baru.

Link skill

https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/pdf-verification-cli-enhanced/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/pdf-verification-cli-enhanced/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit β†’

Contoh permintaan ke AI

β€œBuat laporan PDF dari PDF sumber saya di container ini. Hanya alat baris perintah yang terpasang, jadi tolong gunakan itu.”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

AI memeriksa alat PDF yang ada, memverifikasi file sumber, mengekstrak teksnya, menyusun laporan, dan menghasilkan PDF keluaran dengan alat yang tersedia.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

PDF Report Generation with Command-Line Tools

When working with PDFs in minimal/containerized environments where Python libraries may be unavailable, this skill provides a complete end-to-end workflow: verify source PDFs, extract content, assemble structured reports, and generate final PDF output.

When to Use This Skill

  • Need to create new PDF reports from existing PDF sources
  • Need to verify, extract, and combine PDF content
  • Working in environments without Python PDF libraries
  • Building document assembly pipelines in CI/CD or containers

Complete Workflow Overview

[Source PDFs] β†’ [Verify] β†’ [Extract] β†’ [Assemble] β†’ [Generate Output PDF]

Phase 1: Tool Availability Check

# Core extraction tools (from poppler-utils)
which pdfinfo && echo "βœ“ pdfinfo available" || echo "βœ— pdfinfo missing"
which pdftotext && echo "βœ“ pdftotext available" || echo "βœ— pdftotext missing"

# PDF generation tools (choose based on availability)
which pdftk && echo "βœ“ pdftk available (PDF merging)" || true
which wkhtmltopdf && echo "βœ“ wkhtmltopdf available (HTMLβ†’PDF)" || true
which pandoc && echo "βœ“ pandoc available (document conversion)" || true
which enscript && echo "βœ“ enscript available (textβ†’PS)" || true
which ps2pdf && echo "βœ“ ps2pdf available (PSβ†’PDF)" || true

Install Required Tools

# Debian/Ubuntu - Core tools
apt-get update && apt-get install -y poppler-utils

# Optional: PDF generation tools (choose based on needs)
apt-get install -y pdftk          # PDF merging/manipulation
apt-get install -y wkhtmltopdf    # HTML to PDF
apt-get install -y pandoc         # Document conversion
apt-get install -y enscript ghostscript  # Text to PDF pipeline

# RHEL/CentOS/Fedora
yum install -y poppler-utils pdftk ghostscript
# or
dnf install -y poppler-utils pdftk ghostscript

# macOS (with Homebrew)
brew install poppler pdftk ghostscript
brew install --cask wkhtmltopdf  # GUI app, includes CLI

Phase 2: Verify Source PDFs

Check Page Count and Metadata

# Verify each source PDF exists and is readable
for pdf in source1.pdf source2.pdf source3.pdf; do
    if [ ! -f "$pdf" ]; then
        echo "ERROR: $pdf not found"
        exit 1
    fi
    
    pages=$(pdfinfo "$pdf" | grep Pages | awk '{print $2}')
    echo "$pdf: $pages pages"
done

Validate Content Presence

# Check that required sections exist in source documents
REQUIRED_TERMS=("checklist" "summary" "references")

for term in "${REQUIRED_TERMS[@]}"; do
    if pdftotext source.pdf - | grep -qi "$term"; then
        echo "βœ“ Found: $term"
    else
        echo "⚠ Missing: $term"
    fi
done

Phase 3: Extract Content from Source PDFs

Extract Text to Temporary Files

# Create working directory
WORK_DIR=$(mktemp -d)
echo "Working directory: $WORK_DIR"

# Extract text from each source PDF
for i in source1.pdf source2.pdf source3.pdf; do
    base=$(basename "$i" .pdf)
    pdftotext -layout "$i" "$WORK_DIR/${base}.txt"
    echo "Extracted: $i β†’ ${base}.txt"
done

# Also extract metadata for reference
pdfinfo source1.pdf > "$WORK_DIR/source1_metadata.txt"

Extract Specific Sections (Optional)

# Extract only specific page ranges
pdftotext -f 1 -l 3 source1.pdf "$WORK_DIR/source1_pages1-3.txt"

# Extract and filter for specific content
pdftotext source1.pdf - | grep -A 10 "Summary" > "$WORK_DIR/summary_section.txt"

Phase 4: Assemble Report Content

Create Structured Report (Markdown Format)

REPORT_MD="$WORK_DIR/report.md"

cat > "$REPORT_MD" << 'REPORT_HEADER'
# New Case Creation Report

**Generated:** $(date '+%Y-%m-%d %H:%M:%S')

---

## Executive Summary

REPORT_HEADER

# Add content from extracted sources
echo "## Case Details" >> "$REPORT_MD"
echo "" >> "$REPORT_MD"
cat "$WORK_DIR/source1.txt" >> "$REPORT_MD"
echo "" >> "$REPORT_MD"

echo "## Supporting Documentation" >> "$REPORT_MD"
echo "" >> "$REPORT_MD"
cat "$WORK_DIR/source2.txt" >> "$REPORT_MD"
echo "" >> "$REPORT_MD"

echo "## References" >> "$REPORT_MD"
echo "" >> "$REPORT_MD"
cat "$WORK_DIR/source3.txt" >> "$REPORT_MD"

echo "Report assembled: $REPORT_MD"

Create HTML Report (Alternative for Better Formatting)

REPORT_HTML="$WORK_DIR/report.html"

cat > "$REPORT_HTML" << 'HTML_HEADER'
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Case Creation Report</title>
    <style>
        body { font-family: Arial, sans-serif; margin: 40px; }
        h1 { color: #333; borde
Pertanyaan umum

Paket apa yang terlibat?

Panduan ini mengandalkan poppler-utils untuk membaca PDF, serta alat seperti pandoc untuk keluaran.

Mengapa alat diperiksa lebih dulu?

Panduan ini menunjukkan alat mana yang tersedia sehingga jalur yang tepat dipakai.

Apakah perlu Python?

Alur kerja ini dibangun di atas alat baris perintah, sehingga pustaka Python tidak diperlukan.

Detail

Deskripsi asli dari pembuat

Complete PDF workflow: verify, extract content, assemble reports, and generate output PDFs using command-line tools

repo: HKUDS/AgentPilot

Popularitas

Bintang GitHub
7.8k
Peringkat
#12939
Lisensi
MIT
Diperbarui
1/11/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa