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 |
rules/extraction.ko.md
View on GitHub# 텍스트·표·이미지 추출
> 보이는 대로가 아니라 만들어진 대로 읽습니다. 추출 품질은 그리기 연산자가 결정하고, 복구 방법은 그 연산자를 따라야 합니다.
## 1. 먼저 분류하기
어떤 추출을 실행하기 전에 `check`와 `info`가 문서를 분류합니다. 그 분류가 어떤 방법이 통하는지를 정합니다.
| 신호 | 분류 | 결과 |
|---|---|---|
| `pageText`가 쪽당 몇 글자 이상을 반환 | 디지털 텍스트 | 바로 추출. 모든 글자가 실제 문자 |
| 텍스트가 있는데 같은 쪽 `inkRatio`가 높음 | 스캔 배경 위의 텍스트 | 텍스트를 추출하고 배경은 장식으로 취급 |
| `pageText`가 거의 0이고 쪽에 잉크가 있음 | 스캔 | `ocr`만 글자를 만들 수 있음 |
| `FONT_NOT_EMBEDDED`와 `TYPE3_GLYPHS`가 함께 | 대체된 글꼴 | 추출 문자는 맞아도 화면은 틀릴 수 있음. 둘 다 보고 |
| 트레일러에 `/Encrypt` | 암호화 | `blocked ENCRYPTED`로 멈추고 암호를 요청 |
이미 텍스트 레이어가 있는 쪽에 OCR을 돌리지 마세요. 파일 크기가 두 배가 되고 실제 문자열 위에 조금 다른 두 번째 문자열이 얹혀 검색과 화면 낭독기가 깨집니다.
## 2. 텍스트 추출
```
engine.js text <file> [--pages 1-5] [--runs] [--json]
```
- 기본은 쪽마다 읽기 순서로 문서 전체 텍스트를 반환합니다.
- `--runs`는 위치·글꼴·크기와 함께 각 텍스트 표시 연산을 반환합니다. 문단이 두 단으로 나뉘거나, 머리글이 쪽마다 반복되거나, 표 셀이 한 줄처럼 보이지만 세 개의 run일 때 필요한 정보입니다.
- 읽기 순서는 화면 위치가 아니라 콘텐츠 스트림에서 옵니다. 잘못 만든 PDF는 오른쪽 단을 왼쪽 단보다 먼저 내보낼 수 있습니다. 순서가 이상하면 `--runs` 출력을 `y` 내림차순, `x` 오름차순으로 정렬해 줄을 직접 재구성합니다.
- 합자와 소프트 하이픈: 줄에서 끊긴 단어는 하이픈 없이 오거나 단어의 일부가 아닌 하이픈과 함께 옵니다. 줄바꿈에서 다시 붙이고, 다음 줄이 하이픈 없이 이어질 때만 끝 하이픈을 버립니다.
- run 안의 공백은 그대로입니다. 원본의 두 칸은 두 칸으로 남습니다. 사용자가 정리된 산문을 요청하지 않았다면 정규화하지 않습니다.
보고에 적을 한계:
- 텍스트가 벡터 외곽선이나 이미지 안에 그려진 쪽은 텍스트 레이어가 없습니다. 쪽 번호와 분류를 보고합니다.
- 추출이 성공해도 문자 인코딩이 틀릴 수 있습니다. `/ToUnicode` 맵이 깨진 PDF는 그럴듯해 보이는 쓰레기를 반환합니다. 선언된 언어의 문자 체계 밖 문자 비율이 높은지로 판별합니다.
## 3. 표 재구성
읽을 표 객체는 없습니다. 표는 규칙선과 그 안에 놓인 텍스트의 집합이고, 복구는 추론입니다.
1. 그려진 규칙선을 먼저 씁니다. `pageLines`가 각 선을 주고, `y`가 거의 같은 것을 가로 규칙으로, `x`가 거의 같은 것을 세로 규칙으로 묶고, 두 집합을 교차시켜 셀 격자를 얻습니다.
2. 규칙선이 없으면 텍스트 열로 대체합니다. `--runs`를 `x` 시작점으로 묶고 넓은 간격을 열 경계로 봅니다. 단순한 3열 청구서에는 통하고 병합된 머리글 행에서는 실패합니다.
3. 머리글 판별: 본문 행보다 셀이 짧고 글꼴 굵기나 크기가 다른 첫 행.
4. 어떤 행의 셀 수가 머리글과 다르면 그 사실을 명시해 마크다운을 냅니다. 병합 셀의 흔적이고 마크다운 표는 이를 표현하지 못합니다.
쓴 방법과 신뢰도를 밝힙니다. 경계를 추측한 격자는 가설입니다. 정확한 것처럼 내놓으면 사용자가 숫자가 안 맞을 때 알게 되는 거짓말이 됩니다.
## 4. 이미지
```
engine.js images <file> --out-dir <dir> [--min-size 64]
```
- 각 이미지는 표시 해상도가 아니라 저장 해상도로 추출합니다. 72 DPI로 참조된 300 DPI 스캔도 300으로 나옵니다.
- `--min-size`는 많은 생성기가 넣는 1×1 여백 이미지와 글머리 비트맵을 걸러냅니다. 임계값 아래는 장식이고 내용이 아닙니다.
- 마스크(부드러운 가장자리, 투명도)와 함께 그려진 이미지는 기본 이미지로 추출되고 마스크는 별도 객체라 적용되지 않습니다. 시각 충실도가 중요하면 쪽을 렌더합니다.
- 쪽 전체가 한 장의 이미지면 이전 OCR이 남긴 작은 텍스트 레이어가 있어도 스캔입니다.
## 5. 메타데이터와 구조
```
engine.js info <file>
```
쪽 수, 쪽 상자, 쪽별 회전, `documentAttributes`(제목·저자·주제·키워드·생성기·제작기·날짜), 양식 필드 수, 아웃라인 유무, 바이트 검사 플래그를 반환합니다. 추출 전에 계획을 정하는 데, 생성 후에 무엇이 쓰였는지 확인하는 데 씁니다.
양식 필드 값은 `listAnnotations`로 읽고 `setFieldValue`로 씁니다. 외형 스트림이 없는 필드도 값을 갖습니다. 외형을 다시 만들지 않고 채우면 읽기 프로그램은 값을 보여주지만 인쇄된 쪽에는 나오지 않습니다.
## Sources
> Checked 2026-11-13.
| Claim | Source |
|---|---|
| PDF 콘텐츠 스트림의 텍스트 연산자와 그 순서 | <https://opensource.adobe.com/dc-acrobat-sdk-docs/pdfstandards/PDF32000_2008.pdf> (ISO 32000-1 §9.4) |
| `/ToUnicode` 맵과 매핑 오류가 잘못된 문자를 낳는 이유 | <https://opensource.adobe.com/dc-acrobat-sdk-docs/pdfstandards/PDF32000_2008.pdf> (§9.10.3) |
| 규칙선 교차로 표를 복구하는 접근 | <https://github.com/jsvine/pdfplumber> (접근법만 참고, 구현은 독립) |
| 이미지 XObject의 해상도와 표시 크기 | <https://opensource.adobe.com/dc-acrobat-sdk-docs/pdfstandards/PDF32000_2008.pdf> (§8.9.5) |
### Evidence grade
추출 동작과 한계는 이 기기에서 생성 문서와 실제 문서로 엔진을 돌려 확인한 `LOCAL`입니다. 형식 수준의 주장은 `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: 197k | 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: 197k | 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: 197k | 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: 197k | Updated | Claude CodeCodex | Verified | Install |