Python程序教程

您现在的位置是:首页 >  Python

当前栏目

解决python中导出的pdf不能编辑问题

解决,python,导出,pdf,不能,编辑,问题
2025-03-20 08:48:58 时间

python默认输出的pdf格式是type3,这种不能在 Adobe Illustrator中编辑文字等信息,需要改成type42.

import matplotlib as mpl
mpl.rcParams['pdf.fonttype'] = 42

或者直接更改matplotlib的默认设置: 找到matplotlib路径下的matplotlibrc文件,将matplotlibrc里pdf.fonttype : 3改成42

pdf.fonttype : 42 # Output Type 3 (Type3) or Type 42 (TrueType)