Pdfporter

io.github.CloudCorpRecords由 GitHub 帳號 CloudCorpRecords 發布v0.1.0更新於 Nov 5, 2026

Convert files/URLs to PDF via conv2pdf; writes output files locally and deletes conversion jobs.

已驗證STDIO僅桌面效率與工作流檔案與儲存

概覽

AI 產生的概覽

conv2pdf 服務的用戶端,可將本機檔案與網頁轉成 PDF,並對 PDF 進行合併、拆分、壓縮、加密等處理,結果寫回本機磁碟。

可以做什麼
  • 依副檔名把本機檔案轉成 PDF,或把公開網頁渲染成 PDF
  • 把 PDF 轉成可編輯的 Word 文件或逐頁 PNG/JPG 壓縮檔,並把 HEIC 照片轉成 JPG
  • 合併、拆分、依頁碼範圍擷取、旋轉、加頁碼與浮水印
  • 壓縮 PDF,設定或移除密碼及列印、複製限制
  • 查詢 API 金鑰的方案、用量與上限
適用情境
適合需要把 Office 文件、圖片、電子書或網頁轉成 PDF,或在使用者電腦上合併、拆分、壓縮、加浮水印、加密 PDF 而不必安裝本機文書軟體的情況。
執行需求
透過 npx 或 Docker 在本機執行。需在 CONV2PDF_API_KEY 提供 conv2pdf API 金鑰,並以 Bearer 方式送出;可選用 CONV2PDF_API_URL 與 CONV2PDF_TIMEOUT_MS。每次工具呼叫都需要連線到 conv2pdf API;沒有金鑰時伺服器仍可啟動,但呼叫會失敗。
安裝前請注意
每次轉換都會把輸入檔案或網址上傳到第三方 conv2pdf 服務,機密文件請審慎評估。protect_pdf 與 unlock_pdf 的密碼會傳送給該服務。工具會寫入磁碟檔案,並拒絕覆寫既有輸出。用量會計入 API 金鑰的方案配額。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Pdfporter,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

pdfporter

Files in, PDFs out — and PDFs reshaped. pdfporter is a client for the conv2pdf conversion service: it takes the path of a file on your computer, sends it for conversion, and writes the result back next to the original. Office documents, spreadsheets, presentations, images, e-books, PostScript and HTML files become PDFs; PDFs become Word documents or per-page images; and PDFs can be merged, split, page-extracted, rotated, numbered, watermarked, compressed, password-protected and unlocked.

Configuration

  • CONV2PDF_API_KEY (required for calls) — created in the conv2pdf dashboard, Developer tab. It is sent on every request as Authorization: Bearer <key>. Without a key the server still starts and lists its tools; any tool call fails with a message explaining how to set the key.
  • CONV2PDF_API_URL (optional) — API base URL. Defaults to https://api.conv2pdf.com/v1.
  • CONV2PDF_TIMEOUT_MS (optional) — per-request timeout in milliseconds. Defaults to 120000, because a conversion may legitimately take up to about a minute.

Tools

  • convert_to_pdf — convert a file to PDF, chosen from its extension: Word, Excel, PowerPoint, OpenDocument, Apple Pages, RTF, TXT and CSV files go through office-to-pdf; PNG, JPG, WebP, GIF and TIFF images through image-to-pdf; HEIC/HEIF photos through heic-to-pdf; EPUB through epub-to-pdf; PS/EPS through ps-to-pdf; HTML through html-to-pdf. An unknown extension fails locally, with no request made.
  • convert_url_to_pdf — render a public web page to PDF from its address. It always takes an output_path, because there is no input file to write next to.
  • convert_heic_to_jpg — an iPhone HEIC or HEIF photo as a JPG.
  • convert_pdf_to_word — a PDF with real text as an editable DOCX document. Pass password to open a protected PDF.
  • convert_pdf_to_images — one PNG (default) or JPG per page, delivered in a ZIP file.
  • merge_pdfs — combine 2 to 20 PDFs into one, in the order given in paths.
  • extract_pdf_pages — copy the pages listed in ranges (such as 1-5,7,10-12) into a new PDF, in the order written.
  • split_pdf — one PDF per page, in a ZIP file.
  • rotate_pdf — turn every page by rotation: 90, 180 or 270 degrees.
  • add_page_numbers — number the pages, as "3 / 12" (format: "full", the default) or "3" (format: "simple"), at position bottom-center (default), bottom-left or bottom-right.
  • add_watermark — stamp a text of up to 50 characters on every page.
  • compress_pdf — reduce the size, with quality low, medium (default) or high, keeping images at 72, 150 or 300 DPI.
  • protect_pdf — set a new password (6 to 64 characters), with prevent_print and prevent_copy to forbid printing or copying.
  • unlock_pdf — remove a password you know (pass it as password), or the printing and copying restrictions.
  • get_quota — the plan, usage and limits of the API key, returned verbatim.

