Graphrt

PDF Tools

Jumlah halaman dan metadata, ekstraksi teks, gabung, ambil atau pisah halaman, putar, watermark teks dan gambar ke PDF. Parsing di worker yang bisa dihentikan dengan batas heap, batas halaman, hanya membuat file output baru

Stabil v0.1.0 Node.js 8 aksi
Pakai di Graphrt Desktop

Tentang

Plugin Graphrt untuk file PDF lokal. Workflow dan agent bisa membaca jumlah halaman, metadata dan teks sebuah PDF, serta membuat PDF baru dengan menggabung, mengambil, memisah, memutar, memberi watermark atau dari gambar. Memakai pdf-lib untuk struktur dan pdfjs-dist dari Mozilla (build legacy) untuk teks. Setiap hasil adalah file baru di satu folder output.

Yang bisa dilakukan

  • info: page count, encrypted, title, author, subject, keywords, creator, producer, creation and modification dates, and the size and rotation of up to 100 pages.
  • extract_text: the text layer per page for pages (e.g. "1-3,5,8-"), capped by max_chars (default 100000) with a truncated flag. There is no OCR: scanned pages come back empty (use the ocr-tesseract plugin).
  • merge: 2–50 PDFs in order.
  • extract_pages: the selected pages, in the order given ("3,1-2"), into one PDF.
  • split: one PDF per entry of ranges (["1-2", "3-"]), or every every pages (default one file per page), at most 200 files.
  • rotate: 90, 180 or 270 degrees clockwise, added to each selected page's rotation.
  • watermark: a Helvetica text line (Latin-1 characters) with font_size, opacity, angle, color and placement (center, top, bottom) on the selected pages.
  • images_to_pdf: jpeg/png images, one per page, at their own size (fit) or scaled into A4/Letter with a margin.

Aksi

Setiap aksi adalah langkah yang bisa ditambahkan ke workflow. Agent juga bisa memakai sebagian besar aksi sebagai tool.

  • Read PDF info pdf-tools.info
  • Extract PDF text pdf-tools.extract_text
  • Merge PDFs pdf-tools.merge
  • Extract pages pdf-tools.extract_pages
  • Split a PDF pdf-tools.split
  • Rotate pages pdf-tools.rotate
  • Add a text watermark pdf-tools.watermark
  • Images to PDF pdf-tools.images_to_pdf

Pengaturan

Graphrt menyalakan plugin dengan environment yang bersih. Hanya nilai ini yang sampai ke plugin, dan secret tidak masuk log.

  • PDF_TOOLS_INPUT_DIRS (required)
    Comma-separated directories (absolute or ~/...) that files may be read from, subdirectories included
  • PDF_TOOLS_OUTPUT_DIR (none)
    Existing directory for outputs. Without it only info and extract_text work. Outputs can be read back as inputs.
  • PDF_TOOLS_MAX_INPUT_BYTES 100 MiB
    Largest input file
  • PDF_TOOLS_MAX_OUTPUT_BYTES 200 MiB
    Largest output, nothing is written above it
  • PDF_TOOLS_MAX_PAGES 2000
    Most pages per input, and per merged output
  • PDF_TOOLS_TIMEOUT_MS 120000
    Per call (1000 to 280000), the worker process is killed when it passes
  • PDF_TOOLS_MAX_MEMORY_MB 1024
    Memory budget of the worker process: heap cap and resident-memory (RSS) watchdog
  • PDF_TOOLS_MAX_TOTAL_INPUT_BYTES 200 MiB
    Most bytes read in one call across all inputs (merge, images_to_pdf)

Cara memakainya

Di Graphrt Desktop

  1. Buka Plugins dan cari PDF Tools.
  2. Klik Install lalu setujui.
  3. Ikuti langkah setup di halaman plugin, lalu tempel pengaturan yang dibutuhkan.
  4. Jelaskan pekerjaan yang membutuhkannya, dan builder menambahkan langkahnya.
Plugin di Graphrt Desktop

Dengan CLI

terminal
$ graphrt plugin install pdf-tools
workflow.yaml
- id: pdf_tools
  type: pdf-tools.info
Plugin di docs