【问题标题】:InDesign Server Crashing on Data MergeInDesign Server 在数据合并时崩溃
【发布时间】:2018-09-18 14:04:54
【问题描述】:

我正在尝试与 InDesign Server 进行非常基本的数据合并,但一直出现崩溃。 我以./InDesignServer -port 18383 开头的服务器没有问题。 我用./sampleclient ./scripts/test.jsx 调用脚本 .jsx 看起来像这样:

var source = File("/Users/me/Desktop/InDesign Server/example/example.indd")
var destination = File("/Users/me/Desktop/InDesign Server/example/example.pdf")
var sourceData = File("/Users/me/Desktop/InDesign Server/example/example.csv")
var doc = app.open(source);

doc.dataMergeProperties.selectDataSource(sourceData);
doc.dataMergeProperties.dataMergePreferences.recordNumber = 1;
doc.dataMergeProperties.mergeRecords(); // <-- Crashes here

var myPDFExportPreset = app.pdfExportPresets.item(0);
app.documents.item(0).exportFile(ExportFormat.pdfType, destination, false, myPDFExportPreset);
app.documents.item(0).close(SaveOptions.no);
doc.close(SaveOptions.no);

InDesign Server 响应:

Tue Sep 18 09:48:21 2018 INFO   [javascript] Executing Script
./InDesignServer: line 13: 30363 Segmentation fault: 11  "$installed_name" "$@"

然后崩溃。该脚本在 InDesign CC Desktop 中运行良好。服务器似乎在 .mergeRecords() 调用上崩溃。任何想法为什么?

编辑:我已将代码修改为 1) 文件路径中没有空格 2) 在执行合并之前检查我的对象是否全部存在。

var source = File("/Users/me/Desktop/example/example.indd");
var destination = File("/Users/me/Desktop/example/example.pdf");
var sourceData = File("/Users/me/Desktop/example/example.csv");

var doc = app.open(source);
doc.dataMergeProperties.selectDataSource(sourceData);

if (source.exists && destination.exists && sourceData.exists) {
    try {
        app.consoleout("Performing merge...");
        doc.dataMergeProperties.mergeRecords(); // <-- Crashes here
    } catch (err) {
        app.consoleout(err);
    }
} else {
    app.consoleout("Something doesn't exist...");
}

它记录“正在执行合并...”,因此我的文件路径确实指向存在的文件。更重要的是,它充满了崩溃,并且不报告任何错误。

编辑 2: 需要注意的是,这是启动 sampleclient 的终端窗口从 IDS 得到的错误:Error -1 fault: SOAP-ENV:Client [no subcode] "End of file or no input: Operation interrupted or timed out" Detail: [no detail]

【问题讨论】:

  • 可能是文件路径的问题。如果 sourceData 存在,请在脚本中测试。我在服务器上指定了完整路径。
  • 检查是否需要转义路径中的空格字符。使用前检查所有对象是否有效
  • 文件路径没问题。首先,我切换到 HFS(不是 POSIX),仍然在桌面上工作,仍然崩溃服务器。我在那里放了一个 if(),source.exists && destination.exists && sourceData.exists,它通过了这些测试,控制台输出“所有文件都存在”。 @NicolaiKant 你的文件是如何定位的,你使用的是什么类型的路径?
  • 尝试包含完整路径,例如“/Macintosh HD/Users/me/Desktop/example/example.indd”。另外,尝试数据合并一个小文件,可能会在大文件上超时
  • 没有骰子。我添加了 /Macintosh HD/ - 它在桌面上仍然可以正常工作,但会使服务器崩溃。我只是有一个带有 4 行单帧的文档。 CSV 只有 3 行 4 列和一些文本。我已经在 3 台不同的计算机(3 个单独的安装)上对此进行了测试,所有计算机都发生了相同的崩溃。 17行代码的一个令人费解的问题……

标签: adobe-indesign extendscript mailmerge indesign-server


【解决方案1】:

Adobe 人员注意到了这一点,并在 2019 年版的 InDesign Server 中解决了这个问题。具有相似合并文档的相同脚本不再产生错误。

因此,对于解决方案,请更新到 2019 年。

更多信息: Adobe Forums Post

【讨论】:

  • 您不妨评估一下其他产品,它们比 IDS 便宜但对 vdp 和 mailmerge 非常强大。例如,参见 Callas PDFChip。
【解决方案2】:

找到解决方案,如果其他人发现自己处于我的情况。 为什么 mergeRecords() 在 Server 中出现故障仍然是个谜。

doc.dataMergeProperties.exportFile()

给 Colecandoo 的道具:https://forums.adobe.com/thread/2478708

我的代码现在是:

var source = File("/Users/me/Desktop/example/example.indd");
var destination = File("/Users/me/Desktop/example/example.pdf");
var sourceData = File("Macintosh HD:Users:me:Desktop:example:example.csv");

var doc = app.open(source);
var myExport = File(doc.filePath + "/" + doc.name.split(".indd")[0] + ".pdf");  
doc.dataMergeProperties.dataMergePreferences.recordNumber = 3;
with (doc.dataMergeProperties.dataMergePreferences) {
			recordSelection = RecordSelection.ONE_RECORD;    
            }
			app.dataMergeOptions.removeBlankLines = true;  
                doc.dataMergeProperties.exportFile(myExport, "[High Quality Print]", ); 

仍然需要一些调整,但它正在执行合并 - 这正是我所需要的。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-12-28
    • 1970-01-01
    • 1970-01-01
    • 2014-11-25
    • 1970-01-01
    • 2021-01-13
    • 1970-01-01
    相关资源
    最近更新 更多