Skip to main content

pdf-book-assembler

Assemble book-style PDFs from one or more source PDFs using CLI PDF tools. Use when Codex needs to collate PDFs in a specific order, drop repeated cover/JSTOR pages, add chapter/section bookmarks, rotate landscape pages to portrait, or optionally crop shared whitespace proportionally across pages.

소스 정보

저장소
yananlong/codex-skills
최근 소스 활동
2026년 3월 20일 14:06
감지된 SKILL.md 언어
영어
스타
2
포크
0

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

파일 탐색기
4 개 파일

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
pdf-book-assembler
description
Assemble book-style PDFs from one or more source PDFs using CLI PDF tools. Use when Codex needs to collate PDFs in a specific order, drop repeated cover/JSTOR pages, add chapter/section bookmarks, rotate landscape pages to portrait, or optionally crop shared whitespace proportionally across pages.
# PDF Book Assembler ## Overview Build book-like PDFs with a command-line-first pipeline. This skill uses `pdfseparate`, `pdfunite`, `gs`, `pdfinfo`, and optionally `pdftoppm` for the PDF work; the bundled script only orchestrates those tools and computes crop margins. ## Use The Workflow 1. Inspect the source PDFs with `find`, `pdfinfo`, and, when needed, `pdftotext -layout`. 2. Determine the exact source order and any `drop_first_page`, `start_page`, or `end_page` rules. 3. Derive bookmark targets as output PDF pages after those page-selection rules are applied. 4. Write a JSON spec and run `scripts/build_pdf_book.py <spec.json>`. 5. Check the JSON summary, then verify page count and outline structure on the output PDF. ## Build The Spec Read [references/spec.md](references/spec.md) for the JSON shape and examples. Use `level: 1` for chapters and other top-level entries. Use `level: 2` for sections under the immediately preceding level-1 bookmark. Do not skip levels. Enable `normalize_portrait` when mixed-orientation pages should all read upright in portrait view. Enable `crop_whitespace` only when the page set has consistent margins. The script computes one common proportional crop across the nonblank pages; it is intentionally conservative. ## Run The Script From the skill directory: ```bash python3 scripts/build_pdf_book.py /path/to/spec.json ``` The script prints a JSON summary with: - `pages` - `rotated_pages` - `crop_margins` - `bookmark_count` - `page_map` Use `page_map` to confirm the merge order and the output-page offsets. ## Validate The Output Check page count with: ```bash pdfinfo /path/to/output.pdf ``` If bookmarks were added, spot-check the outline with a PDF viewer. For automated debugging or forward-testing, it is acceptable to inspect the resulting outline with local tooling after the CLI pipeline finishes. ## Constraints Prefer this skill when the job is fundamentally page-level PDF assembly and cleanup. Do not use this skill for form filling, OCR, or fine-grained PDF object editing that requires a library-level PDF editor.
GitHub에서 보기