一键导入
extract-pdf-text-on-macos-with-pypdf
Extract text from a local PDF on macOS when native Spotlight metadata is insufficient, using python3 and pypdf.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Extract text from a local PDF on macOS when native Spotlight metadata is insufficient, using python3 and pypdf.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Apply senior UI/UX judgment to interfaces, user flows, interaction details, and product usability decisions.
Build, review, and extend Astro static sites — config, integrations, SEO, deployment to GitHub Pages.
Design system, visual language, tone, and UI conventions for comtechconsulting.dk — reference before adding any new UI, copy, or page to the site.
Apply senior-level engineering judgment to code review, implementation, debugging, refactoring, and delivery planning.
Advise on Confluence Cloud AI — Atlassian Intelligence, Rovo Chat, Rovo Chat macro, plan tier detection, and space-level AI scoping.
Configure and surface Rovo AI features in Confluence Cloud — Chat, custom Agents, Space Agent assignment, and space homepage CTA patterns.
基于 SOC 职业分类
| name | extract-pdf-text-on-macos-with-pypdf |
| description | Extract text from a local PDF on macOS when native Spotlight metadata is insufficient, using python3 and pypdf. |
| version | 1.0.1 |
| tags | ["pdf","text-extraction","macos","python","pypdf"] |
| tool_agnostic | true |
| authors | ["Anders Hybertz"] |
| tested_on | [] |
Use this when a user provides a local PDF path and you need readable text in the CLI.
mdls shows page count but kMDItemTextContent is null or incompletepdftotext is not installedpython3 - <<'PY'Path(...).exists() and stat().st_sizeshutil.which('pdftotext')pypdfpypdf is missing, install it for the current user:
python3 -m pip install --user pypdfPdfReader and write a sidecar text file next to the PDF or in Downloads..txt file in chunks for analysis.from pathlib import Path
from pypdf import PdfReader
p = Path('/path/to/file.pdf')
reader = PdfReader(str(p))
out = p.with_suffix('.txt')
chunks = []
for i, page in enumerate(reader.pages, start=1):
text = page.extract_text() or ''
chunks.append(f'\n\n=== PAGE {i} ===\n\n{text}')
out.write_text(''.join(chunks))
print(out)
PdfReaderpypdf only extracts embedded text layers