PDF 和.indd文件的字体列表

list of fonts for a pdf and .indd file

本文关键字:字体 列表 文件 indd PDF      更新时间:2023-09-26

我必须创建一个应用程序,该应用程序可以在Excel工作表中获取pdf和.indd文件的字体列表。经过大量研究,我开始知道使用C#是不可能的。我在Visual Studio中遇到了Indesign Navigator API,它可以集成到VS IDE中。我知道C#,javascript有什么方法可以做到这一点,并且可以在MAC和Windows操作系统上运行。 谢谢!!

执行此操作的一种

方法是将文本文件与字体信息一起保存 InDesign 和 Acrobat 之外。您可能可以使用扩展脚本来执行此操作。然后,可以将文本文件作为 csv 或文本文件(空格分隔)轻松导入到 Excel 中。

您不太清楚自己的意图是什么,但这里有一个 JavaScript 示例,它可以从 InDesign 中提取字体信息以保存文档的字体列表。

var doc = app.activeDocument;
var docFonts = doc.fonts.everyItem().getElements();
var fileContents = "";
for (var i=0; i < docFonts.length; i++) {
   var font = docFonts[i];
   fileContents += font.name + "'n";
};
var newFilePath = doc.filePath + "/" + doc.name.replace(/'.indd/,'') + "_fonts.txt";
var newFile = File(newFilePath);
newFile.open('w')
newFile.write(fileContents);

这里有一个可能的方法...可以写出 InDesign 文件的 XML 表示...

要生成 IDML,choose File > Export Format: InDesign Markup (INDML)...

这是一个包含所有信息的拉链。

有一个文件夹Resources其中包含Fonts.xml(资源:字体.xml)

这可以跨平台解析,因为它只是XML...

在这里,您可以找到INDML InDesign文档的解剖结构说明...http://www.indesignsecrets.com/downloads/Anatomy_of_IDML.pdf

希望这有帮助...