business-document-generator
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseBusiness Document Generator
商务文档生成器
Overview
概述
Generate professional business documents (Project Proposals, Business Plans, Annual Budgets) from high-quality PDF templates. Use the bundled Python script to fill templates with user-provided data and output polished PDF documents ready for distribution.
通过高质量PDF模板生成专业商务文档(项目提案、商业计划、年度预算表)。使用附带的Python脚本,将用户提供的数据填充到模板中,输出可直接分发的精美PDF文档。
When to Use This Skill
何时使用此Skill
Activate this skill when the user asks to:
- Create a business proposal or project proposal
- Generate a business plan document
- Develop an annual budget plan
- Create any professional business document based on the available templates
- Fill in business templates with specific data
当用户提出以下需求时,激活此Skill:
- 创建商务提案或项目提案
- 生成商业计划文档
- 制定年度预算计划
- 根据可用模板创建任何专业商务文档
- 用特定数据填充商务模板
Available Document Types
支持的文档类型
This skill supports three types of professional business documents:
-
Project Proposal - Professional proposals for client projects
- Template:
assets/templates/Professional Proposal Template.pdf - Use case: Pitching projects to clients, stakeholders
- Template:
-
Business Plan - Comprehensive business planning documents
- Template:
assets/templates/Comprehensive Business Plan Template.pdf - Use case: Startup planning, investor presentations, strategic planning
- Template:
-
Annual Budget - Detailed budget planning documents
- Template:
assets/templates/Annual Budget Plan Template.pdf - Use case: Financial planning, budget proposals, fiscal year planning
- Template:
此Skill支持三类专业商务文档:
-
项目提案 - 面向客户项目的专业提案
- 模板:
assets/templates/Professional Proposal Template.pdf - 使用场景:向客户、利益相关者推介项目
- 模板:
-
商业计划 - 全面的商业规划文档
- 模板:
assets/templates/Comprehensive Business Plan Template.pdf - 使用场景:初创企业规划、投资者演示、战略规划
- 模板:
-
年度预算表 - 详细的预算规划文档
- 模板:
assets/templates/Annual Budget Plan Template.pdf - 使用场景:财务规划、预算提案、财年规划
- 模板:
Quick Start Workflow
快速开始流程
Step 1: Understand User Requirements
步骤1:了解用户需求
Gather information from the user about:
- Document type needed (proposal, business plan, or budget)
- Key data to include (company name, client info, dates, etc.)
- Any specific customization needs
收集用户的以下信息:
- 需要的文档类型(提案、商业计划或预算表)
- 需包含的关键数据(公司名称、客户信息、日期等)
- 任何特定的定制需求
Step 2: Prepare the Data
步骤2:准备数据
Create a JSON file with the document data. Reference the data schemas in for field requirements.
references/document_schemas.mdExample for Proposal:
json
{
"title": "Digital Transformation Initiative",
"subtitle": "A Comprehensive Plan for Acme Corporation",
"client_org": "Acme Corporation",
"client_contact": "Jane Smith, CTO",
"company_name": "TechSolutions Inc.",
"contact_info": "contact@techsolutions.com",
"date": "November 3, 2025"
}Note: Check for complete example JSON files:
assets/examples/proposal_example.jsonbusiness_plan_example.jsonbudget_example.json
创建包含文档数据的JSON文件。参考中的数据架构了解字段要求。
references/document_schemas.md提案示例:
json
{
"title": "Digital Transformation Initiative",
"subtitle": "A Comprehensive Plan for Acme Corporation",
"client_org": "Acme Corporation",
"client_contact": "Jane Smith, CTO",
"company_name": "TechSolutions Inc.",
"contact_info": "contact@techsolutions.com",
"date": "November 3, 2025"
}注意: 完整的示例JSON文件可在中查看:
assets/examples/proposal_example.jsonbusiness_plan_example.jsonbudget_example.json
Step 3: Install Dependencies (First Time Only)
步骤3:安装依赖(首次使用)
The generation script requires Python packages. Install them:
bash
pip install pypdf reportlab生成脚本需要Python包,执行以下命令安装:
bash
pip install pypdf reportlabStep 4: Generate the Document
步骤4:生成文档
Run the generation script:
bash
python3 scripts/generate_document.py <document_type> <data_file> \
--templates-dir assets/templates \
--output-dir <output_directory>Parameters:
- : One of
<document_type>,proposal, orbusiness_planbudget - : Path to JSON file with document data
<data_file> - : Directory containing PDF templates (default:
--templates-dir)assets/templates - : Where to save generated PDFs (default:
--output-dir)output - : Optional custom filename
--output-filename
Example:
bash
python3 scripts/generate_document.py proposal my_proposal_data.json \
--templates-dir assets/templates \
--output-dir ./generated_docs运行生成脚本:
bash
python3 scripts/generate_document.py <document_type> <data_file> \
--templates-dir assets/templates \
--output-dir <output_directory>参数说明:
- :可选值为
<document_type>、proposal或business_planbudget - :包含文档数据的JSON文件路径
<data_file> - :存放PDF模板的目录(默认:
--templates-dir)assets/templates - :生成PDF的保存目录(默认:
--output-dir)output - :可选的自定义文件名
--output-filename
示例:
bash
python3 scripts/generate_document.py proposal my_proposal_data.json \
--templates-dir assets/templates \
--output-dir ./generated_docsStep 5: Deliver the Document
步骤5:交付文档
The script outputs a PDF file in the specified output directory. Verify the document was generated successfully and inform the user of the file location.
脚本会在指定的输出目录中生成PDF文件。验证文档生成成功后,告知用户文件位置。
Detailed Usage Instructions
详细使用说明
Creating a Project Proposal
创建项目提案
-
Collect proposal information:
- Project title and subtitle
- Client organization and contact
- Your company name and contact info
- Project details (problem, solution, timeline, budget)
-
Create a JSON data file with proposal fields (see)
references/document_schemas.md -
Run the script:bash
python3 scripts/generate_document.py proposal proposal_data.json \ --templates-dir assets/templates -
Output: Professional PDF proposal with cover page and content sections
-
收集提案信息:
- 项目标题和副标题
- 客户机构和联系人
- 贵公司名称和联系信息
- 项目详情(问题、解决方案、时间线、预算)
-
创建包含提案字段的JSON数据文件(参考)
references/document_schemas.md -
运行脚本:bash
python3 scripts/generate_document.py proposal proposal_data.json \ --templates-dir assets/templates -
输出结果:包含封面和内容章节的专业PDF提案
Creating a Business Plan
创建商业计划
-
Collect business plan information:
- Company name and legal structure
- Mission and vision statements
- Target market details
- Financial projections
-
Create a JSON data file with business plan fields
-
Run the script:bash
python3 scripts/generate_document.py business_plan plan_data.json \ --templates-dir assets/templates -
Output: Comprehensive business plan PDF template
-
收集商业计划信息:
- 公司名称和法律架构
- 使命和愿景声明
- 目标市场详情
- 财务预测
-
创建包含商业计划字段的JSON数据文件
-
运行脚本:bash
python3 scripts/generate_document.py business_plan plan_data.json \ --templates-dir assets/templates -
输出结果:全面的商业计划PDF模板
Creating an Annual Budget
创建年度预算表
-
Collect budget information:
- Fiscal year
- Company name
- Budget assumptions (inflation, growth targets)
- Revenue and expense forecasts
-
Create a JSON data file with budget fields
-
Run the script:bash
python3 scripts/generate_document.py budget budget_data.json \ --templates-dir assets/templates -
Output: Annual budget plan PDF with tables and projections
-
收集预算信息:
- 财年
- 公司名称
- 预算假设(通货膨胀、增长目标)
- 收入和支出预测
-
创建包含预算字段的JSON数据文件
-
运行脚本:bash
python3 scripts/generate_document.py budget budget_data.json \ --templates-dir assets/templates -
输出结果:包含表格和预测内容的年度预算表PDF
Important Notes
重要说明
Script Functionality
脚本功能
The script:
scripts/generate_document.py- Reads PDF templates from the assets directory
- Overlays user data on template pages (primarily cover pages)
- Generates a new PDF with filled information
- Preserves the original template structure and formatting
scripts/generate_document.py- 从assets目录读取PDF模板
- 在模板页面上叠加用户数据(主要是封面)
- 生成包含填充信息的新PDF
- 保留原始模板的结构和格式
Current Limitations
当前限制
The script currently fills in cover page information (titles, names, dates). The template body content serves as a professional framework that users can follow when creating their documents manually or through other PDF editing tools.
脚本目前仅填充封面信息(标题、名称、日期)。模板正文内容作为专业框架,用户可手动或通过其他PDF编辑工具补充内容。
Extending the Script
扩展脚本
To fill additional fields beyond the cover page, the script can be enhanced to:
- Parse form fields in PDFs
- Add text overlays on specific coordinates for each page
- Replace placeholder text programmatically
Modify to add more sophisticated PDF manipulation as needed.
scripts/generate_document.py若要填充封面以外的更多字段,可对脚本进行增强,实现:
- 解析PDF中的表单字段
- 在每个页面的特定坐标添加文本叠加层
- 以编程方式替换占位符文本
根据需要修改,添加更复杂的PDF操作功能。
scripts/generate_document.pyData Schema Reference
数据架构参考
For detailed information about required and optional fields for each document type, consult:
- - Complete data structure documentation
references/document_schemas.md
如需了解每种文档类型的必填和可选字段的详细信息,请参考:
- - 所有文档类型的完整数据结构文档
references/document_schemas.md
Example Files
示例文件
Find complete working examples in :
assets/examples/- - Sample project proposal data
proposal_example.json - - Sample business plan data
business_plan_example.json - - Sample budget plan data
budget_example.json
Use these as starting templates when creating new documents.
完整的可用示例位于:
assets/examples/- - 示例项目提案数据
proposal_example.json - - 示例商业计划数据
business_plan_example.json - - 示例预算计划数据
budget_example.json
创建新文档时,可将这些作为起始模板。
Troubleshooting
故障排除
Import errors when running the script:
- Install required packages:
pip install pypdf reportlab
Template not found:
- Verify points to
--templates-dirassets/templates - Check that PDF template files exist in the templates directory
Generated PDF is blank or missing data:
- Verify JSON data file is properly formatted
- Check that required fields are present (see )
references/document_schemas.md
Need to customize templates:
- Original templates are in
assets/templates/ - Modify templates using PDF editing software
- Keep original filenames or update in the script
TEMPLATE_MAP
运行脚本时出现导入错误:
- 安装所需包:
pip install pypdf reportlab
未找到模板:
- 验证指向
--templates-dirassets/templates - 检查模板目录中是否存在PDF模板文件
生成的PDF为空或缺少数据:
- 验证JSON数据文件格式正确
- 检查是否包含必填字段(参考)
references/document_schemas.md
需要定制模板:
- 原始模板位于
assets/templates/ - 使用PDF编辑软件修改模板
- 保留原始文件名,或更新脚本中的
TEMPLATE_MAP
Resources
资源说明
scripts/
scripts/
Contains the Python script for document generation:
- - Main document generation script with CLI interface
generate_document.py
This script can be executed directly without loading into context for token efficiency. It may be read if modifications or debugging are needed.
包含用于文档生成的Python脚本:
- - 带CLI界面的主文档生成脚本
generate_document.py
为提高令牌效率,可直接执行此脚本,无需加载到上下文。如需修改或调试,可读取脚本内容。
references/
references/
Documentation to reference while working:
- - Complete JSON data structure for all document types
document_schemas.md
工作时可参考的文档:
- - 所有文档类型的完整JSON数据结构
document_schemas.md
assets/
assets/
Files used in the document generation output:
- - Professional PDF templates for each document type
templates/Professional Proposal Template.pdfComprehensive Business Plan Template.pdfAnnual Budget Plan Template.pdf
- - Sample JSON data files demonstrating proper structure
examples/proposal_example.jsonbusiness_plan_example.jsonbudget_example.json
These templates and examples are not loaded into context but referenced during generation.
文档生成输出中使用的文件:
- - 每种文档类型的专业PDF模板
templates/Professional Proposal Template.pdfComprehensive Business Plan Template.pdfAnnual Budget Plan Template.pdf
- - 展示正确结构的示例JSON数据文件
examples/proposal_example.jsonbusiness_plan_example.jsonbudget_example.json
这些模板和示例不会加载到上下文,仅在生成过程中被引用。