मुख्य सामग्री पर जाएँ
Skillpedia
PDF, Word और स्लाइड54k · #3369

pdf

यह क्या करती है

यह स्किल AI एजेंट को PDF फ़ाइलों के साथ काम करने का तरीका सिखाती है, जैसे उनका टेक्स्ट पढ़ना, उन्हें जोड़ना या बाँटना, और नई बनाना। यह उन सबके लिए है जिन्हें PDF हाथ से किए बिना संभालने हैं।

कब इस्तेमाल करें

  • ✓जब आप PDF अपलोड करते हैं और उससे टेक्स्ट या टेबल निकालना चाहते हैं।
  • ✓जब आप PDF के पेज मिलाना, बाँटना, घुमाना या उन पर watermark लगाना चाहते हैं।
  • ✓जब आपको नई PDF बनवानी है या PDF फ़ॉर्म भरवाना है।

Skill का लिंक

https://github.com/HKUDS/DeepTutor/blob/main/deeptutor/skills/builtin/pdf/SKILL.md

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/HKUDS/DeepTutor/blob/main/deeptutor/skills/builtin/pdf/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“इस PDF से टेबल निकालकर मेरे लिए एक सूची में दीजिए।”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

एजेंट तैयार Python टूल्स इस्तेमाल करता है, जो PDF फ़ाइलें पढ़ और बदल सकते हैं। काम एक sandbox में चलता है, और फिर वह तैयार फ़ाइल लौटाता है।

तकनीकी सामग्री (मूल SKILL.md)

लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।

PDF

Work PDFs in the sandbox with preinstalled Python libs. Pick the library by task:

  • Extract text/tables/layout/word-coordinates → pdfplumber; quick raw text or page ops → pypdf.
  • Merge / split / rotate / crop / watermark / encrypt / metadata → pypdf.
  • Fill forms → pypdf (fillable AcroForm fields) or annotation overlay (flat forms).
  • Create from scratch → reportlab.

Use exec with complete Python source (language: python). Prefer creating, reopening, and validating the PDF in one call; later calls can revise the same relative filename. Follow the turn's User workspace instructions for locating inputs, output boundaries, and presenting the finished file. Preserve an explicitly requested quantity (such as 500 words) and verify the count in the output before finishing. If execution fails or the artifact is missing, diagnose stderr/root cause and change strategy; do not retry identical code or reduce the requested scope without asking.

Extract text and tables (pdfplumber)

import pdfplumber

with pdfplumber.open("in.pdf") as pdf:
    for i, page in enumerate(pdf.pages, 1):
        print(f"--- page {i} ---")
        print(page.extract_text() or "")  # layout-aware text
        for t in page.extract_tables():  # list of tables; each is list[row]
            for row in t:
                print(row)

Tables → Excel (one worksheet per table):

import pdfplumber
from openpyxl import Workbook

workbook = Workbook()
workbook.remove(workbook.active)
table_number = 0
with pdfplumber.open("in.pdf") as pdf:
    for page_number, page in enumerate(pdf.pages, 1):
        for table in page.extract_tables():
            if not table:
                continue
            table_number += 1
            sheet = workbook.create_sheet(f"p{page_number}_table{table_number}"[:31])
            for row in table:
                sheet.append([cell or "" for cell in row])
if table_number:
    workbook.save("tables.xlsx")

Messy tables: pass strategies, or crop a region with page.within_bbox((x0, top, x1, bottom)) first:

ts = {
    "vertical_strategy": "lines",
    "horizontal_strategy": "lines",
    "snap_tolerance": 3,
    "intersection_tolerance": 15,
}
page.extract_tables(ts)

For very large PDFs where you only need raw text, pypdf's page.extract_text() is lighter.

Scanned / image-only PDFs (be honest)

If extract_text() returns empty or garbage (e.g. (cid:NN) runs) the page is scanned. No OCR engine (tesseract) is installed and network is off, so you cannot recover that text. Say so plainly and stop — do not fabricate content or attempt pip install.

Merge / split / rotate / crop / metadata (pypdf)

from pypdf import PdfReader, PdfWriter

# Merge
w = PdfWriter()
for f in ["a.pdf", "b.pdf"]:
    for p in PdfReader(f).pages:
        w.add_page(p)
w.write("merged.pdf")

