360 Secure SkillHub
360 安全技能中心

PPTX PDF字体修复工具

该 Skill 用 Python 脚本读取 PPTX,为完全 opaque 的文本段应用 1% 透明度后输出修复后的 PPTX,以促使 PowerPoint 在导出 PDF 时正确嵌入自定义字体。仅修改幻灯片 XML,不修改版式或母版,可重复运行;PDF 导出仍需在 PowerPoint 桌面端完成。

分类:效率
chernojagne
chernojagne
热度 49.98
最近更新 2026-09-22 02:57:02

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add chernojagne/pptx-pdf-font-fix
兼容性
通用兼容
联网要求
不联网
数据出网
数据不出本机
Metadata
name
pptx-pdf-font-fix
description
Fix PowerPoint font embedding issues in PDF export by patching text transparency in PPTX files. Use when a user has a PPTX file where exported PDFs show wrong/default fonts instead of the intended downloaded/custom fonts, even with font embedding enabled. Works by applying minimal (1%) transparency to fully-opaque text runs, which forces PowerPoint to properly embed fonts during PDF export.

PPT Font Fix

Problem

PowerPoint's "Export to PDF" can fail to embed downloaded/custom fonts, substituting built-in defaults, even when:

  • Fonts are properly installed and embeddable
  • "Embed fonts in the file" is checked in PowerPoint options

Workaround

Applying a tiny transparency (1%) to text with 0% transparency forces PowerPoint to correctly embed fonts in PDF output. This is visually imperceptible but changes how PowerPoint processes the font during export.

Usage

python3 scripts/fix_font_transparency.py input.pptx [output.pptx] [--transparency 1]

Options

  • output -- Output PPTX path (default: input_fixed.pptx)
  • --transparency, -t -- Transparency % to apply (default: 1)

Behavior

  • Only patches text runs that are fully opaque (0% transparency)
  • Leaves text that already has any transparency untouched
  • Safe to run multiple times
  • Only modifies slide XML (ppt/slides/slideN.xml), not layouts/masters

Workflow

  1. Receive PPTX file from user
  2. Run the fix script: python3 scripts/fix_font_transparency.py input.pptx
  3. Return the patched PPTX to the user
  4. User opens patched file in PowerPoint and exports to PDF -- fonts now embed correctly

Note

PDF export must be done from PowerPoint desktop. Server-side converters (LibreOffice, Graph API) do not reproduce the same font embedding behavior.