pdf

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
<instructions> <instructions>
<instructions> <instructions>

PDF Professional Suite

PDF专业工具套件

🛠 High-Fidelity Creation

🛠 高保真生成

When generating polished reports:
  1. Generate: Use Reportlab (programmatic) or Platypus (templated) as the primary engine.
  2. Preview: Convert every page to PNG for inspection:
    • pdftoppm -png -r 150 document.pdf page
  3. Inspect: Verify that charts, tables, and typography are sharp and well-aligned.
生成精美报告时:
  1. 生成:使用Reportlab(编程式)或Platypus(模板式)作为核心引擎。
  2. 预览:将每一页转换为PNG格式以便检查:
    • pdftoppm -png -r 150 document.pdf page
  3. 检查:确认图表、表格和排版清晰且对齐规整。

📋 Common Operations

📋 常见操作

1. Form Filling

1. 表单填写

  • Identify fillable fields using
    scripts/extract_form_field_info.py
    .
  • Reference: See
    references/forms.md
    for detailed instructions on filling PDF forms.
  • Populate fields programmatically and verify using the Render loop.
  • 使用
    scripts/extract_form_field_info.py
    识别可填写字段。
  • 参考文档:详见
    references/forms.md
    获取PDF表单填写的详细说明。
  • 通过编程方式填充字段,并使用渲染循环进行校验。

2. Manipulation (pypdf)

2. 文档编辑(pypdf)

  • Merge: Use
    PdfWriter
    to combine multiple documents.
  • Split: Extract individual pages into new files.
  • Secure: Add passwords or watermarks using
    PdfWriter.encrypt()
    .
  • Reference: See
    references/reference.md
    for advanced features and JS library alternatives.
  • 合并:使用
    PdfWriter
    合并多个文档。
  • 拆分:提取单页保存为新文件。
  • 加密:使用
    PdfWriter.encrypt()
    添加密码或水印。
  • 参考文档:详见
    references/reference.md
    获取高级功能及JS库替代方案。

3. Extraction (pdfplumber)

3. 内容提取(pdfplumber)

  • Extract text with layout preservation.
  • Extract complex tables directly into Pandas DataFrames for analysis.
  • 提取文本并保留原排版。
  • 将复杂表格直接提取为Pandas DataFrames以便分析。

💎 Quality Expectations

💎 质量要求

  • Legibility: Text must be readable at 100% zoom; avoid walls of dense text.
  • Polish: Maintain intentional visual design—consistent margins and color palettes.
  • Verification: Zero defects (black squares, clipped text) permitted in final output.
</instructions>
  • 可读性:文本在100%缩放比例下必须清晰可读;避免密集的大段文本。
  • 美观度:保持统一的视觉设计——一致的页边距和配色方案。
  • 校验标准:最终输出不允许存在任何缺陷(如黑块、文本截断)。
</instructions>