PDF Processing Guide
Paste the following prompt into your AI chat to install this skill:
Install @user_3b701cc1/pdf-hyl by following https://skillhub.cn/install/skillhub.md.
About this skill
Problem
PDF work often spans different tools: pypdf is suited for merging, splitting, reading metadata, and rotating pages; pdfplumber is suited for extracting layout-aware text and tables; reportlab is suited for generating PDFs from scratch; scanned files usually need image conversion before OCR; and form filling has separate guidance. This skill organizes “which library to use and what to do first” into a practical task path, reducing back-and-forth between multiple documents.
How It Works
- Basic structure operations: use
pypdfto merge PDFs, split by page, extract document metadata, and rotate selected pages, useful for archiving, extracting single pages, and fixing page orientation. - Text and table extraction: use
pdfplumberto extract text and tables while preserving layout information, useful for reports, invoices, checklists, and tabular data. - PDF creation: use
reportlabwithCanvasorPlatypusto create single-page or multi-page PDFs, useful for simple reports, notes, and test files. - CLI support: use
pdftotextfor quick text conversion andqpdffor structural operations such as merging and splitting, useful for scripting and batch processing. - Advanced tasks: convert scanned PDFs to images before OCR; handle watermarks, image extraction, and password protection according to the guide; follow
forms.mdfor form filling instead of treating it as plain text replacement.
Boundaries
This is an engineering-oriented operations guide, not an OCR algorithm, layout reconstruction, or automatic recognition solution for complex business forms. For JavaScript pdf-lib, advanced pypdfium2, troubleshooting, and more detailed examples, consult reference.md.
Use Cases
- Archive a multi-page invoice PDF by splitting each page into separate files.
- Extract layout-aware text and tables from a quote PDF for later data review.
- Generate a multi-page explanation PDF with reportlab for testing or delivery.
- Process a scanned contract PDF by converting it to images before OCR text extraction.
Best For
- Python engineers maintaining scripts: need to merge, split, and read PDF metadata in code.
- Analysts organizing data: need to extract structured text from PDF tables for review.
- Backend engineers building automation: need batch document processing with qpdf and pdftotext.
- Toolchain engineers creating reports: need to output multi-page PDFs with reportlab.
Related Skills
Runs rule and semantic checks on Word files, adds comments, and applies GB/T 9704-2012 party/government formatting.
Generate professional .pptx presentations from a topic or outline, with themes, common layouts, speaker notes, and 16:9/4:3 support.
Generates a fixed-structure A-share tech daily across five tracks, screening 24-hour news and selecting leader and growth stocks.
Convert teaching schedules from talent development plan PDFs into structured Excel files, with cross-page tables, merged cells, multi-semester course splitting, major metadata extraction, and batch output.