pdf-page-verification-correction

Featured

Iterative workflow to verify PDF page counts and adjust layout parameters until requirements are met

Data & Documents 6,332 stars 785 forks Updated 4 days ago MIT

Install

View on GitHub

Quality Score: 93/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# PDF Page Count Verification and Correction This skill provides a systematic approach to ensure PDFs meet target page count requirements through iterative verification and layout adjustment. ## When to Use - Creating PDFs with strict page limits (e.g., reports, summaries, maps) - When initial PDF generation may produce variable page counts - When layout elements (images, tables, text) can cause unpredictable overflow ## Prerequisites - Python with PyPDF2 or fitz (PyMuPDF) installed - PDF generation capability (ReportLab, matplotlib, etc.) ## Workflow Steps ### Step 1: Initial PDF Creation Generate the PDF with your initial layout parameters: ```python def create_pdf(output_path, params): """Create PDF with given layout parameters""" # Your PDF generation logic here # params can include: image_size, table_density, font_size, margins pass ``` ### Step 2: Verify Page Count Check the generated PDF's page count: ```python import fitz # PyMuPDF def verify_page_count(pdf_path): """Return the number of pages in the PDF""" doc = fitz.open(pdf_path) page_count = len(doc) doc.close() return page_count # Alternative with PyPDF2 from PyPDF2 import PdfReader def verify_page_count_pypdf2(pdf_path): reader = PdfReader(pdf_path) return len(reader.pages) ``` ### Step 3: Compare Against Target ```python def check_page_requirement(actual, target_max, target_exact=None): """ Check if page count meets requirements Retu...

Details

Author
HKUDS
Repository
HKUDS/OpenSpace
Created
2 months ago
Last Updated
4 days ago
Language
Python
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category

Data & Documents Featured

pdf

Use 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.

14,116 Updated today
eigent-ai
Data & Documents Solid

pdfkit-generation

Generate professional PDFs with PDFKit in Node.js. Use when creating pitch decks, reports, or styled documents with AGNT branding. Covers large script handling, Unicode-safe characters, and brand design patterns.

270 Updated today
agnt-gg
Data & Documents Solid

citation-check-skill

Vision-enabled verification gate with web search. Use when users want to (1) verify slides/reports/PDFs/images against authoritative online sources, (2) validate that citations actually exist and say what's claimed, (3) check charts/graphs/tables for accuracy, (4) audit AI-generated content in doc-only mode (no external knowledge). Two modes - search mode validates against web, doc-only mode ensures everything traces to provided documents. Supports content in any language.

93 Updated 3 months ago
serenakeyitan
Data & Documents Listed

fix_verification

Verifying if a reported bug is truly fixed.

11 Updated 1 months ago
multiversx
Data & Documents Solid

phd-deepread

Guided workflow for processing academic PDFs into structured literature notes using Text-First decision tree (PyMuPDF + Tesseract OCR) and Claude-assisted analysis. Perfect for literature review and note-taking in Obsidian.

47 Updated today
heleninsights-dot