Most PDF-reading tools accept an optional password that opens a protected PDF; the result has no password.

How a conversion behaves

  1. The input file is read locally and POSTed as multipart/form-data to <base>/convert/<api-tool>, the file in the file field plus the tool's fields as string fields.
  2. On HTTP 429 or 503 the server waits for the delay the API gives (the Retry-After header, else the body's retry_after seconds) and retries, at most twice and only for delays of 30 seconds or less.
  3. The convert response carries a job_id and a relative download_url; the result is downloaded from the API origin, written to disk, and the job is then deleted from the service on a best-effort basis.

Results are never overwritten. By default the output sits next to the input: a conversion swaps the extension (report.docx gives report.pdf), a PDF operation adds a suffix (report.pdf gives report-compressed.pdf for compress_pdf, report-images.zip for convert_pdf_to_images, and so on), and a merge writes merged.pdf next to the first input. When the target name is taken, (2), (3), ... is appended before the extension until a free name is found. With an explicit output_path, an existing file there is refused before anything is sent.

A successful conversion answers with a JSON summary: {"job_id": ..., "output_path": ..., "size_bytes": ...}, plus the quota object copied from the convert response when the service sends one. get_quota returns the service's response body verbatim.

Errors: a non-2xx reply fails with conv2pdf error: <error> when the body carries an error code, else conv2pdf error: HTTP <status>; an unreachable API fails with conv2pdf unreachable.

CLI

Each tool is a subcommand taking one JSON argument string:

bash
npx @reneturcios/pdfporter convert_to_pdf '{"path":"report.docx"}'npx @reneturcios/pdfporter convert_url_to_pdf '{"url":"https://example.com/article","output_path":"article.pdf"}'npx @reneturcios/pdfporter convert_heic_to_jpg '{"path":"IMG_0001.heic"}'npx @reneturcios/pdfporter convert_pdf_to_word '{"path":"report.pdf"}'npx @reneturcios/pdfporter convert_pdf_to_images '{"path":"report.pdf","format":"jpg"}'npx @reneturcios/pdfporter merge_pdfs '{"paths":["a.pdf","b.pdf"]}'npx @reneturcios/pdfporter extract_pdf_pages '{"path":"report.pdf","ranges":"1-5,7,10-12"}'npx @reneturcios/pdfporter split_pdf '{"path":"report.pdf"}'npx @reneturcios/pdfporter rotate_pdf '{"path":"scan.pdf","rotation":90}'npx @reneturcios/pdfporter add_page_numbers '{"path":"report.pdf","position":"bottom-right"}'npx @reneturcios/pdfporter add_watermark '{"path":"contract.pdf","text":"CONFIDENTIAL"}'npx @reneturcios/pdfporter compress_pdf '{"path":"big.pdf","quality":"low"}'npx @reneturcios/pdfporter protect_pdf '{"path":"confidential.pdf","password":"secret123","prevent_print":true}'npx @reneturcios/pdfporter unlock_pdf '{"path":"protected.pdf","password":"secret123"}'npx @reneturcios/pdfporter get_quota '{}'npx @reneturcios/pdfporter --version

Exit codes: 0 on success, 1 on a runtime error, 2 on a usage error.

MCP server

bash
npx -y @reneturcios/pdfporter mcp

MCP client config:

json
{  "mcpServers": {    "pdfporter": {      "command": "npx",      "args": ["-y", "@reneturcios/pdfporter", "mcp"],      "env": {        "CONV2PDF_API_KEY": "<your key>"      }    }  }}

Docker

bash
docker run -i ghcr.io/cloudcorprecords/pdfporterdocker run --rm ghcr.io/cloudcorprecords/pdfporter get_quota '{}'

Development

bash
npm installnpm run build   # tsc -> dist/npm test        # tsx --test test/*.test.ts (fake fetch only, no network)npm run dev     # run the CLI from source

License

MIT — Copyright (c) 2026 Rene Turcios

來源:README.md,提交 6294b71

工具

15

convert_to_pdf

Word, Excel, PowerPoint, OpenDocument, Apple Pages, RTF, TXT, CSV, PNG, JPG, WebP, GIF, TIFF, HEIC, EPUB, PostScript (PS, EPS) or HTML file to PDF, chosen from the extension. Reads the local file, uploads it to the conv2pdf API, writes the converted PDF to output_path (or next to the input) and deletes the conversion job afterwards.

輸入參數path必填output_path

convert_url_to_pdf

Public web page to PDF, from its address, printed as a browser would. Sends the URL to the conv2pdf API, writes the resulting PDF to the local output_path and deletes the conversion job afterwards.

輸入參數url必填output_path必填

convert_heic_to_jpg

iPhone HEIC or HEIF photo to JPG. Reads the local file, uploads it to the conv2pdf API, writes the JPG to output_path (or next to the input) and deletes the conversion job afterwards.

輸入參數path必填output_path

convert_pdf_to_word

PDF with real text to an editable DOCX document. Reads the local file, uploads it to the conv2pdf API, writes the DOCX to output_path (or next to the input) and deletes the conversion job afterwards.

輸入參數path必填passwordoutput_path

convert_pdf_to_images

One PNG or JPG per page, in a ZIP file. Reads the local file, uploads it to the conv2pdf API, writes the ZIP to output_path (or next to the input) and deletes the conversion job afterwards.

輸入參數path必填formatpasswordoutput_path

merge_pdfs

Combine several PDFs into one, in the order given. Reads the local files, uploads them to the conv2pdf API, writes the merged PDF to output_path (or next to the first input) and deletes the conversion job afterwards.

輸入參數paths必填output_path

extract_pdf_pages

Copy the pages you list, such as 1-5,7,10-12, into a new PDF, in the order written. Reads the local file, uploads it to the conv2pdf API, writes the new PDF to output_path (or next to the input) and deletes the conversion job afterwards.

輸入參數path必填ranges必填passwordoutput_path

split_pdf

One PDF per page, in a ZIP file. Reads the local file, uploads it to the conv2pdf API, writes the ZIP to output_path (or next to the input) and deletes the conversion job afterwards.

輸入參數path必填passwordoutput_path

rotate_pdf

Turn every page by 90, 180 or 270 degrees. Reads the local file, uploads it to the conv2pdf API, writes the rotated PDF to output_path (or next to the input) and deletes the conversion job afterwards.

輸入參數path必填passwordrotation必填output_path

add_page_numbers

Number the pages, as "3 / 12" or "3", bottom center, left or right. Reads the local file, uploads it to the conv2pdf API, writes the numbered PDF to output_path (or next to the input) and deletes the conversion job afterwards.

輸入參數path必填formatpasswordpositionoutput_path

add_watermark

Stamp a text of up to 50 characters on every page. Reads the local file, uploads it to the conv2pdf API, writes the watermarked PDF to output_path (or next to the input) and deletes the conversion job afterwards.

輸入參數path必填text必填passwordoutput_path

compress_pdf

Reduce the size, keeping images at 72, 150 or 300 DPI. Reads the local file, uploads it to the conv2pdf API, writes the compressed PDF to output_path (or next to the input) and deletes the conversion job afterwards.

輸入參數path必填qualitypasswordoutput_path

protect_pdf

Set a password, and optionally forbid printing or copying. Reads the local file, uploads it to the conv2pdf API, writes the protected PDF to output_path (or next to the input) and deletes the conversion job afterwards.

輸入參數path必填password必填output_pathprevent_copyprevent_print

unlock_pdf

Remove a password you know, or the printing and copying restrictions. Reads the local file, uploads it to the conv2pdf API, writes the unlocked PDF to output_path (or next to the input) and deletes the conversion job afterwards.

輸入參數path必填passwordoutput_path

get_quota

Plan, usage and limits of the API key

無需輸入參數。

版本歷史

1
  1. v0.1.0最新Nov 5, 2026

評分

已滿足適用檢查項的 90%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分