我是在Adobe中使用Javascript的新手。我已经编写了捕获文件名的脚本,并将其作为标题添加到文档中,但问题是它不能拆分为两行长文件名。因此,长文本文件名超出了页面边框。
例如,文件名是“这是一个文本,我需要拆分成两行如何编写脚本,以便拆分长文本和适应页面”
这只是一个样本。我需要编辑什么?这是可能的吗?
var trFileName = this.documentFileName.replace(/.*\/|\.pdf$/ig,""); //remove .pdf extension
var pageAmount = this.numPages; //define how many pages are there
this.addWatermarkFromText({
cText: trFileName,
nStart: 0,
nEnd: pageAmount,
nFontSize: 18,
aColor: color.blue,
cFont: "Helvetica-Bold",
nTextAlign: app.constants.align.center,
nHorizAlign: app.constants.align.center,
nVertAlign: app.constants.align.top,
//nHorizValue: -25,
nVertValue: -87.87
})https://stackoverflow.com/questions/41303203
复制相似问题