hashgraph-online/awesome-codex-plugins / plugins/alpoxdev/hypercore/skills/hyper-pdf
hyper-pdf
VerifiedUse this skill when the user asks to read, extract from, or produce a PDF - text, tables, images, metadata, form fields, OCR of a scan, merge, split, rotate, watermark, encrypt, or a Korean contract, invoice, or report - and wants the result verified rather than assumed. Two generation paths with an explicit routing rule, a zero-dependency macOS runtime, and checks for font embedding, language tag, and structure tree. Do not use for Word or HWP documents, screenshots, slide decks, or numeric charts.
| File | Kind | Size |
|---|---|---|
| SKILL.ko.md | markdown | 14.9 KB |
| SKILL.md | skill md | 14.3 KB |
| assets/evals/hyper-pdf-cases.jsonl | other | 14.2 KB |
| assets/runtime/compose.js | script | 13.0 KB |
| assets/runtime/engine.js | script | 32.2 KB |
| assets/runtime/native.js | script | 35.4 KB |
| references/commands.ko.md | markdown | 9.9 KB |
| references/commands.md | markdown | 9.5 KB |
| references/layout-spec.ko.md | markdown | 8.2 KB |
| references/layout-spec.md | markdown | 7.6 KB |
| rules/accessibility.ko.md | markdown | 5.3 KB |
| rules/accessibility.md | markdown | 4.9 KB |
| rules/extraction.ko.md | markdown | 6.1 KB |
| rules/extraction.md | markdown | 5.6 KB |
| rules/html-to-pdf.ko.md | markdown | 6.6 KB |
| rules/html-to-pdf.md | markdown | 6.1 KB |
| rules/korean-typesetting.ko.md | markdown | 5.8 KB |
| rules/korean-typesetting.md | markdown | 5.5 KB |
| rules/ocr.ko.md | markdown | 4.0 KB |
| rules/ocr.md | markdown | 3.7 KB |
| rules/research-notes.ko.md | markdown | 8.1 KB |
| rules/research-notes.md | markdown | 7.9 KB |
| rules/verification.ko.md | markdown | 3.9 KB |
| rules/verification.md | markdown | 3.8 KB |
references/layout-spec.ko.md
View on GitHub# 레이아웃 스펙 레퍼런스
> `build` 경로는 JSON 파일 하나를 받아 브라우저 없이 PDF 하나를 만듭니다. 쪽에 보이는 모든 것은 이 객체에서 오므로, 문서화하지 않은 필드는 호출자가 잘못 추측하는 필드입니다.
## 목차
1. [문서 루트](#1-문서-루트)
2. [블록](#2-블록)
3. [서명 블록](#3-서명-블록)
4. [예시](#4-예시)
5. [조판기 한계](#5-조판기-한계)
## 1. 문서 루트
| 필드 | 타입 | 기본값 | 의미 |
|---|---|---|---|
| `page.width` | 숫자, pt | `595.28` | 쪽 너비(A4) |
| `page.height` | 숫자, pt | `841.89` | 쪽 높이(A4) |
| `page.margin` | 숫자, pt | `56.7` | 네 변 여백(20 mm) |
| `fontSize` | 숫자, pt | `11` | 블록이 물려받는 기준 크기 |
| `font` | 경로 문자열 | `null` | 쓸 글꼴 파일. `null`이면 `resolveFont`가 한글 가능 기본값을 고름 |
| `lang` | 문자열 | `null` | 카탈로그 `/Lang`에 기록할 BCP 47 태그 |
| `header` | 문자열 | `null` | 반복 머리글. 본문 상자 위 왼쪽 여백에 그려짐 |
| `footer` | 문자열 | `null` | 반복 바닥글. 본문 상자 아래 왼쪽 여백에 그려짐 |
| `pageNumbers` | 불리언 | `true` | 바닥글 영역 가운데에 쪽 번호를 그림 |
| `blocks` | 배열 | `[]` | 위에서 아래로 그릴 내용 |
| `signature` | 객체 | `null` | 마지막 블록 뒤에 붙는 서명 블록 |
단위는 전부 포인트입니다. 1 mm = 2.8346 pt이므로 20 mm는 56.7 pt입니다. 여백 값은 하나뿐이고, 위아래와 좌우가 다른 문서는 `spacer` 블록으로 차이를 만듭니다.
## 2. 블록
모든 블록은 `type`을 가집니다. 모르는 `type`은 `paragraph`로 떨어지므로 오타가 실패 대신 텍스트를 그립니다. 출력에 의도한 블록이 있는지 확인하세요.
### `heading`
| 필드 | 타입 | 기본값 | 의미 |
|---|---|---|---|
| `text` | 문자열 | `''` | 제목 글. 본문 폭에서 줄바꿈됨 |
| `level` | 정수 1–5 | `1` | `size`가 없을 때 22/17/14/12/11 pt 중 고름 |
| `size` | 숫자 | level에 따름 | 크기 직접 지정 |
| `keepWithNext` | 불리언 | `false` | 줄 높이 2.2배를 예약해 쪽 끝에 홀로 남지 않게 함 |
| `rule` | 불리언 | `false` | 제목 아래에 실선을 그림 |
제목은 쪼개지지 않습니다. 들어가지 않으면 통째로 다음 쪽으로 갑니다.
### `paragraph`
| 필드 | 타입 | 기본값 | 의미 |
|---|---|---|---|
| `text` | 문자열 | `''` | 본문 |
| `size` | 숫자 | 문서 `fontSize` | 글자 크기 |
| `leading` | 숫자 | `size × 1.65` | 베이스라인 사이 거리 |
| `indent` | 숫자 | `0` | 본문 여백에서 왼쪽 들여쓰기 |
| `color` | `[r,g,b,a]` 0–1 | 거의 검정 | 글자 색 |
문단은 줄 사이에서 끊기고 줄 안에서는 끊기지 않으므로 쪽 경계를 넘어 이어질 수 있습니다. 1.65 기본값은 한국어에서 편한 범위이고, 1.5는 한글에서 답답해 보입니다.
### `list`
| 필드 | 타입 | 기본값 | 의미 |
|---|---|---|---|
| `items` | 문자열 배열 | `[]` | 항목마다 하나 |
| `ordered` | 불리언 | `false` | `•` 대신 번호 표시 |
| `size` | 숫자 | 문서 `fontSize` | 글자 크기 |
표시는 여백에 서고 글은 16 pt 들여 씁니다. 항목과 이어지는 줄은 쪽 사이에서 쪼개지지 않습니다.
### `table`
| 필드 | 타입 | 기본값 | 의미 |
|---|---|---|---|
| `header` | 문자열 배열 | `null` | 머리글 행. 쪽을 넘을 때 이것이 반복됨 |
| `rows` | 문자열 배열의 배열 | `[]` | 본문 행 |
| `columns` | 정수 | 머리글 길이 | `header`가 없을 때의 열 수 |
| `widths` | 숫자 배열 | 균등 | 절대 폭이 아니라 상대 열 가중치 |
| `size` | 숫자 | `fontSize − 1` | 셀 글자 크기 |
스펙을 쓰기 전에 알아야 할 동작:
- 열 폭은 비례합니다. `widths: [3,1,2]`는 본문 폭을 3:2:1로 나눕니다.
- 셀은 줄바꿈되고 행 높이는 그 행에서 가장 높은 셀을 따릅니다.
- 행이 들어가지 않으면 새 쪽에 머리글 행을 다시 그리고 그 행이 따라갑니다. 행은 쪼개지지 않습니다.
- 격자: 모든 행에서 열 경계마다 세로 실선, 머리글 행 아래 가로 실선, 마지막 행 아래 닫는 실선 하나. 금액 표의 모든 행을 상자로 두르면 잡음으로 읽히므로 전면 격자는 쓰지 않습니다.
- 머리글 셀은 0.93 회색으로 채웁니다.
### `keyValue`
| 필드 | 타입 | 기본값 | 의미 |
|---|---|---|---|
| `pairs` | `[label, value]` 배열 | `[]` | 라벨은 여백에 회색으로, 값은 `labelWidth` 위치에 |
| `size` | 숫자 | 문서 `fontSize` | 글자 크기 |
| `labelWidth` | 숫자 | `min(160, 폭의 34%)` | 라벨 열 폭 |
계약서의 당사자 블록, 청구서의 청구 정보, 보고서 표지의 메타데이터에 쓰는 기본 블록입니다.
### `rule`
필드 없음. 본문 폭 가로 실선과 위아래 18 pt 여백.
### `spacer`
| 필드 | 타입 | 기본값 | 의미 |
|---|---|---|---|
| `height` | 숫자 | `12` | 포인트 단위 세로 간격 |
### `pageBreak`
필드 없음. 현재 쪽을 닫고 위 여백에서 새 쪽을 엽니다.
## 3. 서명 블록
| 필드 | 타입 | 의미 |
|---|---|---|
| `label` | 문자열 | 서명 영역 위에 그리는 선(보통 날짜) |
| `lines` | 문자열 배열 | 서명자마다 한 줄, 예: `"갑: 주식회사 코드 (인)"` |
블록이 아니라 루트 필드입니다. `blocks` 뒤에 항상 마지막으로 그려지고, 넘치지 않게 줄 높이 다섯 배를 예약합니다.
## 4. 예시
```json
{
"page": {"margin": 70.9},
"fontSize": 10,
"lang": "ko-KR",
"header": "주식회사 코드",
"footer": "대외비",
"blocks": [
{"type": "heading", "text": "용역 계약서", "level": 1, "rule": true},
{"type": "keyValue", "pairs": [
["계약번호", "KD-2026-1113"],
["계약일", "2026년 11월 13일"],
["갑", "주식회사 코드 (대표 양민열)"],
["을", "홍길동"]
]},
{"type": "spacer", "height": 20},
{"type": "heading", "text": "제1조 (목적)", "level": 3, "keepWithNext": true},
{"type": "paragraph", "text": "이 계약은 갑이 을에게 의뢰하는 소프트웨어 개발 용역의 범위와 조건을 정한다.", "leading": 17},
{"type": "table",
"header": ["항목", "수량", "단가", "금액"],
"rows": [["설계", "1", "3,000,000", "3,000,000"], ["구현", "1", "5,000,000", "5,000,000"]],
"widths": [4, 1, 2, 2]},
{"type": "pageBreak"},
{"type": "heading", "text": "제2조 (대금 지급)", "level": 3}
],
"signature": {"label": "2026년 11월 13일", "lines": ["갑: 주식회사 코드 (인)", "을: 홍길동 (인)"]}
}
```
## 5. 조판기 한계
| 한계 | 내용 |
|---|---|
| 이미지 없음 | 이미지 블록이 없습니다. 로고나 차트가 필요한 문서는 `html` 경로를 씁니다 |
| 중첩 없음 | 블록은 평면 목록이고 표 안에 목록을 넣을 수 없습니다 |
| 단 나눔 없음 | 쪽당 텍스트 단은 하나입니다 |
| 절대 배치 없음 | 내용은 위에서 아래로 흐르고 블록별 `x`/`y`가 없습니다 |
| 스타일 상속 없음 | 블록마다 `size`를 적습니다. 문서 `fontSize` 외에는 상속이 없습니다 |
| 머리글 변수 없음 | `header`와 `footer`는 고정 문자열이고 쪽 번호는 별도 자동 요소입니다 |
하나라도 필요하면 `html`로 가는 이유입니다. `build`를 고르고 작업 중간에 로고가 없다는 걸 알면 조정이 아니라 다시 쓰기입니다.
## Sources
> Checked 2026-11-13.
| Claim | Source |
|---|---|
| A4의 포인트 값(595.28 × 841.89) | <https://www.iso.org/standard/71690.html> (ISO 216) |
| 한국어에서 편한 줄 높이 범위 | <https://www.w3.org/TR/klreq/> |
| 줄바꿈에 쓰는 CoreText 줄 제안 | <https://developer.apple.com/documentation/coretext/cttypesetter> |
| CGContext 그리기와 텍스트 행렬 | <https://developer.apple.com/documentation/coregraphics/cgcontext> |
### Evidence grade
모든 필드·기본값·한계는 `LOCAL`입니다. `assets/runtime/compose.js`에서 읽고 이 기기에서 문서를 만들어 실행했습니다. 표준 쪽 규격은 `SPEC`입니다.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| canvas-designanthropics/skillsCreate beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| docxanthropics/skillsUse this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include: any mention of 'Word doc', 'word document', '.docx', '.dotx', or requests to produce professional documents with formatting like tables of contents, headings, page numbers, or letterheads. Also use when extracting or reorganizing content from .docx or .dotx files, inserting or replacing images in documents, performing find-and-replace in Word files, working with tracked changes or comments, or converting content into a polished Word document. If the user asks for a 'report', 'memo', 'letter', 'template', or similar deliverable as a Word or .docx file, use this skill. Do NOT use for PDFs, spreadsheets, Google Docs, or general coding tasks unrelated to document generation. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| pdfanthropics/skillsUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs, extracting images, and OCR on scanned PDFs to make them searchable. If the user mentions a .pdf file or asks to produce one, use this skill. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| pptxanthropics/skillsUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an email or summary); editing, modifying, or updating existing presentations; combining or splitting slide files; working with templates (.potx), layouts, speaker notes, or comments. Trigger whenever the user mentions "deck," "slides," "presentation," or references a .pptx or .potx filename, regardless of what they plan to do with the content afterward. If a .pptx or .potx file needs to be opened, created, or touched, use this skill. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |