返回顶部
b

byted-tos-doc-processTOS文档预览

Generates pre-signed URLs for Bytedance TOS `doc-preview` processing to preview and convert documents to PDF, images (PNG/JPG), or HTML, and to export page ranges. Use when the user needs TOS document preview/conversion, page count/export, or mentions doc-preview, x-tos-process, or x-tos-doc-* parameters.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
73
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

byted-tos-doc-process

Bytedance TOS Document Process Skill

This skill provides document processing functions for files in Bytedance's TOS via the doc-preview feature, implemented by generating pre-signed URLs with the Volcengine TOS SDK.

Note: This approach is necessary because the SDK's get_object method does not directly support doc_* keyword arguments. All document processing parameters must be passed as query parameters in a pre-signed URL.

Quick Start

1. Client Initialization

CODEBLOCK0

2. Basic Workflow (Pre-signed URL)

CODEBLOCK1

Core Operations

All document processing is achieved by generating a pre-signed URL with process=\"doc-preview\" and other x-tos-doc-* parameters in the query string.

1. Convert to PDF (x-tos-doc-dst-type='pdf')

Converts an entire document into a single PDF file.

CODEBLOCK2

2. Convert to Image (x-tos-doc-dst-type='png' or 'jpg')

Converts a specific page of a document into an image.

CODEBLOCK3

3. Convert to HTML (x-tos-doc-dst-type='html')

Fetches a temporary HTML page containing a token for the final preview URL. This requires a second step to parse the HTML and decode the token.

CODEBLOCK4

4. Batch Export Pages (image-mode=1)

Exports a range of pages as images directly to a TOS bucket.

CODEBLOCK5

Authorization

Authentication is handled by tos.TosClientV2. Provide credentials via environment variables.

Required Environment Variables

  • - INLINECODE10
  • INLINECODE11
  • INLINECODE12
  • INLINECODE13

Optional for STS

  • - INLINECODE14

Best Practices

  • - Error Handling: Always wrap HTTP requests in try...except blocks for HTTPError and URLError.
  • Parameter Reference: Refer to REFERENCE.md for a mapping of doc_preview_params.py arguments to x-tos-* query keys and to the official TOS documentation for authoritative details.
  • HTML Preview: Be aware of the two-step process and the custom domain requirement for recent buckets.
  • Total Pages Header: The x-tos-total-page header is a convenient way to get the page count.

Additional Resources

  • - For detailed parameters, see REFERENCE.md.
  • For end-to-end examples, see WORKFLOWS.md.
  • For executable Python examples, see the scripts/ directory.
  • For the definitive list of all processing parameters, always consult the official Volcengine TOS Document Preview documentation.

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 byted-tos-doc-process-1775935397 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 byted-tos-doc-process-1775935397 技能

通过命令行安装

skillhub install byted-tos-doc-process-1775935397

下载

⬇ 下载 byted-tos-doc-process v1.0.0(免费)

文件大小: 32.64 KB | 发布时间: 2026-4-12 09:15

v1.0.0 最新 2026-4-12 09:15
byted-tos-doc-process v1.1.0 – Adds doc-preview processing support via pre-signed URLs

- New SKILL.md describes generating pre-signed URLs to preview and convert documents in Bytedance TOS to PDF, image, or HTML formats.
- Explains handling of all doc-preview, x-tos-process, and x-tos-doc-* parameters as URL query parameters.
- Includes usage patterns for PDF/image/HTML conversion, exporting page ranges, and retrieving page count.
- Documents required authentication and best practices for error handling and parameter referencing.
- Adds links to further resources and code examples.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部