在线预览 多格式文档统一预览与标注工具 AI 提示词 (Prompts)

这组 Prompts 专注于“在线预览”类在线工具:把用户上传或从对象存储读取的文件(PDF/DOCX/PPTX/Markdown/TXT 等)在浏览器里稳定预览,并提供检索、批注、分享、权限与审计等能力。

每条 Prompt 都要求 AI 交付:完整项目代码、清晰文件树、可复现的运行命令、Docker 部署说明、以及不少于 5 条测试用例或 QA checklist。你可以把这些 Prompts 直接丢给 AI,让它输出一个可运行的在线工具工程。

在线 PDF 预览 + 缩略图 + 文内搜索 工具

适合客服/工单系统快速查看附件 PDF,支持页缩略图与关键词搜索。

英文 Prompt:

Build a production-ready web app named "pdf-preview-search" for online PDF preview. Requirements: (1) Tech stack: Next.js 14 + Type + pnpm; server API routes for signed URL fetching; (2) Features: upload PDF or load via URL, page thumbnails, zoom, rotate, text search with highlight, page navigation, dark mode; (3) Security: file size limits, MIME validation, disable SSRF when loading by URL, content-security-policy notes; (4) Output: full repository code, explicit file tree, step-by-step run commands (dev/build/start), and Dockerfile + docker-compose; (5) Testing: provide at least 5 tests or QA checklist items covering upload, search, navigation, large file performance, and error handling. Include README with troubleshooting.

中文释义: 让 AI 输出一个可直接跑起来的 PDF 在线预览工程,具备缩略图、搜索高亮与安全校验,并附带部署与测试清单。

在线 DOCX 预览(保留基本样式)工具

适合内部流程文档、合同草稿在线预览,重点是“可读性稳定”和“样式不乱”。

英文 Prompt:

Create a web tool "docx-viewer" that previews DOCX files in the browser. Use Node.js (Express) + Vite + React + Type . Implement: upload DOCX, server-side conversion to sanitized HTML (use a safe library), render with CSS for pagination-like layout, table/image handling, and a "download as HTML" option. Provide: full code, file tree, commands, Docker deployment, and at least 5 test cases/QA checks (malformed DOCX, big tables, embedded images, XSS sanitization, concurrency). Add a README describing limits and how to improve fidelity.

中文释义: 让 AI 给出 DOCX 在线预览工具:上传后转换为安全的 HTML 并渲染,考虑表格/图片与 XSS 清洗,附带部署与 QA。

在线 PPTX 预览(逐页切换)工具

适合销售/培训材料在线查看,提供页码跳转、缩略图与演示模式。

英文 Prompt:

Implement "pptx-slide-viewer" as a web app to preview PPTX online. Stack: React + Type + Vite, with a Node.js backend for PPTX parsing/rendering to SVG or HTML (must not generate new images; only render existing slide content). Features: slide thumbnails, next/prev, jump to slide, full-screen presentation mode, and shareable for a stored file. Deliver: full project code + file tree + run/build commands + Dockerfile. Provide a QA checklist (>=5) including large deck performance, font fallback, embedded media handling, and security considerations.

中文释义: 让 AI 输出可运行的 PPTX 在线预览工具,重点做“逐页预览与演示”,并兼顾性能与安全。

在线 Markdown 预览(含 Mermaid/KaTeX 开关)工具

适合技术文档/知识库,支持实时渲染与安全策略(禁用危险 HTML)。

英文 Prompt:

Build "markdown-preview-safe": an online Markdown preview tool. Stack: SvelteKit + Type . Requirements: upload or paste Markdown, preview with GitHub-flavored Markdown, optional Mermaid and KaTeX rendering toggles, table of contents, and export sanitized HTML. Security: disallow raw HTML by default, sanitize s, prevent XSS. Output: complete repo, file tree, commands, Docker deployment, and >=5 tests/QA checks (XSS attempts, large docs, Mermaid toggle, export correctness, broken syntax). Provide a concise README.

中文释义: 让 AI 交付一个安全的 Markdown 在线预览工程,支持可选 Mermaid/公式渲染与导出,并给出测试/QA。

多格式附件统一预览(文件类型识别 + 路由)工具

适合工单/网盘/知识库的“一个入口看所有附件”,按类型路由到对应预览器。

英文 Prompt:

