[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-composio-pdf":3,"mdc-ldgo3k-key":48,"related-repo-composio-pdf":2237,"related-org-composio-pdf":2324},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":12,"stars":22,"repoUrl":23,"updatedAt":24,"license":25,"forks":26,"topics":27,"repo":43,"sourceUrl":46,"mdContent":47},"pdf","manipulate and extract data from PDFs","Comprehensive PDF manipulation toolkit for extracting text and tables, creating new PDFs, merging\u002Fsplitting documents, and handling forms. When Claude needs to fill in a PDF form or programmatically process, generate, or analyze PDF documents at scale.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},"composio","Composio","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Fcomposio.png","ComposioHQ",[13,16,19],{"name":14,"slug":4,"type":15},"PDF","tag",{"name":17,"slug":18,"type":15},"Automation","automation",{"name":20,"slug":21,"type":15},"Documents","documents",67499,"https:\u002F\u002Fgithub.com\u002FComposioHQ\u002Fawesome-claude-skills","2026-07-12T08:09:32.910433","Proprietary. LICENSE.txt has complete terms",7603,[28,29,30,18,31,32,33,8,34,35,36,37,38,39,40,41,42],"agent-skills","ai-agents","antigravity","claude","claude-code","codex","cursor","developer-tools","gemini-cli","mcp","openai-codex","rube","saas","skill","workflow-automation",{"repoUrl":23,"stars":22,"forks":26,"topics":44,"description":45},[28,29,30,18,31,32,33,8,34,35,36,37,38,39,40,41,42],"A curated list of awesome Claude Skills, resources, and tools for customizing Claude AI workflows","https:\u002F\u002Fgithub.com\u002FComposioHQ\u002Fawesome-claude-skills\u002Ftree\u002FHEAD\u002Fdocument-skills\u002Fpdf","---\nname: pdf\ndescription: Comprehensive PDF manipulation toolkit for extracting text and tables, creating new PDFs, merging\u002Fsplitting documents, and handling forms. When Claude needs to fill in a PDF form or programmatically process, generate, or analyze PDF documents at scale.\nlicense: Proprietary. LICENSE.txt has complete terms\n---\n\n# PDF Processing Guide\n\n## Overview\n\nThis guide covers essential PDF processing operations using Python libraries and command-line tools. For advanced features, JavaScript libraries, and detailed examples, see reference.md. If you need to fill out a PDF form, read forms.md and follow its instructions.\n\n## Quick Start\n\n```python\nfrom pypdf import PdfReader, PdfWriter\n\n# Read a PDF\nreader = PdfReader(\"document.pdf\")\nprint(f\"Pages: {len(reader.pages)}\")\n\n# Extract text\ntext = \"\"\nfor page in reader.pages:\n    text += page.extract_text()\n```\n\n## Python Libraries\n\n### pypdf - Basic Operations\n\n#### Merge PDFs\n```python\nfrom pypdf import PdfWriter, PdfReader\n\nwriter = PdfWriter()\nfor pdf_file in [\"doc1.pdf\", \"doc2.pdf\", \"doc3.pdf\"]:\n    reader = PdfReader(pdf_file)\n    for page in reader.pages:\n        writer.add_page(page)\n\nwith open(\"merged.pdf\", \"wb\") as output:\n    writer.write(output)\n```\n\n#### Split PDF\n```python\nreader = PdfReader(\"input.pdf\")\nfor i, page in enumerate(reader.pages):\n    writer = PdfWriter()\n    writer.add_page(page)\n    with open(f\"page_{i+1}.pdf\", \"wb\") as output:\n        writer.write(output)\n```\n\n#### Extract Metadata\n```python\nreader = PdfReader(\"document.pdf\")\nmeta = reader.metadata\nprint(f\"Title: {meta.title}\")\nprint(f\"Author: {meta.author}\")\nprint(f\"Subject: {meta.subject}\")\nprint(f\"Creator: {meta.creator}\")\n```\n\n#### Rotate Pages\n```python\nreader = PdfReader(\"input.pdf\")\nwriter = PdfWriter()\n\npage = reader.pages[0]\npage.rotate(90)  # Rotate 90 degrees clockwise\nwriter.add_page(page)\n\nwith open(\"rotated.pdf\", \"wb\") as output:\n    writer.write(output)\n```\n\n### pdfplumber - Text and Table Extraction\n\n#### Extract Text with Layout\n```python\nimport pdfplumber\n\nwith pdfplumber.open(\"document.pdf\") as pdf:\n    for page in pdf.pages:\n        text = page.extract_text()\n        print(text)\n```\n\n#### Extract Tables\n```python\nwith pdfplumber.open(\"document.pdf\") as pdf:\n    for i, page in enumerate(pdf.pages):\n        tables = page.extract_tables()\n        for j, table in enumerate(tables):\n            print(f\"Table {j+1} on page {i+1}:\")\n            for row in table:\n                print(row)\n```\n\n#### Advanced Table Extraction\n```python\nimport pandas as pd\n\nwith pdfplumber.open(\"document.pdf\") as pdf:\n    all_tables = []\n    for page in pdf.pages:\n        tables = page.extract_tables()\n        for table in tables:\n            if table:  # Check if table is not empty\n                df = pd.DataFrame(table[1:], columns=table[0])\n                all_tables.append(df)\n\n# Combine all tables\nif all_tables:\n    combined_df = pd.concat(all_tables, ignore_index=True)\n    combined_df.to_excel(\"extracted_tables.xlsx\", index=False)\n```\n\n### reportlab - Create PDFs\n\n#### Basic PDF Creation\n```python\nfrom reportlab.lib.pagesizes import letter\nfrom reportlab.pdfgen import canvas\n\nc = canvas.Canvas(\"hello.pdf\", pagesize=letter)\nwidth, height = letter\n\n# Add text\nc.drawString(100, height - 100, \"Hello World!\")\nc.drawString(100, height - 120, \"This is a PDF created with reportlab\")\n\n# Add a line\nc.line(100, height - 140, 400, height - 140)\n\n# Save\nc.save()\n```\n\n#### Create PDF with Multiple Pages\n```python\nfrom reportlab.lib.pagesizes import letter\nfrom reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, PageBreak\nfrom reportlab.lib.styles import getSampleStyleSheet\n\ndoc = SimpleDocTemplate(\"report.pdf\", pagesize=letter)\nstyles = getSampleStyleSheet()\nstory = []\n\n# Add content\ntitle = Paragraph(\"Report Title\", styles['Title'])\nstory.append(title)\nstory.append(Spacer(1, 12))\n\nbody = Paragraph(\"This is the body of the report. \" * 20, styles['Normal'])\nstory.append(body)\nstory.append(PageBreak())\n\n# Page 2\nstory.append(Paragraph(\"Page 2\", styles['Heading1']))\nstory.append(Paragraph(\"Content for page 2\", styles['Normal']))\n\n# Build PDF\ndoc.build(story)\n```\n\n## Command-Line Tools\n\n### pdftotext (poppler-utils)\n```bash\n# Extract text\npdftotext input.pdf output.txt\n\n# Extract text preserving layout\npdftotext -layout input.pdf output.txt\n\n# Extract specific pages\npdftotext -f 1 -l 5 input.pdf output.txt  # Pages 1-5\n```\n\n### qpdf\n```bash\n# Merge PDFs\nqpdf --empty --pages file1.pdf file2.pdf -- merged.pdf\n\n# Split pages\nqpdf input.pdf --pages . 1-5 -- pages1-5.pdf\nqpdf input.pdf --pages . 6-10 -- pages6-10.pdf\n\n# Rotate pages\nqpdf input.pdf output.pdf --rotate=+90:1  # Rotate page 1 by 90 degrees\n\n# Remove password\nqpdf --password=mypassword --decrypt encrypted.pdf decrypted.pdf\n```\n\n### pdftk (if available)\n```bash\n# Merge\npdftk file1.pdf file2.pdf cat output merged.pdf\n\n# Split\npdftk input.pdf burst\n\n# Rotate\npdftk input.pdf rotate 1east output rotated.pdf\n```\n\n## Common Tasks\n\n### Extract Text from Scanned PDFs\n```python\n# Requires: pip install pytesseract pdf2image\nimport pytesseract\nfrom pdf2image import convert_from_path\n\n# Convert PDF to images\nimages = convert_from_path('scanned.pdf')\n\n# OCR each page\ntext = \"\"\nfor i, image in enumerate(images):\n    text += f\"Page {i+1}:\\n\"\n    text += pytesseract.image_to_string(image)\n    text += \"\\n\\n\"\n\nprint(text)\n```\n\n### Add Watermark\n```python\nfrom pypdf import PdfReader, PdfWriter\n\n# Create watermark (or load existing)\nwatermark = PdfReader(\"watermark.pdf\").pages[0]\n\n# Apply to all pages\nreader = PdfReader(\"document.pdf\")\nwriter = PdfWriter()\n\nfor page in reader.pages:\n    page.merge_page(watermark)\n    writer.add_page(page)\n\nwith open(\"watermarked.pdf\", \"wb\") as output:\n    writer.write(output)\n```\n\n### Extract Images\n```bash\n# Using pdfimages (poppler-utils)\npdfimages -j input.pdf output_prefix\n\n# This extracts all images as output_prefix-000.jpg, output_prefix-001.jpg, etc.\n```\n\n### Password Protection\n```python\nfrom pypdf import PdfReader, PdfWriter\n\nreader = PdfReader(\"input.pdf\")\nwriter = PdfWriter()\n\nfor page in reader.pages:\n    writer.add_page(page)\n\n# Add password\nwriter.encrypt(\"userpassword\", \"ownerpassword\")\n\nwith open(\"encrypted.pdf\", \"wb\") as output:\n    writer.write(output)\n```\n\n## Quick Reference\n\n| Task | Best Tool | Command\u002FCode |\n|------|-----------|--------------|\n| Merge PDFs | pypdf | `writer.add_page(page)` |\n| Split PDFs | pypdf | One page per file |\n| Extract text | pdfplumber | `page.extract_text()` |\n| Extract tables | pdfplumber | `page.extract_tables()` |\n| Create PDFs | reportlab | Canvas or Platypus |\n| Command line merge | qpdf | `qpdf --empty --pages ...` |\n| OCR scanned PDFs | pytesseract | Convert to image first |\n| Fill PDF forms | pdf-lib or pypdf (see forms.md) | See forms.md |\n\n## Next Steps\n\n- For advanced pypdfium2 usage, see reference.md\n- For JavaScript libraries (pdf-lib), see reference.md\n- If you need to fill out a PDF form, follow the instructions in forms.md\n- For troubleshooting guides, see reference.md\n",{"data":49,"body":50},{"name":4,"description":6,"license":25},{"type":51,"children":52},"root",[53,62,69,75,81,185,191,198,205,290,296,351,357,411,417,491,497,503,557,563,625,631,758,764,770,893,899,1092,1098,1104,1233,1238,1455,1461,1582,1588,1594,1717,1723,1840,1846,1898,1904,2005,2011,2200,2206,2231],{"type":54,"tag":55,"props":56,"children":58},"element","h1",{"id":57},"pdf-processing-guide",[59],{"type":60,"value":61},"text","PDF Processing Guide",{"type":54,"tag":63,"props":64,"children":66},"h2",{"id":65},"overview",[67],{"type":60,"value":68},"Overview",{"type":54,"tag":70,"props":71,"children":72},"p",{},[73],{"type":60,"value":74},"This guide covers essential PDF processing operations using Python libraries and command-line tools. For advanced features, JavaScript libraries, and detailed examples, see reference.md. If you need to fill out a PDF form, read forms.md and follow its instructions.",{"type":54,"tag":63,"props":76,"children":78},{"id":77},"quick-start",[79],{"type":60,"value":80},"Quick Start",{"type":54,"tag":82,"props":83,"children":88},"pre",{"className":84,"code":85,"language":86,"meta":87,"style":87},"language-python shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","from pypdf import PdfReader, PdfWriter\n\n# Read a PDF\nreader = PdfReader(\"document.pdf\")\nprint(f\"Pages: {len(reader.pages)}\")\n\n# Extract text\ntext = \"\"\nfor page in reader.pages:\n    text += page.extract_text()\n","python","",[89],{"type":54,"tag":90,"props":91,"children":92},"code",{"__ignoreMap":87},[93,104,114,123,132,141,149,158,167,176],{"type":54,"tag":94,"props":95,"children":98},"span",{"class":96,"line":97},"line",1,[99],{"type":54,"tag":94,"props":100,"children":101},{},[102],{"type":60,"value":103},"from pypdf import PdfReader, PdfWriter\n",{"type":54,"tag":94,"props":105,"children":107},{"class":96,"line":106},2,[108],{"type":54,"tag":94,"props":109,"children":111},{"emptyLinePlaceholder":110},true,[112],{"type":60,"value":113},"\n",{"type":54,"tag":94,"props":115,"children":117},{"class":96,"line":116},3,[118],{"type":54,"tag":94,"props":119,"children":120},{},[121],{"type":60,"value":122},"# Read a PDF\n",{"type":54,"tag":94,"props":124,"children":126},{"class":96,"line":125},4,[127],{"type":54,"tag":94,"props":128,"children":129},{},[130],{"type":60,"value":131},"reader = PdfReader(\"document.pdf\")\n",{"type":54,"tag":94,"props":133,"children":135},{"class":96,"line":134},5,[136],{"type":54,"tag":94,"props":137,"children":138},{},[139],{"type":60,"value":140},"print(f\"Pages: {len(reader.pages)}\")\n",{"type":54,"tag":94,"props":142,"children":144},{"class":96,"line":143},6,[145],{"type":54,"tag":94,"props":146,"children":147},{"emptyLinePlaceholder":110},[148],{"type":60,"value":113},{"type":54,"tag":94,"props":150,"children":152},{"class":96,"line":151},7,[153],{"type":54,"tag":94,"props":154,"children":155},{},[156],{"type":60,"value":157},"# Extract text\n",{"type":54,"tag":94,"props":159,"children":161},{"class":96,"line":160},8,[162],{"type":54,"tag":94,"props":163,"children":164},{},[165],{"type":60,"value":166},"text = \"\"\n",{"type":54,"tag":94,"props":168,"children":170},{"class":96,"line":169},9,[171],{"type":54,"tag":94,"props":172,"children":173},{},[174],{"type":60,"value":175},"for page in reader.pages:\n",{"type":54,"tag":94,"props":177,"children":179},{"class":96,"line":178},10,[180],{"type":54,"tag":94,"props":181,"children":182},{},[183],{"type":60,"value":184},"    text += page.extract_text()\n",{"type":54,"tag":63,"props":186,"children":188},{"id":187},"python-libraries",[189],{"type":60,"value":190},"Python Libraries",{"type":54,"tag":192,"props":193,"children":195},"h3",{"id":194},"pypdf-basic-operations",[196],{"type":60,"value":197},"pypdf - Basic Operations",{"type":54,"tag":199,"props":200,"children":202},"h4",{"id":201},"merge-pdfs",[203],{"type":60,"value":204},"Merge PDFs",{"type":54,"tag":82,"props":206,"children":208},{"className":84,"code":207,"language":86,"meta":87,"style":87},"from pypdf import PdfWriter, PdfReader\n\nwriter = PdfWriter()\nfor pdf_file in [\"doc1.pdf\", \"doc2.pdf\", \"doc3.pdf\"]:\n    reader = PdfReader(pdf_file)\n    for page in reader.pages:\n        writer.add_page(page)\n\nwith open(\"merged.pdf\", \"wb\") as output:\n    writer.write(output)\n",[209],{"type":54,"tag":90,"props":210,"children":211},{"__ignoreMap":87},[212,220,227,235,243,251,259,267,274,282],{"type":54,"tag":94,"props":213,"children":214},{"class":96,"line":97},[215],{"type":54,"tag":94,"props":216,"children":217},{},[218],{"type":60,"value":219},"from pypdf import PdfWriter, PdfReader\n",{"type":54,"tag":94,"props":221,"children":222},{"class":96,"line":106},[223],{"type":54,"tag":94,"props":224,"children":225},{"emptyLinePlaceholder":110},[226],{"type":60,"value":113},{"type":54,"tag":94,"props":228,"children":229},{"class":96,"line":116},[230],{"type":54,"tag":94,"props":231,"children":232},{},[233],{"type":60,"value":234},"writer = PdfWriter()\n",{"type":54,"tag":94,"props":236,"children":237},{"class":96,"line":125},[238],{"type":54,"tag":94,"props":239,"children":240},{},[241],{"type":60,"value":242},"for pdf_file in [\"doc1.pdf\", \"doc2.pdf\", \"doc3.pdf\"]:\n",{"type":54,"tag":94,"props":244,"children":245},{"class":96,"line":134},[246],{"type":54,"tag":94,"props":247,"children":248},{},[249],{"type":60,"value":250},"    reader = PdfReader(pdf_file)\n",{"type":54,"tag":94,"props":252,"children":253},{"class":96,"line":143},[254],{"type":54,"tag":94,"props":255,"children":256},{},[257],{"type":60,"value":258},"    for page in reader.pages:\n",{"type":54,"tag":94,"props":260,"children":261},{"class":96,"line":151},[262],{"type":54,"tag":94,"props":263,"children":264},{},[265],{"type":60,"value":266},"        writer.add_page(page)\n",{"type":54,"tag":94,"props":268,"children":269},{"class":96,"line":160},[270],{"type":54,"tag":94,"props":271,"children":272},{"emptyLinePlaceholder":110},[273],{"type":60,"value":113},{"type":54,"tag":94,"props":275,"children":276},{"class":96,"line":169},[277],{"type":54,"tag":94,"props":278,"children":279},{},[280],{"type":60,"value":281},"with open(\"merged.pdf\", \"wb\") as output:\n",{"type":54,"tag":94,"props":283,"children":284},{"class":96,"line":178},[285],{"type":54,"tag":94,"props":286,"children":287},{},[288],{"type":60,"value":289},"    writer.write(output)\n",{"type":54,"tag":199,"props":291,"children":293},{"id":292},"split-pdf",[294],{"type":60,"value":295},"Split PDF",{"type":54,"tag":82,"props":297,"children":299},{"className":84,"code":298,"language":86,"meta":87,"style":87},"reader = PdfReader(\"input.pdf\")\nfor i, page in enumerate(reader.pages):\n    writer = PdfWriter()\n    writer.add_page(page)\n    with open(f\"page_{i+1}.pdf\", \"wb\") as output:\n        writer.write(output)\n",[300],{"type":54,"tag":90,"props":301,"children":302},{"__ignoreMap":87},[303,311,319,327,335,343],{"type":54,"tag":94,"props":304,"children":305},{"class":96,"line":97},[306],{"type":54,"tag":94,"props":307,"children":308},{},[309],{"type":60,"value":310},"reader = PdfReader(\"input.pdf\")\n",{"type":54,"tag":94,"props":312,"children":313},{"class":96,"line":106},[314],{"type":54,"tag":94,"props":315,"children":316},{},[317],{"type":60,"value":318},"for i, page in enumerate(reader.pages):\n",{"type":54,"tag":94,"props":320,"children":321},{"class":96,"line":116},[322],{"type":54,"tag":94,"props":323,"children":324},{},[325],{"type":60,"value":326},"    writer = PdfWriter()\n",{"type":54,"tag":94,"props":328,"children":329},{"class":96,"line":125},[330],{"type":54,"tag":94,"props":331,"children":332},{},[333],{"type":60,"value":334},"    writer.add_page(page)\n",{"type":54,"tag":94,"props":336,"children":337},{"class":96,"line":134},[338],{"type":54,"tag":94,"props":339,"children":340},{},[341],{"type":60,"value":342},"    with open(f\"page_{i+1}.pdf\", \"wb\") as output:\n",{"type":54,"tag":94,"props":344,"children":345},{"class":96,"line":143},[346],{"type":54,"tag":94,"props":347,"children":348},{},[349],{"type":60,"value":350},"        writer.write(output)\n",{"type":54,"tag":199,"props":352,"children":354},{"id":353},"extract-metadata",[355],{"type":60,"value":356},"Extract Metadata",{"type":54,"tag":82,"props":358,"children":360},{"className":84,"code":359,"language":86,"meta":87,"style":87},"reader = PdfReader(\"document.pdf\")\nmeta = reader.metadata\nprint(f\"Title: {meta.title}\")\nprint(f\"Author: {meta.author}\")\nprint(f\"Subject: {meta.subject}\")\nprint(f\"Creator: {meta.creator}\")\n",[361],{"type":54,"tag":90,"props":362,"children":363},{"__ignoreMap":87},[364,371,379,387,395,403],{"type":54,"tag":94,"props":365,"children":366},{"class":96,"line":97},[367],{"type":54,"tag":94,"props":368,"children":369},{},[370],{"type":60,"value":131},{"type":54,"tag":94,"props":372,"children":373},{"class":96,"line":106},[374],{"type":54,"tag":94,"props":375,"children":376},{},[377],{"type":60,"value":378},"meta = reader.metadata\n",{"type":54,"tag":94,"props":380,"children":381},{"class":96,"line":116},[382],{"type":54,"tag":94,"props":383,"children":384},{},[385],{"type":60,"value":386},"print(f\"Title: {meta.title}\")\n",{"type":54,"tag":94,"props":388,"children":389},{"class":96,"line":125},[390],{"type":54,"tag":94,"props":391,"children":392},{},[393],{"type":60,"value":394},"print(f\"Author: {meta.author}\")\n",{"type":54,"tag":94,"props":396,"children":397},{"class":96,"line":134},[398],{"type":54,"tag":94,"props":399,"children":400},{},[401],{"type":60,"value":402},"print(f\"Subject: {meta.subject}\")\n",{"type":54,"tag":94,"props":404,"children":405},{"class":96,"line":143},[406],{"type":54,"tag":94,"props":407,"children":408},{},[409],{"type":60,"value":410},"print(f\"Creator: {meta.creator}\")\n",{"type":54,"tag":199,"props":412,"children":414},{"id":413},"rotate-pages",[415],{"type":60,"value":416},"Rotate Pages",{"type":54,"tag":82,"props":418,"children":420},{"className":84,"code":419,"language":86,"meta":87,"style":87},"reader = PdfReader(\"input.pdf\")\nwriter = PdfWriter()\n\npage = reader.pages[0]\npage.rotate(90)  # Rotate 90 degrees clockwise\nwriter.add_page(page)\n\nwith open(\"rotated.pdf\", \"wb\") as output:\n    writer.write(output)\n",[421],{"type":54,"tag":90,"props":422,"children":423},{"__ignoreMap":87},[424,431,438,445,453,461,469,476,484],{"type":54,"tag":94,"props":425,"children":426},{"class":96,"line":97},[427],{"type":54,"tag":94,"props":428,"children":429},{},[430],{"type":60,"value":310},{"type":54,"tag":94,"props":432,"children":433},{"class":96,"line":106},[434],{"type":54,"tag":94,"props":435,"children":436},{},[437],{"type":60,"value":234},{"type":54,"tag":94,"props":439,"children":440},{"class":96,"line":116},[441],{"type":54,"tag":94,"props":442,"children":443},{"emptyLinePlaceholder":110},[444],{"type":60,"value":113},{"type":54,"tag":94,"props":446,"children":447},{"class":96,"line":125},[448],{"type":54,"tag":94,"props":449,"children":450},{},[451],{"type":60,"value":452},"page = reader.pages[0]\n",{"type":54,"tag":94,"props":454,"children":455},{"class":96,"line":134},[456],{"type":54,"tag":94,"props":457,"children":458},{},[459],{"type":60,"value":460},"page.rotate(90)  # Rotate 90 degrees clockwise\n",{"type":54,"tag":94,"props":462,"children":463},{"class":96,"line":143},[464],{"type":54,"tag":94,"props":465,"children":466},{},[467],{"type":60,"value":468},"writer.add_page(page)\n",{"type":54,"tag":94,"props":470,"children":471},{"class":96,"line":151},[472],{"type":54,"tag":94,"props":473,"children":474},{"emptyLinePlaceholder":110},[475],{"type":60,"value":113},{"type":54,"tag":94,"props":477,"children":478},{"class":96,"line":160},[479],{"type":54,"tag":94,"props":480,"children":481},{},[482],{"type":60,"value":483},"with open(\"rotated.pdf\", \"wb\") as output:\n",{"type":54,"tag":94,"props":485,"children":486},{"class":96,"line":169},[487],{"type":54,"tag":94,"props":488,"children":489},{},[490],{"type":60,"value":289},{"type":54,"tag":192,"props":492,"children":494},{"id":493},"pdfplumber-text-and-table-extraction",[495],{"type":60,"value":496},"pdfplumber - Text and Table Extraction",{"type":54,"tag":199,"props":498,"children":500},{"id":499},"extract-text-with-layout",[501],{"type":60,"value":502},"Extract Text with Layout",{"type":54,"tag":82,"props":504,"children":506},{"className":84,"code":505,"language":86,"meta":87,"style":87},"import pdfplumber\n\nwith pdfplumber.open(\"document.pdf\") as pdf:\n    for page in pdf.pages:\n        text = page.extract_text()\n        print(text)\n",[507],{"type":54,"tag":90,"props":508,"children":509},{"__ignoreMap":87},[510,518,525,533,541,549],{"type":54,"tag":94,"props":511,"children":512},{"class":96,"line":97},[513],{"type":54,"tag":94,"props":514,"children":515},{},[516],{"type":60,"value":517},"import pdfplumber\n",{"type":54,"tag":94,"props":519,"children":520},{"class":96,"line":106},[521],{"type":54,"tag":94,"props":522,"children":523},{"emptyLinePlaceholder":110},[524],{"type":60,"value":113},{"type":54,"tag":94,"props":526,"children":527},{"class":96,"line":116},[528],{"type":54,"tag":94,"props":529,"children":530},{},[531],{"type":60,"value":532},"with pdfplumber.open(\"document.pdf\") as pdf:\n",{"type":54,"tag":94,"props":534,"children":535},{"class":96,"line":125},[536],{"type":54,"tag":94,"props":537,"children":538},{},[539],{"type":60,"value":540},"    for page in pdf.pages:\n",{"type":54,"tag":94,"props":542,"children":543},{"class":96,"line":134},[544],{"type":54,"tag":94,"props":545,"children":546},{},[547],{"type":60,"value":548},"        text = page.extract_text()\n",{"type":54,"tag":94,"props":550,"children":551},{"class":96,"line":143},[552],{"type":54,"tag":94,"props":553,"children":554},{},[555],{"type":60,"value":556},"        print(text)\n",{"type":54,"tag":199,"props":558,"children":560},{"id":559},"extract-tables",[561],{"type":60,"value":562},"Extract Tables",{"type":54,"tag":82,"props":564,"children":566},{"className":84,"code":565,"language":86,"meta":87,"style":87},"with pdfplumber.open(\"document.pdf\") as pdf:\n    for i, page in enumerate(pdf.pages):\n        tables = page.extract_tables()\n        for j, table in enumerate(tables):\n            print(f\"Table {j+1} on page {i+1}:\")\n            for row in table:\n                print(row)\n",[567],{"type":54,"tag":90,"props":568,"children":569},{"__ignoreMap":87},[570,577,585,593,601,609,617],{"type":54,"tag":94,"props":571,"children":572},{"class":96,"line":97},[573],{"type":54,"tag":94,"props":574,"children":575},{},[576],{"type":60,"value":532},{"type":54,"tag":94,"props":578,"children":579},{"class":96,"line":106},[580],{"type":54,"tag":94,"props":581,"children":582},{},[583],{"type":60,"value":584},"    for i, page in enumerate(pdf.pages):\n",{"type":54,"tag":94,"props":586,"children":587},{"class":96,"line":116},[588],{"type":54,"tag":94,"props":589,"children":590},{},[591],{"type":60,"value":592},"        tables = page.extract_tables()\n",{"type":54,"tag":94,"props":594,"children":595},{"class":96,"line":125},[596],{"type":54,"tag":94,"props":597,"children":598},{},[599],{"type":60,"value":600},"        for j, table in enumerate(tables):\n",{"type":54,"tag":94,"props":602,"children":603},{"class":96,"line":134},[604],{"type":54,"tag":94,"props":605,"children":606},{},[607],{"type":60,"value":608},"            print(f\"Table {j+1} on page {i+1}:\")\n",{"type":54,"tag":94,"props":610,"children":611},{"class":96,"line":143},[612],{"type":54,"tag":94,"props":613,"children":614},{},[615],{"type":60,"value":616},"            for row in table:\n",{"type":54,"tag":94,"props":618,"children":619},{"class":96,"line":151},[620],{"type":54,"tag":94,"props":621,"children":622},{},[623],{"type":60,"value":624},"                print(row)\n",{"type":54,"tag":199,"props":626,"children":628},{"id":627},"advanced-table-extraction",[629],{"type":60,"value":630},"Advanced Table Extraction",{"type":54,"tag":82,"props":632,"children":634},{"className":84,"code":633,"language":86,"meta":87,"style":87},"import pandas as pd\n\nwith pdfplumber.open(\"document.pdf\") as pdf:\n    all_tables = []\n    for page in pdf.pages:\n        tables = page.extract_tables()\n        for table in tables:\n            if table:  # Check if table is not empty\n                df = pd.DataFrame(table[1:], columns=table[0])\n                all_tables.append(df)\n\n# Combine all tables\nif all_tables:\n    combined_df = pd.concat(all_tables, ignore_index=True)\n    combined_df.to_excel(\"extracted_tables.xlsx\", index=False)\n",[635],{"type":54,"tag":90,"props":636,"children":637},{"__ignoreMap":87},[638,646,653,660,668,675,682,690,698,706,714,722,731,740,749],{"type":54,"tag":94,"props":639,"children":640},{"class":96,"line":97},[641],{"type":54,"tag":94,"props":642,"children":643},{},[644],{"type":60,"value":645},"import pandas as pd\n",{"type":54,"tag":94,"props":647,"children":648},{"class":96,"line":106},[649],{"type":54,"tag":94,"props":650,"children":651},{"emptyLinePlaceholder":110},[652],{"type":60,"value":113},{"type":54,"tag":94,"props":654,"children":655},{"class":96,"line":116},[656],{"type":54,"tag":94,"props":657,"children":658},{},[659],{"type":60,"value":532},{"type":54,"tag":94,"props":661,"children":662},{"class":96,"line":125},[663],{"type":54,"tag":94,"props":664,"children":665},{},[666],{"type":60,"value":667},"    all_tables = []\n",{"type":54,"tag":94,"props":669,"children":670},{"class":96,"line":134},[671],{"type":54,"tag":94,"props":672,"children":673},{},[674],{"type":60,"value":540},{"type":54,"tag":94,"props":676,"children":677},{"class":96,"line":143},[678],{"type":54,"tag":94,"props":679,"children":680},{},[681],{"type":60,"value":592},{"type":54,"tag":94,"props":683,"children":684},{"class":96,"line":151},[685],{"type":54,"tag":94,"props":686,"children":687},{},[688],{"type":60,"value":689},"        for table in tables:\n",{"type":54,"tag":94,"props":691,"children":692},{"class":96,"line":160},[693],{"type":54,"tag":94,"props":694,"children":695},{},[696],{"type":60,"value":697},"            if table:  # Check if table is not empty\n",{"type":54,"tag":94,"props":699,"children":700},{"class":96,"line":169},[701],{"type":54,"tag":94,"props":702,"children":703},{},[704],{"type":60,"value":705},"                df = pd.DataFrame(table[1:], columns=table[0])\n",{"type":54,"tag":94,"props":707,"children":708},{"class":96,"line":178},[709],{"type":54,"tag":94,"props":710,"children":711},{},[712],{"type":60,"value":713},"                all_tables.append(df)\n",{"type":54,"tag":94,"props":715,"children":717},{"class":96,"line":716},11,[718],{"type":54,"tag":94,"props":719,"children":720},{"emptyLinePlaceholder":110},[721],{"type":60,"value":113},{"type":54,"tag":94,"props":723,"children":725},{"class":96,"line":724},12,[726],{"type":54,"tag":94,"props":727,"children":728},{},[729],{"type":60,"value":730},"# Combine all tables\n",{"type":54,"tag":94,"props":732,"children":734},{"class":96,"line":733},13,[735],{"type":54,"tag":94,"props":736,"children":737},{},[738],{"type":60,"value":739},"if all_tables:\n",{"type":54,"tag":94,"props":741,"children":743},{"class":96,"line":742},14,[744],{"type":54,"tag":94,"props":745,"children":746},{},[747],{"type":60,"value":748},"    combined_df = pd.concat(all_tables, ignore_index=True)\n",{"type":54,"tag":94,"props":750,"children":752},{"class":96,"line":751},15,[753],{"type":54,"tag":94,"props":754,"children":755},{},[756],{"type":60,"value":757},"    combined_df.to_excel(\"extracted_tables.xlsx\", index=False)\n",{"type":54,"tag":192,"props":759,"children":761},{"id":760},"reportlab-create-pdfs",[762],{"type":60,"value":763},"reportlab - Create PDFs",{"type":54,"tag":199,"props":765,"children":767},{"id":766},"basic-pdf-creation",[768],{"type":60,"value":769},"Basic PDF Creation",{"type":54,"tag":82,"props":771,"children":773},{"className":84,"code":772,"language":86,"meta":87,"style":87},"from reportlab.lib.pagesizes import letter\nfrom reportlab.pdfgen import canvas\n\nc = canvas.Canvas(\"hello.pdf\", pagesize=letter)\nwidth, height = letter\n\n# Add text\nc.drawString(100, height - 100, \"Hello World!\")\nc.drawString(100, height - 120, \"This is a PDF created with reportlab\")\n\n# Add a line\nc.line(100, height - 140, 400, height - 140)\n\n# Save\nc.save()\n",[774],{"type":54,"tag":90,"props":775,"children":776},{"__ignoreMap":87},[777,785,793,800,808,816,823,831,839,847,854,862,870,877,885],{"type":54,"tag":94,"props":778,"children":779},{"class":96,"line":97},[780],{"type":54,"tag":94,"props":781,"children":782},{},[783],{"type":60,"value":784},"from reportlab.lib.pagesizes import letter\n",{"type":54,"tag":94,"props":786,"children":787},{"class":96,"line":106},[788],{"type":54,"tag":94,"props":789,"children":790},{},[791],{"type":60,"value":792},"from reportlab.pdfgen import canvas\n",{"type":54,"tag":94,"props":794,"children":795},{"class":96,"line":116},[796],{"type":54,"tag":94,"props":797,"children":798},{"emptyLinePlaceholder":110},[799],{"type":60,"value":113},{"type":54,"tag":94,"props":801,"children":802},{"class":96,"line":125},[803],{"type":54,"tag":94,"props":804,"children":805},{},[806],{"type":60,"value":807},"c = canvas.Canvas(\"hello.pdf\", pagesize=letter)\n",{"type":54,"tag":94,"props":809,"children":810},{"class":96,"line":134},[811],{"type":54,"tag":94,"props":812,"children":813},{},[814],{"type":60,"value":815},"width, height = letter\n",{"type":54,"tag":94,"props":817,"children":818},{"class":96,"line":143},[819],{"type":54,"tag":94,"props":820,"children":821},{"emptyLinePlaceholder":110},[822],{"type":60,"value":113},{"type":54,"tag":94,"props":824,"children":825},{"class":96,"line":151},[826],{"type":54,"tag":94,"props":827,"children":828},{},[829],{"type":60,"value":830},"# Add text\n",{"type":54,"tag":94,"props":832,"children":833},{"class":96,"line":160},[834],{"type":54,"tag":94,"props":835,"children":836},{},[837],{"type":60,"value":838},"c.drawString(100, height - 100, \"Hello World!\")\n",{"type":54,"tag":94,"props":840,"children":841},{"class":96,"line":169},[842],{"type":54,"tag":94,"props":843,"children":844},{},[845],{"type":60,"value":846},"c.drawString(100, height - 120, \"This is a PDF created with reportlab\")\n",{"type":54,"tag":94,"props":848,"children":849},{"class":96,"line":178},[850],{"type":54,"tag":94,"props":851,"children":852},{"emptyLinePlaceholder":110},[853],{"type":60,"value":113},{"type":54,"tag":94,"props":855,"children":856},{"class":96,"line":716},[857],{"type":54,"tag":94,"props":858,"children":859},{},[860],{"type":60,"value":861},"# Add a line\n",{"type":54,"tag":94,"props":863,"children":864},{"class":96,"line":724},[865],{"type":54,"tag":94,"props":866,"children":867},{},[868],{"type":60,"value":869},"c.line(100, height - 140, 400, height - 140)\n",{"type":54,"tag":94,"props":871,"children":872},{"class":96,"line":733},[873],{"type":54,"tag":94,"props":874,"children":875},{"emptyLinePlaceholder":110},[876],{"type":60,"value":113},{"type":54,"tag":94,"props":878,"children":879},{"class":96,"line":742},[880],{"type":54,"tag":94,"props":881,"children":882},{},[883],{"type":60,"value":884},"# Save\n",{"type":54,"tag":94,"props":886,"children":887},{"class":96,"line":751},[888],{"type":54,"tag":94,"props":889,"children":890},{},[891],{"type":60,"value":892},"c.save()\n",{"type":54,"tag":199,"props":894,"children":896},{"id":895},"create-pdf-with-multiple-pages",[897],{"type":60,"value":898},"Create PDF with Multiple Pages",{"type":54,"tag":82,"props":900,"children":902},{"className":84,"code":901,"language":86,"meta":87,"style":87},"from reportlab.lib.pagesizes import letter\nfrom reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, PageBreak\nfrom reportlab.lib.styles import getSampleStyleSheet\n\ndoc = SimpleDocTemplate(\"report.pdf\", pagesize=letter)\nstyles = getSampleStyleSheet()\nstory = []\n\n# Add content\ntitle = Paragraph(\"Report Title\", styles['Title'])\nstory.append(title)\nstory.append(Spacer(1, 12))\n\nbody = Paragraph(\"This is the body of the report. \" * 20, styles['Normal'])\nstory.append(body)\nstory.append(PageBreak())\n\n# Page 2\nstory.append(Paragraph(\"Page 2\", styles['Heading1']))\nstory.append(Paragraph(\"Content for page 2\", styles['Normal']))\n\n# Build PDF\ndoc.build(story)\n",[903],{"type":54,"tag":90,"props":904,"children":905},{"__ignoreMap":87},[906,913,921,929,936,944,952,960,967,975,983,991,999,1006,1014,1022,1031,1039,1048,1057,1066,1074,1083],{"type":54,"tag":94,"props":907,"children":908},{"class":96,"line":97},[909],{"type":54,"tag":94,"props":910,"children":911},{},[912],{"type":60,"value":784},{"type":54,"tag":94,"props":914,"children":915},{"class":96,"line":106},[916],{"type":54,"tag":94,"props":917,"children":918},{},[919],{"type":60,"value":920},"from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, PageBreak\n",{"type":54,"tag":94,"props":922,"children":923},{"class":96,"line":116},[924],{"type":54,"tag":94,"props":925,"children":926},{},[927],{"type":60,"value":928},"from reportlab.lib.styles import getSampleStyleSheet\n",{"type":54,"tag":94,"props":930,"children":931},{"class":96,"line":125},[932],{"type":54,"tag":94,"props":933,"children":934},{"emptyLinePlaceholder":110},[935],{"type":60,"value":113},{"type":54,"tag":94,"props":937,"children":938},{"class":96,"line":134},[939],{"type":54,"tag":94,"props":940,"children":941},{},[942],{"type":60,"value":943},"doc = SimpleDocTemplate(\"report.pdf\", pagesize=letter)\n",{"type":54,"tag":94,"props":945,"children":946},{"class":96,"line":143},[947],{"type":54,"tag":94,"props":948,"children":949},{},[950],{"type":60,"value":951},"styles = getSampleStyleSheet()\n",{"type":54,"tag":94,"props":953,"children":954},{"class":96,"line":151},[955],{"type":54,"tag":94,"props":956,"children":957},{},[958],{"type":60,"value":959},"story = []\n",{"type":54,"tag":94,"props":961,"children":962},{"class":96,"line":160},[963],{"type":54,"tag":94,"props":964,"children":965},{"emptyLinePlaceholder":110},[966],{"type":60,"value":113},{"type":54,"tag":94,"props":968,"children":969},{"class":96,"line":169},[970],{"type":54,"tag":94,"props":971,"children":972},{},[973],{"type":60,"value":974},"# Add content\n",{"type":54,"tag":94,"props":976,"children":977},{"class":96,"line":178},[978],{"type":54,"tag":94,"props":979,"children":980},{},[981],{"type":60,"value":982},"title = Paragraph(\"Report Title\", styles['Title'])\n",{"type":54,"tag":94,"props":984,"children":985},{"class":96,"line":716},[986],{"type":54,"tag":94,"props":987,"children":988},{},[989],{"type":60,"value":990},"story.append(title)\n",{"type":54,"tag":94,"props":992,"children":993},{"class":96,"line":724},[994],{"type":54,"tag":94,"props":995,"children":996},{},[997],{"type":60,"value":998},"story.append(Spacer(1, 12))\n",{"type":54,"tag":94,"props":1000,"children":1001},{"class":96,"line":733},[1002],{"type":54,"tag":94,"props":1003,"children":1004},{"emptyLinePlaceholder":110},[1005],{"type":60,"value":113},{"type":54,"tag":94,"props":1007,"children":1008},{"class":96,"line":742},[1009],{"type":54,"tag":94,"props":1010,"children":1011},{},[1012],{"type":60,"value":1013},"body = Paragraph(\"This is the body of the report. \" * 20, styles['Normal'])\n",{"type":54,"tag":94,"props":1015,"children":1016},{"class":96,"line":751},[1017],{"type":54,"tag":94,"props":1018,"children":1019},{},[1020],{"type":60,"value":1021},"story.append(body)\n",{"type":54,"tag":94,"props":1023,"children":1025},{"class":96,"line":1024},16,[1026],{"type":54,"tag":94,"props":1027,"children":1028},{},[1029],{"type":60,"value":1030},"story.append(PageBreak())\n",{"type":54,"tag":94,"props":1032,"children":1034},{"class":96,"line":1033},17,[1035],{"type":54,"tag":94,"props":1036,"children":1037},{"emptyLinePlaceholder":110},[1038],{"type":60,"value":113},{"type":54,"tag":94,"props":1040,"children":1042},{"class":96,"line":1041},18,[1043],{"type":54,"tag":94,"props":1044,"children":1045},{},[1046],{"type":60,"value":1047},"# Page 2\n",{"type":54,"tag":94,"props":1049,"children":1051},{"class":96,"line":1050},19,[1052],{"type":54,"tag":94,"props":1053,"children":1054},{},[1055],{"type":60,"value":1056},"story.append(Paragraph(\"Page 2\", styles['Heading1']))\n",{"type":54,"tag":94,"props":1058,"children":1060},{"class":96,"line":1059},20,[1061],{"type":54,"tag":94,"props":1062,"children":1063},{},[1064],{"type":60,"value":1065},"story.append(Paragraph(\"Content for page 2\", styles['Normal']))\n",{"type":54,"tag":94,"props":1067,"children":1069},{"class":96,"line":1068},21,[1070],{"type":54,"tag":94,"props":1071,"children":1072},{"emptyLinePlaceholder":110},[1073],{"type":60,"value":113},{"type":54,"tag":94,"props":1075,"children":1077},{"class":96,"line":1076},22,[1078],{"type":54,"tag":94,"props":1079,"children":1080},{},[1081],{"type":60,"value":1082},"# Build PDF\n",{"type":54,"tag":94,"props":1084,"children":1086},{"class":96,"line":1085},23,[1087],{"type":54,"tag":94,"props":1088,"children":1089},{},[1090],{"type":60,"value":1091},"doc.build(story)\n",{"type":54,"tag":63,"props":1093,"children":1095},{"id":1094},"command-line-tools",[1096],{"type":60,"value":1097},"Command-Line Tools",{"type":54,"tag":192,"props":1099,"children":1101},{"id":1100},"pdftotext-poppler-utils",[1102],{"type":60,"value":1103},"pdftotext (poppler-utils)",{"type":54,"tag":82,"props":1105,"children":1109},{"className":1106,"code":1107,"language":1108,"meta":87,"style":87},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","# Extract text\npdftotext input.pdf output.txt\n\n# Extract text preserving layout\npdftotext -layout input.pdf output.txt\n\n# Extract specific pages\npdftotext -f 1 -l 5 input.pdf output.txt  # Pages 1-5\n","bash",[1110],{"type":54,"tag":90,"props":1111,"children":1112},{"__ignoreMap":87},[1113,1121,1141,1148,1156,1176,1183,1191],{"type":54,"tag":94,"props":1114,"children":1115},{"class":96,"line":97},[1116],{"type":54,"tag":94,"props":1117,"children":1119},{"style":1118},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic",[1120],{"type":60,"value":157},{"type":54,"tag":94,"props":1122,"children":1123},{"class":96,"line":106},[1124,1130,1136],{"type":54,"tag":94,"props":1125,"children":1127},{"style":1126},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[1128],{"type":60,"value":1129},"pdftotext",{"type":54,"tag":94,"props":1131,"children":1133},{"style":1132},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[1134],{"type":60,"value":1135}," input.pdf",{"type":54,"tag":94,"props":1137,"children":1138},{"style":1132},[1139],{"type":60,"value":1140}," output.txt\n",{"type":54,"tag":94,"props":1142,"children":1143},{"class":96,"line":116},[1144],{"type":54,"tag":94,"props":1145,"children":1146},{"emptyLinePlaceholder":110},[1147],{"type":60,"value":113},{"type":54,"tag":94,"props":1149,"children":1150},{"class":96,"line":125},[1151],{"type":54,"tag":94,"props":1152,"children":1153},{"style":1118},[1154],{"type":60,"value":1155},"# Extract text preserving layout\n",{"type":54,"tag":94,"props":1157,"children":1158},{"class":96,"line":134},[1159,1163,1168,1172],{"type":54,"tag":94,"props":1160,"children":1161},{"style":1126},[1162],{"type":60,"value":1129},{"type":54,"tag":94,"props":1164,"children":1165},{"style":1132},[1166],{"type":60,"value":1167}," -layout",{"type":54,"tag":94,"props":1169,"children":1170},{"style":1132},[1171],{"type":60,"value":1135},{"type":54,"tag":94,"props":1173,"children":1174},{"style":1132},[1175],{"type":60,"value":1140},{"type":54,"tag":94,"props":1177,"children":1178},{"class":96,"line":143},[1179],{"type":54,"tag":94,"props":1180,"children":1181},{"emptyLinePlaceholder":110},[1182],{"type":60,"value":113},{"type":54,"tag":94,"props":1184,"children":1185},{"class":96,"line":151},[1186],{"type":54,"tag":94,"props":1187,"children":1188},{"style":1118},[1189],{"type":60,"value":1190},"# Extract specific pages\n",{"type":54,"tag":94,"props":1192,"children":1193},{"class":96,"line":160},[1194,1198,1203,1209,1214,1219,1223,1228],{"type":54,"tag":94,"props":1195,"children":1196},{"style":1126},[1197],{"type":60,"value":1129},{"type":54,"tag":94,"props":1199,"children":1200},{"style":1132},[1201],{"type":60,"value":1202}," -f",{"type":54,"tag":94,"props":1204,"children":1206},{"style":1205},"--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C",[1207],{"type":60,"value":1208}," 1",{"type":54,"tag":94,"props":1210,"children":1211},{"style":1132},[1212],{"type":60,"value":1213}," -l",{"type":54,"tag":94,"props":1215,"children":1216},{"style":1205},[1217],{"type":60,"value":1218}," 5",{"type":54,"tag":94,"props":1220,"children":1221},{"style":1132},[1222],{"type":60,"value":1135},{"type":54,"tag":94,"props":1224,"children":1225},{"style":1132},[1226],{"type":60,"value":1227}," output.txt",{"type":54,"tag":94,"props":1229,"children":1230},{"style":1118},[1231],{"type":60,"value":1232},"  # Pages 1-5\n",{"type":54,"tag":192,"props":1234,"children":1236},{"id":1235},"qpdf",[1237],{"type":60,"value":1235},{"type":54,"tag":82,"props":1239,"children":1241},{"className":1106,"code":1240,"language":1108,"meta":87,"style":87},"# Merge PDFs\nqpdf --empty --pages file1.pdf file2.pdf -- merged.pdf\n\n# Split pages\nqpdf input.pdf --pages . 1-5 -- pages1-5.pdf\nqpdf input.pdf --pages . 6-10 -- pages6-10.pdf\n\n# Rotate pages\nqpdf input.pdf output.pdf --rotate=+90:1  # Rotate page 1 by 90 degrees\n\n# Remove password\nqpdf --password=mypassword --decrypt encrypted.pdf decrypted.pdf\n",[1242],{"type":54,"tag":90,"props":1243,"children":1244},{"__ignoreMap":87},[1245,1253,1290,1297,1305,1339,1372,1379,1387,1413,1420,1428],{"type":54,"tag":94,"props":1246,"children":1247},{"class":96,"line":97},[1248],{"type":54,"tag":94,"props":1249,"children":1250},{"style":1118},[1251],{"type":60,"value":1252},"# Merge PDFs\n",{"type":54,"tag":94,"props":1254,"children":1255},{"class":96,"line":106},[1256,1260,1265,1270,1275,1280,1285],{"type":54,"tag":94,"props":1257,"children":1258},{"style":1126},[1259],{"type":60,"value":1235},{"type":54,"tag":94,"props":1261,"children":1262},{"style":1132},[1263],{"type":60,"value":1264}," --empty",{"type":54,"tag":94,"props":1266,"children":1267},{"style":1132},[1268],{"type":60,"value":1269}," --pages",{"type":54,"tag":94,"props":1271,"children":1272},{"style":1132},[1273],{"type":60,"value":1274}," file1.pdf",{"type":54,"tag":94,"props":1276,"children":1277},{"style":1132},[1278],{"type":60,"value":1279}," file2.pdf",{"type":54,"tag":94,"props":1281,"children":1282},{"style":1132},[1283],{"type":60,"value":1284}," --",{"type":54,"tag":94,"props":1286,"children":1287},{"style":1132},[1288],{"type":60,"value":1289}," merged.pdf\n",{"type":54,"tag":94,"props":1291,"children":1292},{"class":96,"line":116},[1293],{"type":54,"tag":94,"props":1294,"children":1295},{"emptyLinePlaceholder":110},[1296],{"type":60,"value":113},{"type":54,"tag":94,"props":1298,"children":1299},{"class":96,"line":125},[1300],{"type":54,"tag":94,"props":1301,"children":1302},{"style":1118},[1303],{"type":60,"value":1304},"# Split pages\n",{"type":54,"tag":94,"props":1306,"children":1307},{"class":96,"line":134},[1308,1312,1316,1320,1325,1330,1334],{"type":54,"tag":94,"props":1309,"children":1310},{"style":1126},[1311],{"type":60,"value":1235},{"type":54,"tag":94,"props":1313,"children":1314},{"style":1132},[1315],{"type":60,"value":1135},{"type":54,"tag":94,"props":1317,"children":1318},{"style":1132},[1319],{"type":60,"value":1269},{"type":54,"tag":94,"props":1321,"children":1322},{"style":1132},[1323],{"type":60,"value":1324}," .",{"type":54,"tag":94,"props":1326,"children":1327},{"style":1132},[1328],{"type":60,"value":1329}," 1-5",{"type":54,"tag":94,"props":1331,"children":1332},{"style":1132},[1333],{"type":60,"value":1284},{"type":54,"tag":94,"props":1335,"children":1336},{"style":1132},[1337],{"type":60,"value":1338}," pages1-5.pdf\n",{"type":54,"tag":94,"props":1340,"children":1341},{"class":96,"line":143},[1342,1346,1350,1354,1358,1363,1367],{"type":54,"tag":94,"props":1343,"children":1344},{"style":1126},[1345],{"type":60,"value":1235},{"type":54,"tag":94,"props":1347,"children":1348},{"style":1132},[1349],{"type":60,"value":1135},{"type":54,"tag":94,"props":1351,"children":1352},{"style":1132},[1353],{"type":60,"value":1269},{"type":54,"tag":94,"props":1355,"children":1356},{"style":1132},[1357],{"type":60,"value":1324},{"type":54,"tag":94,"props":1359,"children":1360},{"style":1132},[1361],{"type":60,"value":1362}," 6-10",{"type":54,"tag":94,"props":1364,"children":1365},{"style":1132},[1366],{"type":60,"value":1284},{"type":54,"tag":94,"props":1368,"children":1369},{"style":1132},[1370],{"type":60,"value":1371}," pages6-10.pdf\n",{"type":54,"tag":94,"props":1373,"children":1374},{"class":96,"line":151},[1375],{"type":54,"tag":94,"props":1376,"children":1377},{"emptyLinePlaceholder":110},[1378],{"type":60,"value":113},{"type":54,"tag":94,"props":1380,"children":1381},{"class":96,"line":160},[1382],{"type":54,"tag":94,"props":1383,"children":1384},{"style":1118},[1385],{"type":60,"value":1386},"# Rotate pages\n",{"type":54,"tag":94,"props":1388,"children":1389},{"class":96,"line":169},[1390,1394,1398,1403,1408],{"type":54,"tag":94,"props":1391,"children":1392},{"style":1126},[1393],{"type":60,"value":1235},{"type":54,"tag":94,"props":1395,"children":1396},{"style":1132},[1397],{"type":60,"value":1135},{"type":54,"tag":94,"props":1399,"children":1400},{"style":1132},[1401],{"type":60,"value":1402}," output.pdf",{"type":54,"tag":94,"props":1404,"children":1405},{"style":1132},[1406],{"type":60,"value":1407}," --rotate=+90:1",{"type":54,"tag":94,"props":1409,"children":1410},{"style":1118},[1411],{"type":60,"value":1412},"  # Rotate page 1 by 90 degrees\n",{"type":54,"tag":94,"props":1414,"children":1415},{"class":96,"line":178},[1416],{"type":54,"tag":94,"props":1417,"children":1418},{"emptyLinePlaceholder":110},[1419],{"type":60,"value":113},{"type":54,"tag":94,"props":1421,"children":1422},{"class":96,"line":716},[1423],{"type":54,"tag":94,"props":1424,"children":1425},{"style":1118},[1426],{"type":60,"value":1427},"# Remove password\n",{"type":54,"tag":94,"props":1429,"children":1430},{"class":96,"line":724},[1431,1435,1440,1445,1450],{"type":54,"tag":94,"props":1432,"children":1433},{"style":1126},[1434],{"type":60,"value":1235},{"type":54,"tag":94,"props":1436,"children":1437},{"style":1132},[1438],{"type":60,"value":1439}," --password=mypassword",{"type":54,"tag":94,"props":1441,"children":1442},{"style":1132},[1443],{"type":60,"value":1444}," --decrypt",{"type":54,"tag":94,"props":1446,"children":1447},{"style":1132},[1448],{"type":60,"value":1449}," encrypted.pdf",{"type":54,"tag":94,"props":1451,"children":1452},{"style":1132},[1453],{"type":60,"value":1454}," decrypted.pdf\n",{"type":54,"tag":192,"props":1456,"children":1458},{"id":1457},"pdftk-if-available",[1459],{"type":60,"value":1460},"pdftk (if available)",{"type":54,"tag":82,"props":1462,"children":1464},{"className":1106,"code":1463,"language":1108,"meta":87,"style":87},"# Merge\npdftk file1.pdf file2.pdf cat output merged.pdf\n\n# Split\npdftk input.pdf burst\n\n# Rotate\npdftk input.pdf rotate 1east output rotated.pdf\n",[1465],{"type":54,"tag":90,"props":1466,"children":1467},{"__ignoreMap":87},[1468,1476,1506,1513,1521,1537,1544,1552],{"type":54,"tag":94,"props":1469,"children":1470},{"class":96,"line":97},[1471],{"type":54,"tag":94,"props":1472,"children":1473},{"style":1118},[1474],{"type":60,"value":1475},"# Merge\n",{"type":54,"tag":94,"props":1477,"children":1478},{"class":96,"line":106},[1479,1484,1488,1492,1497,1502],{"type":54,"tag":94,"props":1480,"children":1481},{"style":1126},[1482],{"type":60,"value":1483},"pdftk",{"type":54,"tag":94,"props":1485,"children":1486},{"style":1132},[1487],{"type":60,"value":1274},{"type":54,"tag":94,"props":1489,"children":1490},{"style":1132},[1491],{"type":60,"value":1279},{"type":54,"tag":94,"props":1493,"children":1494},{"style":1132},[1495],{"type":60,"value":1496}," cat",{"type":54,"tag":94,"props":1498,"children":1499},{"style":1132},[1500],{"type":60,"value":1501}," output",{"type":54,"tag":94,"props":1503,"children":1504},{"style":1132},[1505],{"type":60,"value":1289},{"type":54,"tag":94,"props":1507,"children":1508},{"class":96,"line":116},[1509],{"type":54,"tag":94,"props":1510,"children":1511},{"emptyLinePlaceholder":110},[1512],{"type":60,"value":113},{"type":54,"tag":94,"props":1514,"children":1515},{"class":96,"line":125},[1516],{"type":54,"tag":94,"props":1517,"children":1518},{"style":1118},[1519],{"type":60,"value":1520},"# Split\n",{"type":54,"tag":94,"props":1522,"children":1523},{"class":96,"line":134},[1524,1528,1532],{"type":54,"tag":94,"props":1525,"children":1526},{"style":1126},[1527],{"type":60,"value":1483},{"type":54,"tag":94,"props":1529,"children":1530},{"style":1132},[1531],{"type":60,"value":1135},{"type":54,"tag":94,"props":1533,"children":1534},{"style":1132},[1535],{"type":60,"value":1536}," burst\n",{"type":54,"tag":94,"props":1538,"children":1539},{"class":96,"line":143},[1540],{"type":54,"tag":94,"props":1541,"children":1542},{"emptyLinePlaceholder":110},[1543],{"type":60,"value":113},{"type":54,"tag":94,"props":1545,"children":1546},{"class":96,"line":151},[1547],{"type":54,"tag":94,"props":1548,"children":1549},{"style":1118},[1550],{"type":60,"value":1551},"# Rotate\n",{"type":54,"tag":94,"props":1553,"children":1554},{"class":96,"line":160},[1555,1559,1563,1568,1573,1577],{"type":54,"tag":94,"props":1556,"children":1557},{"style":1126},[1558],{"type":60,"value":1483},{"type":54,"tag":94,"props":1560,"children":1561},{"style":1132},[1562],{"type":60,"value":1135},{"type":54,"tag":94,"props":1564,"children":1565},{"style":1132},[1566],{"type":60,"value":1567}," rotate",{"type":54,"tag":94,"props":1569,"children":1570},{"style":1132},[1571],{"type":60,"value":1572}," 1east",{"type":54,"tag":94,"props":1574,"children":1575},{"style":1132},[1576],{"type":60,"value":1501},{"type":54,"tag":94,"props":1578,"children":1579},{"style":1132},[1580],{"type":60,"value":1581}," rotated.pdf\n",{"type":54,"tag":63,"props":1583,"children":1585},{"id":1584},"common-tasks",[1586],{"type":60,"value":1587},"Common Tasks",{"type":54,"tag":192,"props":1589,"children":1591},{"id":1590},"extract-text-from-scanned-pdfs",[1592],{"type":60,"value":1593},"Extract Text from Scanned PDFs",{"type":54,"tag":82,"props":1595,"children":1597},{"className":84,"code":1596,"language":86,"meta":87,"style":87},"# Requires: pip install pytesseract pdf2image\nimport pytesseract\nfrom pdf2image import convert_from_path\n\n# Convert PDF to images\nimages = convert_from_path('scanned.pdf')\n\n# OCR each page\ntext = \"\"\nfor i, image in enumerate(images):\n    text += f\"Page {i+1}:\\n\"\n    text += pytesseract.image_to_string(image)\n    text += \"\\n\\n\"\n\nprint(text)\n",[1598],{"type":54,"tag":90,"props":1599,"children":1600},{"__ignoreMap":87},[1601,1609,1617,1625,1632,1640,1648,1655,1663,1670,1678,1686,1694,1702,1709],{"type":54,"tag":94,"props":1602,"children":1603},{"class":96,"line":97},[1604],{"type":54,"tag":94,"props":1605,"children":1606},{},[1607],{"type":60,"value":1608},"# Requires: pip install pytesseract pdf2image\n",{"type":54,"tag":94,"props":1610,"children":1611},{"class":96,"line":106},[1612],{"type":54,"tag":94,"props":1613,"children":1614},{},[1615],{"type":60,"value":1616},"import pytesseract\n",{"type":54,"tag":94,"props":1618,"children":1619},{"class":96,"line":116},[1620],{"type":54,"tag":94,"props":1621,"children":1622},{},[1623],{"type":60,"value":1624},"from pdf2image import convert_from_path\n",{"type":54,"tag":94,"props":1626,"children":1627},{"class":96,"line":125},[1628],{"type":54,"tag":94,"props":1629,"children":1630},{"emptyLinePlaceholder":110},[1631],{"type":60,"value":113},{"type":54,"tag":94,"props":1633,"children":1634},{"class":96,"line":134},[1635],{"type":54,"tag":94,"props":1636,"children":1637},{},[1638],{"type":60,"value":1639},"# Convert PDF to images\n",{"type":54,"tag":94,"props":1641,"children":1642},{"class":96,"line":143},[1643],{"type":54,"tag":94,"props":1644,"children":1645},{},[1646],{"type":60,"value":1647},"images = convert_from_path('scanned.pdf')\n",{"type":54,"tag":94,"props":1649,"children":1650},{"class":96,"line":151},[1651],{"type":54,"tag":94,"props":1652,"children":1653},{"emptyLinePlaceholder":110},[1654],{"type":60,"value":113},{"type":54,"tag":94,"props":1656,"children":1657},{"class":96,"line":160},[1658],{"type":54,"tag":94,"props":1659,"children":1660},{},[1661],{"type":60,"value":1662},"# OCR each page\n",{"type":54,"tag":94,"props":1664,"children":1665},{"class":96,"line":169},[1666],{"type":54,"tag":94,"props":1667,"children":1668},{},[1669],{"type":60,"value":166},{"type":54,"tag":94,"props":1671,"children":1672},{"class":96,"line":178},[1673],{"type":54,"tag":94,"props":1674,"children":1675},{},[1676],{"type":60,"value":1677},"for i, image in enumerate(images):\n",{"type":54,"tag":94,"props":1679,"children":1680},{"class":96,"line":716},[1681],{"type":54,"tag":94,"props":1682,"children":1683},{},[1684],{"type":60,"value":1685},"    text += f\"Page {i+1}:\\n\"\n",{"type":54,"tag":94,"props":1687,"children":1688},{"class":96,"line":724},[1689],{"type":54,"tag":94,"props":1690,"children":1691},{},[1692],{"type":60,"value":1693},"    text += pytesseract.image_to_string(image)\n",{"type":54,"tag":94,"props":1695,"children":1696},{"class":96,"line":733},[1697],{"type":54,"tag":94,"props":1698,"children":1699},{},[1700],{"type":60,"value":1701},"    text += \"\\n\\n\"\n",{"type":54,"tag":94,"props":1703,"children":1704},{"class":96,"line":742},[1705],{"type":54,"tag":94,"props":1706,"children":1707},{"emptyLinePlaceholder":110},[1708],{"type":60,"value":113},{"type":54,"tag":94,"props":1710,"children":1711},{"class":96,"line":751},[1712],{"type":54,"tag":94,"props":1713,"children":1714},{},[1715],{"type":60,"value":1716},"print(text)\n",{"type":54,"tag":192,"props":1718,"children":1720},{"id":1719},"add-watermark",[1721],{"type":60,"value":1722},"Add Watermark",{"type":54,"tag":82,"props":1724,"children":1726},{"className":84,"code":1725,"language":86,"meta":87,"style":87},"from pypdf import PdfReader, PdfWriter\n\n# Create watermark (or load existing)\nwatermark = PdfReader(\"watermark.pdf\").pages[0]\n\n# Apply to all pages\nreader = PdfReader(\"document.pdf\")\nwriter = PdfWriter()\n\nfor page in reader.pages:\n    page.merge_page(watermark)\n    writer.add_page(page)\n\nwith open(\"watermarked.pdf\", \"wb\") as output:\n    writer.write(output)\n",[1727],{"type":54,"tag":90,"props":1728,"children":1729},{"__ignoreMap":87},[1730,1737,1744,1752,1760,1767,1775,1782,1789,1796,1803,1811,1818,1825,1833],{"type":54,"tag":94,"props":1731,"children":1732},{"class":96,"line":97},[1733],{"type":54,"tag":94,"props":1734,"children":1735},{},[1736],{"type":60,"value":103},{"type":54,"tag":94,"props":1738,"children":1739},{"class":96,"line":106},[1740],{"type":54,"tag":94,"props":1741,"children":1742},{"emptyLinePlaceholder":110},[1743],{"type":60,"value":113},{"type":54,"tag":94,"props":1745,"children":1746},{"class":96,"line":116},[1747],{"type":54,"tag":94,"props":1748,"children":1749},{},[1750],{"type":60,"value":1751},"# Create watermark (or load existing)\n",{"type":54,"tag":94,"props":1753,"children":1754},{"class":96,"line":125},[1755],{"type":54,"tag":94,"props":1756,"children":1757},{},[1758],{"type":60,"value":1759},"watermark = PdfReader(\"watermark.pdf\").pages[0]\n",{"type":54,"tag":94,"props":1761,"children":1762},{"class":96,"line":134},[1763],{"type":54,"tag":94,"props":1764,"children":1765},{"emptyLinePlaceholder":110},[1766],{"type":60,"value":113},{"type":54,"tag":94,"props":1768,"children":1769},{"class":96,"line":143},[1770],{"type":54,"tag":94,"props":1771,"children":1772},{},[1773],{"type":60,"value":1774},"# Apply to all pages\n",{"type":54,"tag":94,"props":1776,"children":1777},{"class":96,"line":151},[1778],{"type":54,"tag":94,"props":1779,"children":1780},{},[1781],{"type":60,"value":131},{"type":54,"tag":94,"props":1783,"children":1784},{"class":96,"line":160},[1785],{"type":54,"tag":94,"props":1786,"children":1787},{},[1788],{"type":60,"value":234},{"type":54,"tag":94,"props":1790,"children":1791},{"class":96,"line":169},[1792],{"type":54,"tag":94,"props":1793,"children":1794},{"emptyLinePlaceholder":110},[1795],{"type":60,"value":113},{"type":54,"tag":94,"props":1797,"children":1798},{"class":96,"line":178},[1799],{"type":54,"tag":94,"props":1800,"children":1801},{},[1802],{"type":60,"value":175},{"type":54,"tag":94,"props":1804,"children":1805},{"class":96,"line":716},[1806],{"type":54,"tag":94,"props":1807,"children":1808},{},[1809],{"type":60,"value":1810},"    page.merge_page(watermark)\n",{"type":54,"tag":94,"props":1812,"children":1813},{"class":96,"line":724},[1814],{"type":54,"tag":94,"props":1815,"children":1816},{},[1817],{"type":60,"value":334},{"type":54,"tag":94,"props":1819,"children":1820},{"class":96,"line":733},[1821],{"type":54,"tag":94,"props":1822,"children":1823},{"emptyLinePlaceholder":110},[1824],{"type":60,"value":113},{"type":54,"tag":94,"props":1826,"children":1827},{"class":96,"line":742},[1828],{"type":54,"tag":94,"props":1829,"children":1830},{},[1831],{"type":60,"value":1832},"with open(\"watermarked.pdf\", \"wb\") as output:\n",{"type":54,"tag":94,"props":1834,"children":1835},{"class":96,"line":751},[1836],{"type":54,"tag":94,"props":1837,"children":1838},{},[1839],{"type":60,"value":289},{"type":54,"tag":192,"props":1841,"children":1843},{"id":1842},"extract-images",[1844],{"type":60,"value":1845},"Extract Images",{"type":54,"tag":82,"props":1847,"children":1849},{"className":1106,"code":1848,"language":1108,"meta":87,"style":87},"# Using pdfimages (poppler-utils)\npdfimages -j input.pdf output_prefix\n\n# This extracts all images as output_prefix-000.jpg, output_prefix-001.jpg, etc.\n",[1850],{"type":54,"tag":90,"props":1851,"children":1852},{"__ignoreMap":87},[1853,1861,1883,1890],{"type":54,"tag":94,"props":1854,"children":1855},{"class":96,"line":97},[1856],{"type":54,"tag":94,"props":1857,"children":1858},{"style":1118},[1859],{"type":60,"value":1860},"# Using pdfimages (poppler-utils)\n",{"type":54,"tag":94,"props":1862,"children":1863},{"class":96,"line":106},[1864,1869,1874,1878],{"type":54,"tag":94,"props":1865,"children":1866},{"style":1126},[1867],{"type":60,"value":1868},"pdfimages",{"type":54,"tag":94,"props":1870,"children":1871},{"style":1132},[1872],{"type":60,"value":1873}," -j",{"type":54,"tag":94,"props":1875,"children":1876},{"style":1132},[1877],{"type":60,"value":1135},{"type":54,"tag":94,"props":1879,"children":1880},{"style":1132},[1881],{"type":60,"value":1882}," output_prefix\n",{"type":54,"tag":94,"props":1884,"children":1885},{"class":96,"line":116},[1886],{"type":54,"tag":94,"props":1887,"children":1888},{"emptyLinePlaceholder":110},[1889],{"type":60,"value":113},{"type":54,"tag":94,"props":1891,"children":1892},{"class":96,"line":125},[1893],{"type":54,"tag":94,"props":1894,"children":1895},{"style":1118},[1896],{"type":60,"value":1897},"# This extracts all images as output_prefix-000.jpg, output_prefix-001.jpg, etc.\n",{"type":54,"tag":192,"props":1899,"children":1901},{"id":1900},"password-protection",[1902],{"type":60,"value":1903},"Password Protection",{"type":54,"tag":82,"props":1905,"children":1907},{"className":84,"code":1906,"language":86,"meta":87,"style":87},"from pypdf import PdfReader, PdfWriter\n\nreader = PdfReader(\"input.pdf\")\nwriter = PdfWriter()\n\nfor page in reader.pages:\n    writer.add_page(page)\n\n# Add password\nwriter.encrypt(\"userpassword\", \"ownerpassword\")\n\nwith open(\"encrypted.pdf\", \"wb\") as output:\n    writer.write(output)\n",[1908],{"type":54,"tag":90,"props":1909,"children":1910},{"__ignoreMap":87},[1911,1918,1925,1932,1939,1946,1953,1960,1967,1975,1983,1990,1998],{"type":54,"tag":94,"props":1912,"children":1913},{"class":96,"line":97},[1914],{"type":54,"tag":94,"props":1915,"children":1916},{},[1917],{"type":60,"value":103},{"type":54,"tag":94,"props":1919,"children":1920},{"class":96,"line":106},[1921],{"type":54,"tag":94,"props":1922,"children":1923},{"emptyLinePlaceholder":110},[1924],{"type":60,"value":113},{"type":54,"tag":94,"props":1926,"children":1927},{"class":96,"line":116},[1928],{"type":54,"tag":94,"props":1929,"children":1930},{},[1931],{"type":60,"value":310},{"type":54,"tag":94,"props":1933,"children":1934},{"class":96,"line":125},[1935],{"type":54,"tag":94,"props":1936,"children":1937},{},[1938],{"type":60,"value":234},{"type":54,"tag":94,"props":1940,"children":1941},{"class":96,"line":134},[1942],{"type":54,"tag":94,"props":1943,"children":1944},{"emptyLinePlaceholder":110},[1945],{"type":60,"value":113},{"type":54,"tag":94,"props":1947,"children":1948},{"class":96,"line":143},[1949],{"type":54,"tag":94,"props":1950,"children":1951},{},[1952],{"type":60,"value":175},{"type":54,"tag":94,"props":1954,"children":1955},{"class":96,"line":151},[1956],{"type":54,"tag":94,"props":1957,"children":1958},{},[1959],{"type":60,"value":334},{"type":54,"tag":94,"props":1961,"children":1962},{"class":96,"line":160},[1963],{"type":54,"tag":94,"props":1964,"children":1965},{"emptyLinePlaceholder":110},[1966],{"type":60,"value":113},{"type":54,"tag":94,"props":1968,"children":1969},{"class":96,"line":169},[1970],{"type":54,"tag":94,"props":1971,"children":1972},{},[1973],{"type":60,"value":1974},"# Add password\n",{"type":54,"tag":94,"props":1976,"children":1977},{"class":96,"line":178},[1978],{"type":54,"tag":94,"props":1979,"children":1980},{},[1981],{"type":60,"value":1982},"writer.encrypt(\"userpassword\", \"ownerpassword\")\n",{"type":54,"tag":94,"props":1984,"children":1985},{"class":96,"line":716},[1986],{"type":54,"tag":94,"props":1987,"children":1988},{"emptyLinePlaceholder":110},[1989],{"type":60,"value":113},{"type":54,"tag":94,"props":1991,"children":1992},{"class":96,"line":724},[1993],{"type":54,"tag":94,"props":1994,"children":1995},{},[1996],{"type":60,"value":1997},"with open(\"encrypted.pdf\", \"wb\") as output:\n",{"type":54,"tag":94,"props":1999,"children":2000},{"class":96,"line":733},[2001],{"type":54,"tag":94,"props":2002,"children":2003},{},[2004],{"type":60,"value":289},{"type":54,"tag":63,"props":2006,"children":2008},{"id":2007},"quick-reference",[2009],{"type":60,"value":2010},"Quick Reference",{"type":54,"tag":2012,"props":2013,"children":2014},"table",{},[2015,2039],{"type":54,"tag":2016,"props":2017,"children":2018},"thead",{},[2019],{"type":54,"tag":2020,"props":2021,"children":2022},"tr",{},[2023,2029,2034],{"type":54,"tag":2024,"props":2025,"children":2026},"th",{},[2027],{"type":60,"value":2028},"Task",{"type":54,"tag":2024,"props":2030,"children":2031},{},[2032],{"type":60,"value":2033},"Best Tool",{"type":54,"tag":2024,"props":2035,"children":2036},{},[2037],{"type":60,"value":2038},"Command\u002FCode",{"type":54,"tag":2040,"props":2041,"children":2042},"tbody",{},[2043,2065,2082,2104,2125,2143,2164,2182],{"type":54,"tag":2020,"props":2044,"children":2045},{},[2046,2051,2056],{"type":54,"tag":2047,"props":2048,"children":2049},"td",{},[2050],{"type":60,"value":204},{"type":54,"tag":2047,"props":2052,"children":2053},{},[2054],{"type":60,"value":2055},"pypdf",{"type":54,"tag":2047,"props":2057,"children":2058},{},[2059],{"type":54,"tag":90,"props":2060,"children":2062},{"className":2061},[],[2063],{"type":60,"value":2064},"writer.add_page(page)",{"type":54,"tag":2020,"props":2066,"children":2067},{},[2068,2073,2077],{"type":54,"tag":2047,"props":2069,"children":2070},{},[2071],{"type":60,"value":2072},"Split PDFs",{"type":54,"tag":2047,"props":2074,"children":2075},{},[2076],{"type":60,"value":2055},{"type":54,"tag":2047,"props":2078,"children":2079},{},[2080],{"type":60,"value":2081},"One page per file",{"type":54,"tag":2020,"props":2083,"children":2084},{},[2085,2090,2095],{"type":54,"tag":2047,"props":2086,"children":2087},{},[2088],{"type":60,"value":2089},"Extract text",{"type":54,"tag":2047,"props":2091,"children":2092},{},[2093],{"type":60,"value":2094},"pdfplumber",{"type":54,"tag":2047,"props":2096,"children":2097},{},[2098],{"type":54,"tag":90,"props":2099,"children":2101},{"className":2100},[],[2102],{"type":60,"value":2103},"page.extract_text()",{"type":54,"tag":2020,"props":2105,"children":2106},{},[2107,2112,2116],{"type":54,"tag":2047,"props":2108,"children":2109},{},[2110],{"type":60,"value":2111},"Extract tables",{"type":54,"tag":2047,"props":2113,"children":2114},{},[2115],{"type":60,"value":2094},{"type":54,"tag":2047,"props":2117,"children":2118},{},[2119],{"type":54,"tag":90,"props":2120,"children":2122},{"className":2121},[],[2123],{"type":60,"value":2124},"page.extract_tables()",{"type":54,"tag":2020,"props":2126,"children":2127},{},[2128,2133,2138],{"type":54,"tag":2047,"props":2129,"children":2130},{},[2131],{"type":60,"value":2132},"Create PDFs",{"type":54,"tag":2047,"props":2134,"children":2135},{},[2136],{"type":60,"value":2137},"reportlab",{"type":54,"tag":2047,"props":2139,"children":2140},{},[2141],{"type":60,"value":2142},"Canvas or Platypus",{"type":54,"tag":2020,"props":2144,"children":2145},{},[2146,2151,2155],{"type":54,"tag":2047,"props":2147,"children":2148},{},[2149],{"type":60,"value":2150},"Command line merge",{"type":54,"tag":2047,"props":2152,"children":2153},{},[2154],{"type":60,"value":1235},{"type":54,"tag":2047,"props":2156,"children":2157},{},[2158],{"type":54,"tag":90,"props":2159,"children":2161},{"className":2160},[],[2162],{"type":60,"value":2163},"qpdf --empty --pages ...",{"type":54,"tag":2020,"props":2165,"children":2166},{},[2167,2172,2177],{"type":54,"tag":2047,"props":2168,"children":2169},{},[2170],{"type":60,"value":2171},"OCR scanned PDFs",{"type":54,"tag":2047,"props":2173,"children":2174},{},[2175],{"type":60,"value":2176},"pytesseract",{"type":54,"tag":2047,"props":2178,"children":2179},{},[2180],{"type":60,"value":2181},"Convert to image first",{"type":54,"tag":2020,"props":2183,"children":2184},{},[2185,2190,2195],{"type":54,"tag":2047,"props":2186,"children":2187},{},[2188],{"type":60,"value":2189},"Fill PDF forms",{"type":54,"tag":2047,"props":2191,"children":2192},{},[2193],{"type":60,"value":2194},"pdf-lib or pypdf (see forms.md)",{"type":54,"tag":2047,"props":2196,"children":2197},{},[2198],{"type":60,"value":2199},"See forms.md",{"type":54,"tag":63,"props":2201,"children":2203},{"id":2202},"next-steps",[2204],{"type":60,"value":2205},"Next Steps",{"type":54,"tag":2207,"props":2208,"children":2209},"ul",{},[2210,2216,2221,2226],{"type":54,"tag":2211,"props":2212,"children":2213},"li",{},[2214],{"type":60,"value":2215},"For advanced pypdfium2 usage, see reference.md",{"type":54,"tag":2211,"props":2217,"children":2218},{},[2219],{"type":60,"value":2220},"For JavaScript libraries (pdf-lib), see reference.md",{"type":54,"tag":2211,"props":2222,"children":2223},{},[2224],{"type":60,"value":2225},"If you need to fill out a PDF form, follow the instructions in forms.md",{"type":54,"tag":2211,"props":2227,"children":2228},{},[2229],{"type":60,"value":2230},"For troubleshooting guides, see reference.md",{"type":54,"tag":2232,"props":2233,"children":2234},"style",{},[2235],{"type":60,"value":2236},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":2238,"total":2323},[2239,2254,2270,2279,2289,2301,2310],{"slug":2240,"name":2241,"fn":2242,"description":2243,"org":2244,"tags":2245,"stars":22,"repoUrl":23,"updatedAt":2253},"21risk-automation","-21risk-automation","automate 21risk compliance and safety tasks","Automate 21risk tasks via Rube MCP (Composio). Always search tools first for current schemas.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2246,2247,2248,2250],{"name":17,"slug":18,"type":15},{"name":9,"slug":8,"type":15},{"name":2249,"slug":37,"type":15},"MCP",{"name":2251,"slug":2252,"type":15},"Risk Assessment","risk-assessment","2026-07-15T05:54:18.790529",{"slug":2255,"name":2256,"fn":2257,"description":2258,"org":2259,"tags":2260,"stars":22,"repoUrl":23,"updatedAt":2269},"2chat-automation","-2chat-automation","automate 2chat messaging tasks","Automate 2chat tasks via Rube MCP (Composio). Always search tools first for current schemas.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2261,2262,2265,2266],{"name":17,"slug":18,"type":15},{"name":2263,"slug":2264,"type":15},"Communications","communications",{"name":2249,"slug":37,"type":15},{"name":2267,"slug":2268,"type":15},"Messaging","messaging","2026-07-15T05:51:27.190332",{"slug":2271,"name":2271,"fn":2272,"description":2273,"org":2274,"tags":2275,"stars":22,"repoUrl":23,"updatedAt":2278},"ably-automation","automate Ably tasks with Composio","Automate Ably tasks via Rube MCP (Composio). Always search tools first for current schemas.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2276,2277],{"name":17,"slug":18,"type":15},{"name":2249,"slug":37,"type":15},"2026-07-12T08:09:55.453088",{"slug":2280,"name":2280,"fn":2281,"description":2282,"org":2283,"tags":2284,"stars":22,"repoUrl":23,"updatedAt":2288},"abstract-automation","automate Abstract tasks via Composio","Automate Abstract tasks via Rube MCP (Composio). Always search tools first for current schemas.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2285,2286,2287],{"name":17,"slug":18,"type":15},{"name":9,"slug":8,"type":15},{"name":2249,"slug":37,"type":15},"2026-07-15T05:45:16.470309",{"slug":2290,"name":2290,"fn":2291,"description":2292,"org":2293,"tags":2294,"stars":22,"repoUrl":23,"updatedAt":2300},"abuselpdb-automation","automate Abuselpdb tasks via Composio","Automate Abuselpdb tasks via Rube MCP (Composio). Always search tools first for current schemas.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2295,2296,2297],{"name":17,"slug":18,"type":15},{"name":2249,"slug":37,"type":15},{"name":2298,"slug":2299,"type":15},"Security","security","2026-07-15T05:56:20.013366",{"slug":2302,"name":2302,"fn":2303,"description":2304,"org":2305,"tags":2306,"stars":22,"repoUrl":23,"updatedAt":2309},"abyssale-automation","automate Abyssale tasks via Composio","Automate Abyssale tasks via Rube MCP (Composio). Always search tools first for current schemas.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2307,2308],{"name":17,"slug":18,"type":15},{"name":9,"slug":8,"type":15},"2026-07-15T05:54:50.762889",{"slug":2311,"name":2311,"fn":2312,"description":2313,"org":2314,"tags":2315,"stars":22,"repoUrl":23,"updatedAt":2322},"accelo-automation","automate Accelo tasks via Composio","Automate Accelo tasks via Rube MCP (Composio). Always search tools first for current schemas.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2316,2317,2318,2321],{"name":17,"slug":18,"type":15},{"name":9,"slug":8,"type":15},{"name":2319,"slug":2320,"type":15},"CRM","crm",{"name":2249,"slug":37,"type":15},"2026-07-15T05:48:43.429136",860,{"items":2325,"total":2427},[2326,2333,2340,2345,2351,2357,2362,2369,2381,2394,2407,2417],{"slug":2240,"name":2241,"fn":2242,"description":2243,"org":2327,"tags":2328,"stars":22,"repoUrl":23,"updatedAt":2253},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2329,2330,2331,2332],{"name":17,"slug":18,"type":15},{"name":9,"slug":8,"type":15},{"name":2249,"slug":37,"type":15},{"name":2251,"slug":2252,"type":15},{"slug":2255,"name":2256,"fn":2257,"description":2258,"org":2334,"tags":2335,"stars":22,"repoUrl":23,"updatedAt":2269},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2336,2337,2338,2339],{"name":17,"slug":18,"type":15},{"name":2263,"slug":2264,"type":15},{"name":2249,"slug":37,"type":15},{"name":2267,"slug":2268,"type":15},{"slug":2271,"name":2271,"fn":2272,"description":2273,"org":2341,"tags":2342,"stars":22,"repoUrl":23,"updatedAt":2278},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2343,2344],{"name":17,"slug":18,"type":15},{"name":2249,"slug":37,"type":15},{"slug":2280,"name":2280,"fn":2281,"description":2282,"org":2346,"tags":2347,"stars":22,"repoUrl":23,"updatedAt":2288},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2348,2349,2350],{"name":17,"slug":18,"type":15},{"name":9,"slug":8,"type":15},{"name":2249,"slug":37,"type":15},{"slug":2290,"name":2290,"fn":2291,"description":2292,"org":2352,"tags":2353,"stars":22,"repoUrl":23,"updatedAt":2300},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2354,2355,2356],{"name":17,"slug":18,"type":15},{"name":2249,"slug":37,"type":15},{"name":2298,"slug":2299,"type":15},{"slug":2302,"name":2302,"fn":2303,"description":2304,"org":2358,"tags":2359,"stars":22,"repoUrl":23,"updatedAt":2309},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2360,2361],{"name":17,"slug":18,"type":15},{"name":9,"slug":8,"type":15},{"slug":2311,"name":2311,"fn":2312,"description":2313,"org":2363,"tags":2364,"stars":22,"repoUrl":23,"updatedAt":2322},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2365,2366,2367,2368],{"name":17,"slug":18,"type":15},{"name":9,"slug":8,"type":15},{"name":2319,"slug":2320,"type":15},{"name":2249,"slug":37,"type":15},{"slug":2370,"name":2370,"fn":2371,"description":2372,"org":2373,"tags":2374,"stars":22,"repoUrl":23,"updatedAt":2380},"accredible-certificates-automation","automate Accredible certificate management","Automate Accredible Certificates tasks via Rube MCP (Composio). Always search tools first for current schemas.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2375,2376,2377],{"name":17,"slug":18,"type":15},{"name":20,"slug":21,"type":15},{"name":2378,"slug":2379,"type":15},"E-Signature","e-signature","2026-07-15T05:55:33.159639",{"slug":2382,"name":2382,"fn":2383,"description":2384,"org":2385,"tags":2386,"stars":22,"repoUrl":23,"updatedAt":2393},"acculynx-automation","automate Acculynx construction management tasks","Automate Acculynx tasks via Rube MCP (Composio). Always search tools first for current schemas.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2387,2388,2389,2390],{"name":17,"slug":18,"type":15},{"name":9,"slug":8,"type":15},{"name":2249,"slug":37,"type":15},{"name":2391,"slug":2392,"type":15},"Operations","operations","2026-07-15T05:58:48.059284",{"slug":2395,"name":2395,"fn":2396,"description":2397,"org":2398,"tags":2399,"stars":22,"repoUrl":23,"updatedAt":2406},"active-campaign-automation","automate ActiveCampaign marketing and CRM tasks","Automate ActiveCampaign tasks via Rube MCP (Composio). Always search tools first for current schemas.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2400,2401,2402,2403],{"name":17,"slug":18,"type":15},{"name":9,"slug":8,"type":15},{"name":2319,"slug":2320,"type":15},{"name":2404,"slug":2405,"type":15},"Email Marketing","email-marketing","2026-07-15T05:49:44.281711",{"slug":2408,"name":2408,"fn":2409,"description":2410,"org":2411,"tags":2412,"stars":22,"repoUrl":23,"updatedAt":2416},"addresszen-automation","automate Addresszen address validation","Automate Addresszen tasks via Rube MCP (Composio). Always search tools first for current schemas.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2413,2414,2415],{"name":17,"slug":18,"type":15},{"name":9,"slug":8,"type":15},{"name":2249,"slug":37,"type":15},"2026-07-15T05:47:51.742515",{"slug":2418,"name":2418,"fn":2419,"description":2420,"org":2421,"tags":2422,"stars":22,"repoUrl":23,"updatedAt":2426},"adobe-automation","automate Adobe tasks via Composio","Automate Adobe tasks via Rube MCP (Composio). Always search tools first for current schemas.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2423,2424,2425],{"name":17,"slug":18,"type":15},{"name":9,"slug":8,"type":15},{"name":2249,"slug":37,"type":15},"2026-07-15T05:45:05.303254",863]