pdf-to-report-workflow
하는 일
이 스킬은 명령줄 도구로 원본 PDF를 읽고 새 PDF 보고서를 만드는 처음부터 끝까지의 방법입니다. Python PDF 라이브러리를 쓸 수 없는 최소 환경이나 컨테이너에서 작업하는 사람에게 맞습니다.
사용하는 경우
- ✓기존 PDF의 내용을 꺼내 새 PDF 보고서를 만들어야 할 때.
- ✓여러 PDF 출처를 하나의 보고서로 합쳐야 할 때.
- ✓PyPDF2나 reportlab을 설치할 수 없고 추가할 수도 없는 경우.
스킬 링크
https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/pdf-verification-cli-enhanced-657992/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“이 세 PDF의 내용을 하나의 새 보고서 PDF로 합쳐 주세요. 여기서는 명령줄 도구만 쓸 수 있습니다.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
AI는 사용 가능한 도구를 확인하고, pdfinfo로 메타데이터를 읽고, pdftotext로 텍스트를 추출하며, 내용을 모아 pandoc이나 ps2pdf 같은 도구로 최종 PDF를 만듭니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
PDF-to-Report Generation Workflow
This skill provides a complete end-to-end workflow for processing PDF documents: extracting content from source PDFs, assembling report data, and generating new PDF output files—all using command-line tools when Python libraries are unavailable.
When to Use This Skill
- Need to extract text/content from existing PDFs
- Need to create new PDF reports from extracted data
- Need to combine multiple PDF sources into a single report
- PyPDF2, reportlab, or similar Python PDF libraries are unavailable
- Working in minimal/containerized environments
Core Tools
Extraction Tools (poppler-utils)
1. pdfinfo - Extract PDF Metadata
# Get full PDF info
pdfinfo document.pdf
# Get only page count
pdfinfo document.pdf | grep Pages
# Extract page count as a number
pdfinfo document.pdf | grep Pages | awk '{print $2}'
Key metadata fields:
Pages: Number of pages in the PDFTitle: Document titleAuthor: Document authorCreationDate: When the PDF was createdModDate: Last modification date
2. pdftotext - Extract Text Content
# Extract all text to stdout
pdftotext document.pdf -
# Extract text to a file
pdftotext document.pdf output.txt
# Extract text from specific page range
pdftotext -f 1 -l 3 document.pdf output.txt
# Preserve layout (rough formatting)
pdftotext -layout document.pdf output.txt
Generation Tools (Choose based on availability)
1. enscript + ps2pdf - Text to PDF (Recommended)
Convert plain text to PDF via PostScript:
# Install if needed
apt-get install -y enscript ghostscript
# Convert text file to PDF
enscript -B -o output.ps input.txt && ps2pdf output.ps output.pdf
# One-liner
enscript -B input.txt -o - | ps2pdf - output.pdf
Options:
-B: No borders-o: Output file (- for stdout)-f: Font specification (e.g.,-fCourier10)
2. wkhtmltopdf - HTML to PDF
Convert HTML to PDF with full formatting support:
# Install if needed
apt-get install -y wkhtmltopdf
# Convert HTML file to PDF
wkhtmltopdf input.html output.pdf
# Convert from stdin
echo "<html><body><h1>Report</h1></body></html>" | wkhtmltopdf - output.pdf
# With options for better quality
wkhtmltopdf --page-size A4 --margin-top 25mm input.html output.pdf
3. libreoffice - Document Conversion
Convert various document formats to PDF:
# Install if needed
apt-get install -y libreoffice-writer
# Convert to PDF (headless mode)
libreoffice --headless --convert-to pdf input.docx
libreoffice --headless --convert-to pdf input.odt
libreoffice --headless --convert-to pdf input.txt
4. pandoc - Universal Document Converter
Convert between many formats including PDF:
# Install if needed
apt-get install -y pandoc texlive-latex-base
# Convert markdown to PDF
pandoc input.md -o output.pdf
# Convert text to PDF
pandoc input.txt -o output.pdf
# With custom template
pandoc input.md --template=template.tex -o output.pdf
5. pdftk - PDF Manipulation
Merge, split, or modify existing PDFs:
# Install if needed
apt-get install -y pdftk
# Merge multiple PDFs
pdftk file1.pdf file2.pdf file3.pdf cat output merged.pdf
# Extract pages
pdftk input.pdf cat 1-3 output extracted.pdf
# Split into individual pages
pdftk input.pdf burst
Complete Workflow
Phase 1: Check Tool Availability
# Check extraction tools
which pdfinfo || echo "pdfinfo not found"
which pdftotext || echo "pdftotext not found"
# Check generation tools (at least one should be available)
which enscript || echo "enscript not found"
which wkhtmltopdf || echo "wkhtmltopdf not found"
which libreoffice || echo "libreoffice not found"
which pandoc || echo "pandoc not found"
Phase 2: Install Missing Tools
# Debian/Ubuntu - Full installation
apt-get update && apt-get install -y poppler-utils enscript ghostscript
# Or install wkhtmltopdf instead
apt-get install -y poppler-utils wkhtmltopdf
# Or install pandoc for markdown-based reports
apt-get install -y poppler-utils pandoc texlive-latex-base
Phase 3: Extract Content from Source PDFs
# Create working directory
mkdir -p workdir/extracted
cd workdir
# Extract text from each source PDF
for pdf in ../source_pdfs/*.pdf; do
filename=$(basename "$pdf" .pdf)
pdftotext -layout "$pdf" "extracted/${filename}.txt"
echo "Extracted: $filename"
done
# Verify extraction
for txt in ext
자주 묻는 질문
어떤 도구가 쪽수를 알려 주나요?
pdfinfo입니다. 쪽수와 다른 메타데이터를 보고합니다.
어떤 도구가 텍스트를 얻나요?
pdftotext입니다. 전체 텍스트나 특정 쪽 범위의 텍스트를 추출할 수 있습니다.
최종 PDF는 어떤 도구로 만드나요?
설치된 것에 따라 pandoc, wkhtmltopdf, enscript와 ps2pdf 같은 선택지가 있다고 가이드가 나열합니다.
상세 정보
작성자의 원본 설명
Complete PDF workflow: extract content from source PDFs and generate new PDF reports using command-line tools
repo: HKUDS/AgentPilot
인기도
- GitHub 스타
- 7.8k
- 순위
- #12938
- 라이선스
- MIT
- 업데이트
- 2026. 11. 1.
댓글
- …
이 저장소의 다른 스킬
agentpilot
7.8k작업을 준비하고 AgentPilot 루프를 실행해 변경을 제안, 테스트, 점수화하면서 프로젝트를 단계적으로 개선하도록 돕습니다.
openspace
7.8k에이전트 스킬을 저장하고 가져오는 도구인 OpenSpace를 설정하고, MCP를 통해 AI 앱에 연결하도록 돕습니다.
rsi-arena
7.8kAIME나 Terminal-Bench 같은 표준 AI 벤치마크 테스트를 설정하고 실행해 서로 다른 개선 방법을 비교하도록 돕습니다.
experiment-guide
7.8k프로그램을 개선하는 방법을 조사하면서 작은 실험을 계획하고, 결과를 읽고, 발견 사항을 기록하도록 돕습니다.
비슷한 스킬
feishu-doc
394k에이전트가 문서 도구를 사용해 텍스트, 이미지, 표를 포함한 Feishu 클라우드 문서를 읽고, 만들고, 편집하도록 돕습니다.
feishu-drive
394k에이전트가 봇과 공유된 Feishu 클라우드 폴더의 파일을 찾아보고, 정리하고, 댓글을 달도록 돕습니다.
feishu-perm
394k에이전트가 요청을 충족하는 가장 작은 권한을 골라, Feishu 파일에 누가 접근할 수 있는지 확인하고 바꾸도록 돕습니다.