Design and implement "universal-attachment-preview". Stack: Next.js + Type + Node API. Implement a unified upload endpoint that stores files locally (dev) and supports S3-compatible storage (prod). Detect file type by magic bytes + extension. Route to viewers: PDF viewer, Markdown viewer, plain text viewer, and a fallback download page. Provide complete code, file tree, env config, run commands, Docker compose with MinIO, and >=5 tests/QA checks for type detection, unsupported types, storage config, permission checks, and error states.

中文释义: 让 AI 做一个“统一附件预览入口”,包含上传、类型识别、对象存储接入、以及多种预览器的路由整合。

在线批注(高亮/评论)层:基于 PDF 预览叠加标注

适合审阅流程:在预览基础上增加批注与讨论,不改动原文件内容。

英文 Prompt:

Extend a PDF preview web app to support annotations. Build "pdf-annotation-layer" with React + Type . Use PDF.js for rendering and implement an overlay for highlights and sticky-note comments stored in a data (SQLite for dev, Postgres for prod). Provide: schema/migrations, REST API, auth (simple email magic or password), permissions (viewer vs commenter), export annotations as JSON, Docker compose, and >=5 tests/QA checks including concurrent edits, permission enforcement, and data integrity.

中文释义: 让 AI 输出“可落库的在线批注层”方案:高亮与评论可保存、权限区分、并能导出标注数据。

分享链接与权限控制:一次性链接/过期时间/水印提示 工具

适合对外分享预览链接:可控有效期与权限,减少附件外泄风险。

英文 Prompt:

Create "secure-preview-share": a service that generates share s for previewing existing documents. Stack: NestJS + Type + Postgres + Redis. Requirements: create share token with expiration, optional one-time access, IP rate limiting, and viewer watermark text overlay (text-only watermark; no image generation). Integrate with a simple React front-end that loads the file via signed URL and embeds the appropriate viewer (PDF/Markdown/text). Deliver full code, migrations, Docker compose, and >=5 tests/QA checks covering token expiry, one-time access, rate limiting, and audit logging.

中文释义: 让 AI 给出“可控分享链接”的在线预览服务:过期/一次性/限流/审计,并用文本水印提示,带全套部署与测试。

全文检索:为预览文件建立索引并提供搜索结果定位

适合知识库/档案库:先搜索再预览,并定位到页面/段落。

英文 Prompt:

Build "preview-with-search-index". Stack: FastAPI + Python + Elasticsearch (or OpenSearch) + a minimal React UI. Implement: upload PDFs and Markdown, extract text (no OCR), index content, search UI with snippets, click to open preview page and highlight matched terms. Provide: complete repo, file tree, run commands, docker-compose for services, and >=5 tests/QA checks including indexing pipeline, search relevance, large file handling, and security notes.

中文释义: 让 AI 输出“可检索可定位”的在线预览工具:上传后建立索引、搜索命中后跳转预览并高亮。

审计日志与下载控制:谁看了什么、何时、是否下载

适合企业内控:把预览行为记录下来,并对下载做策略控制。

英文 Prompt:

Implement "preview-audit-control". Stack: Go (Gin) backend + Postgres + React frontend. Features: user login, document list, preview page, event tracking (view/open/page-change/download-attempt), admin audit dashboard with filters, and download policy toggles per document. Deliver full code, migrations, Docker deployment, and >=5 tests/QA checks for audit integrity, permission changes, and edge cases (anonymous access blocked, token refresh, etc.).

中文释义: 让 AI 交付“可审计的在线预览系统”:记录预览/下载行为,后台可查询,权限变更可控。

企业内网部署版:反向代理 + HTTPS + 对象存储 + 备份脚本

适合落地到内网或私有云:给出从开发到上线的一整套部署与运维说明。

英文 Prompt:

Create a deployment-focused template "intranet-doc-preview-stack". Stack: a document preview web app (choose a simple viewer) + Nginx reverse proxy + HTTPS with self-managed certificates + S3-compatible storage + Postgres. Provide: docker-compose, environment variables, health checks, backup s for data and storage data, and a QA checklist (>=5) for deploy verification, restore drill, and security hardening notes. Include a README with step-by-step commands.

中文释义: 让 AI 交付“可在企业内网部署”的在线预览栈:包含反代、HTTPS、对象存储、备份恢复与上线验收清单。

用户评论 (0)

登录后参与讨论

立即登录 注册账号

暂无评论,快来抢沙发吧~

操作成功