# Split: one file per page
r = PdfReader("in.pdf")
for i, p in enumerate(r.pages, 1):
    w = PdfWriter()
    w.add_page(p)
    w.write(f"page_{i}.pdf")

# Rotate page 0 by 90 degrees clockwise
r = PdfReader("in.pdf")
w = PdfWriter()
r.pages[0].rotate(90)
w.add_page(r.pages[0])
w.write("rotated.pdf")
  • Metadata: PdfReader("in.pdf").metadata (.title, .author, ...).
  • Crop: set page.mediabox.left/bottom/right/top (points, origin y=0 at bottom).
  • Encrypt: w = PdfWriter(clone_from=PdfReader("in.pdf")); w.encrypt("userpw", "ownerpw"); w.write("enc.pdf").
  • Decrypt: r = PdfReader("enc.pdf"); r.decrypt("pw") if r.is_encrypted, then read/copy pages.

Watermark (stamp one page over every page):

from pypdf import PdfReader, PdfWriter

wm = PdfReader("stamp.pdf").pages[0]
r = PdfReader("in.pdf")
w = PdfWriter()
for p in r.pages:
    p.merge_page(wm)
    w.add_page(p)
w.write("stamped.pdf")

Create PDFs (reportlab)

Flowing document (preferred for text/reports/tables — handles pagination):

from reportlab.lib.pagesizes import letter
from reportlab.lib.styles import getSampleStyleSheet
from reportlab.lib import colors
from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle

styles = getSampleStyleSheet()
story = [
    Paragraph("Report Title", styles["Title"]),
    Spacer(1, 12),
    Paragraph("Body text. " * 20, styles["Normal"]),
]
data = [["Product", "Q1", "Q2"], ["Widgets", "120", "135"]]
tbl = Table(data)
tbl.setStyle(
    TableStyle(
        [
            ("BACKGROUND", (0, 0), (
अक्सर पूछे जाने वाले सवाल

क्या यह स्कैन की हुई PDF पढ़ सकती है?

स्किल स्कैन की हुई PDF के लिए OCR का ज़िक्र नहीं करती, इसलिए स्कैन पेज टेक्स्ट के रूप में शायद न निकलें।

क्या यह PDF फ़ॉर्म भर सकती है?

हाँ। यह PDF के फ़ॉर्म फ़ील्ड भर सकती है, और बिना फ़ील्ड वाले फ़्लैट फ़ॉर्म के लिए overlay इस्तेमाल कर सकती है।

क्या यह PDF पर पासवर्ड लगा सकती है?

हाँ। स्किल PDF को encrypt और decrypt करना, साथ में watermarks और metadata भी कवर करती है।

जानकारी

लेखक का मूल विवरण

Read, extract (text/tables), create, merge/split/rotate, watermark, encrypt, fill, and render-to-image .pdf files. Use whenever the user uploads a .pdf or asks to produce, edit, or pull data out of one.

repo: HKUDS/DeepTutor

लोकप्रियता

GitHub स्टार
54k
रैंकिंग में स्थान
#3369
लाइसेंस
Apache-2.0
अपडेट की गई
31/10/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

deeptutor-cli

54k

यह आपके एजेंट को कमांड लाइन से DeepTutor, एक लर्निंग प्लेटफ़ॉर्म, सेट करने और चलाने में मदद करती है, जिसमें knowledge bases, notebooks और web ऐप शामिल हैं।

अन्यविविध

docx

54k

आपके एजेंट को Word .docx फ़ाइलें पढ़ने, बनाने और संपादित करने में मदद करती है, जिनमें रिपोर्ट, टेबल, find-and-replace और comments के साथ tracked changes शामिल हैं।

लेखन और डॉक्यूमेंटPDF, Word और स्लाइड

pptx

54k

आपके एजेंट को PowerPoint deck बनाने, पढ़ने और संपादित करने देती है, जिनमें स्लाइड का टेक्स्ट, speaker notes, charts और images शामिल हैं।

लेखन और डॉक्यूमेंटPDF, Word और स्लाइड

skill-creator

54k

आपके एजेंट को DeepTutor skills लिखना या सुधारना सिखाती है, यानी वे छोटे निर्देश पैकेज जो AI को एक खास काम सिखाते हैं।

AI और एजेंटएजेंट

मिलती-जुलती skills