Skip to main content

一键将当前PPT的页面导出为PDF,并自动裁剪白边。

Project description

PPT2Fig

PPT2Fig 是一个简单实用的工具,可以快速将 当前打开的PowerPoint的当前页面 导出为矢量PDF文件,并自动裁剪白边。非常适合科研人员在使用PPT作图时,修改PPT后快速导出PDF插入到论文中。

PPT2Fig is a simple and practical tool that can quickly export the current page of the currently opened PowerPoint to a vector PDF file and automatically crop the white edge. It is very useful for scientific researchers to quickly export PDF after modifying PPT and inserting it into the paper.

功能特点

  • 一键导出当前 PPT 页面为 PDF
  • 自动检测 PowerPoint 运行状态
  • 简洁的界面设计,默认一键操作
  • 可展开的高级裁剪设置:
    • 快速预设:紧密裁剪、小白边、中白边、保留原边距
    • 可调整保留原始边距的百分比
    • 可设置额外的白边大小
    • 可调整背景检测阈值
    • 支持统一裁剪和统一页面大小选项
  • 智能记忆上次保存路径
  • 始终置顶显示,方便操作

安装方法

  1. 直接下载Releases中的exe文件,双击即可运行

  2. 如果你有python环境,可以使用pip安装

pip install ppt2fig

然后运行

ppt2fig

或者

python -m ppt2fig

使用方法

程序运行后会出现一个简洁的界面:

screenshot

基本使用(适合大多数用户):

  1. 点击"转PDF"按钮(请确保点击时PowerPoint是打开的)
  2. 选择保存位置并点击"保存",则当前活跃的PPT页面会导出为PDF文件并自动裁剪白边
  3. 默认保存路径为当前活跃PPT文件所在目录

高级设置(需要精细控制时):

点击"▼ 显示高级设置"展开详细参数控制:

快速设置预设:

  • 紧密裁剪: 完全去除白边
  • 小白边: 保留约1mm白边
  • 中白边: 保留约2mm白边
  • 保留原边距: 保留10%的原始边距

详细参数设置:

  1. 保留原始边距(%): 设置保留原PDF边距的百分比

    • 0% = 完全去除边距(紧密裁剪)
    • 10% = 保留10%的原始边距
    • 适合对有一定边距的PDF进行微调
  2. 额外白边(bp): 在裁剪后额外增加的白边大小

    • 单位为 bp (big points),1bp ≈ 0.35mm
    • 适合需要为图片添加统一白边的场景
  3. 检测阈值: 背景检测的阈值设置 (0-255)

    • 默认值191适合大多数情况
    • 值越小检测越严格,适合灰色背景
    • 值越大检测越宽松
  4. 裁剪选项:

    • 统一裁剪: 所有页面使用相同的裁剪量
    • 统一页面大小: 所有页面设为相同尺寸

系统要求

  • Windows 操作系统
  • Microsoft PowerPoint
  • Python 3.8+

依赖项(安装时自动安装)

  • comtypes: 用于与PowerPoint交互
  • pdfCropMargins: 裁剪PDF白边
  • tkinter: python自带

注意事项

  • 使用前请确保已经打开 PowerPoint
  • 确保当前 PowerPoint 中有打开的演示文稿
  • 导出过程中请勿关闭 PowerPoint

编译指南

  1. 下载源码
  2. 创建一个环境,只安装本项目依赖和pyinstaller
  3. 参考配置upx配置upx,用于压缩exe文件
  4. 编译
pyinstaller -F -w -n ppt2fig --optimize=2 ppt2fig/main.py 

许可证

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ppt2fig-1.0.2-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file ppt2fig-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: ppt2fig-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for ppt2fig-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3cdd50f6e6cf600690f8805c7324e9140853d62c7417f1801cda02817c0aebe4
MD5 35d3a91a0b9c510e70533384da095133
BLAKE2b-256 45ddcfcf6f4013814c863a843a7d1527434ff21ac11b2398329b7a0ae350e2df

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page