微算力 · API 导航与自营网关
API 接入 EN
未登录登录
🔒

PDF 一键安全扁平化,消除隐患

Make PDF safe · v1.0.0
办公 安全 B 级 作者 crossservicesolutions 公开目录收录
1.8k 下载 0 安装 5.2k 收藏 10 浏览

简介

通过Solutions API将PDF扁平化为安全版本,消除交互元素与脚本风险,返回可下载链接。

原始描述

Flatten a PDF into a non-interactive “safe” version by uploading it to the Solutions API, polling until completion, then returning a download URL for the flattened PDF.

通过你的 Agent 添加

点「快速安装」复制一段指令,粘给你正在用的 Agent(Claude Code、Codex、OpenClaw 等),它会自己完成安装。

或者手动安装

Claude Codeunzip -o skill.zip -d ~/.claude/skills/make-pdf-safe/
其它 Agent解压到它自己的 skills 目录,目录名用 make-pdf-safe

包里是 SKILL.md 加作者附带的文件,解压后目录名就是技能名。 技能申请的权限由作者决定,装之前请确认它能读什么、能执行什么。

中文使用说明 来自收录源

核心用法

make-pdf-safe skill 旨在将用户上传的 PDF 文件转换为"安全"的扁平化版本。其工作流程分为四步:

  1. 接收输入:获取用户提供的 PDF 文件及 API Key(Bearer Token 认证)
  2. 上传任务:通过 POST /api/41 以 multipart/form-data 格式提交文件至 Solutions API
  3. 轮询状态:持续查询任务进度直至完成
  4. 返回结果:输出包含 job_id、status、download_url 的结构化数据

显著优点

  • 安全风险降低:有效移除或中和 PDF 中的交互元素(JavaScript、表单动作等),防止恶意脚本执行
  • 内容保护:扁平化处理使底层对象结构不可编辑,类似"打印输出"的静态效果
  • 标准化输出:统一的结构化返回格式,便于下游系统集成
  • MIT 许可:开源友好,商业使用限制较少

潜在缺点与局限性

  • 外部依赖:核心功能完全依赖 Cross-Service-Solutions 第三方 API,存在服务可用性风险
  • 隐私顾虑:PDF 内容需上传至外部服务器处理,敏感文档存在数据泄露隐患
  • 网络开销:轮询机制增加了延迟,大文件处理时间不可控
  • 功能损耗:交互表单、超链接等合法功能将被一并移除,需权衡安全性与可用性
  • API 成本:依赖第三方商业服务,可能存在调用费用或配额限制

适合人群

  • 企业安全团队:需要安全分发 PDF 文档的场景
  • 内容发布平台:接收用户上传 PDF 时的安全预处理
  • 法律/金融行业:处理敏感文档时需消除隐藏元数据和交互层
  • 开发者构建文档安全处理流水线

常规风险

风险类别 说明 缓解建议
数据泄露 文件上传至第三方服务器 评估数据分级,避免上传机密级以上文档
服务中断 外部 API 故障导致不可用 设计降级策略,保留原始文件处理备选方案
密钥暴露 API Key 管理不当 严格遵循"永不回显或记录 API Key"规则
处理失败 复杂 PDF 可能无法正确扁平化 验证输出结果完整性,保留原始文件校验机制

技术规格

  • 兼容性: agentskills >=0.1.0
  • 所需工具: http, files
  • 认证方式: Bearer Token (API Key)

技能正文


name: make-pdf-safe description: Flatten a PDF into a non-interactive “safe” version by uploading it to the Solutions API, polling until completion, then returning a download URL for the flattened PDF. license: MIT compatibility: agentskills: ">=0.1.0" metadata: category: document-security tags: - pdf - flatten - sanitize - security - cross-service-solutions provider: Cross-Service-Solutions (Solutions API) allowed-tools:

  • http
  • files

make-pdf-safe

Purpose

This skill creates a “safe” PDF by converting the document into a single flattened layer without active functionality. The goal is to reduce risk from interactive PDF features.

In practical terms, the output PDF is intended to:

  • remove or neutralize interactive elements (e.g., scripts/actions),
  • prevent editing of underlying objects/content structure,
  • behave like a flattened document layer (similar to a “print” representation).

This skill:

  1. accepts a PDF file from the user,
  2. uploads it to the Solutions API,
  3. polls the job status until it is finished,
  4. returns the download URL for the “safe” flattened PDF.

Credentials

The API requires an API key used as a Bearer token:

  • Authorization: Bearer <API_KEY>

How the user gets an API key:

Rule: never echo or log the API key.

API endpoints

Base URL:

  • https://api.xss-cross-service-solutions.com/solutions/solutions

Create make-safe job:

  • POST /api/41
  • multipart/form-data parameters:
    • file — required — PDF file

Get result by ID:

  • GET /api/<ID>

When done, the response contains:

  • output.files[] with { name, path } where path is a downloadable URL.

Inputs

Required

  • PDF file (binary)
  • API key (string)

Optional

  • None

Output

Return a structured result:

  • job_id (number)
  • status (string)
  • download_url (string, when done)
  • file_name (string, when available)

Example output:

{
  "job_id": 4101,
  "status": "done",
  "download_url": "https://.../safe.pdf",
  "file_name": "safe.pdf"
}

正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。

标签

pdfflattensanitizesecuritycross-service-solutionsdocument-processingapi-integration

同类 Skill