Copy link to clipboard
Copied
Hey all, wasn't sure if this belonged in InDesign Server Developers forum, or here. Sorry if in wrong place.
I have a simple data merge script which works perfectly fine in InDesign CC Desktop:
var source = File("/Users/toddshark/Desktop/InDesign Server/example/example.indd")
var destination = File("/Users/toddshark/Desktop/InDesign Server/example/example.pdf")
var sourceData = File("/Users/toddshark/Desktop/InDesign Server/example/example.csv")
var doc = app.open(source);
doc.dataMergeProperties.selectDataSource(sourceData);
doc.dataMergeProperties.dataMergePreferences.recordNumber = 1;
doc.dataMergeProperties.mergeRecords();
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);
I pass this same script to InDesign server, and it crashes on the .mergeRecords();.
The server gives back (after ~3 seconds):
./InDesignServer: line 13: 72872 Segmentation fault: 11 "$installed_name" "$@"
Then crashes.
Anyone know what could be causing this?
We have released an update for InDesign Server CC2019 (v 14.0) which contains some stability fixes. If you are not already on 14.0 (build 130), then we recommend you to update to latest version.
Also, please send the following information to santalwa@adobe.com :
• Error snapshot or video recording of the issue.
Adobe InDesignServer team
Copy link to clipboard
Copied
By the way, I accidentally clicked the 'Assumed Answered' button, and it's not obvious to me how to undo that.
Copy link to clipboard
Copied
It looks like a moderator already fixed it.
Copy link to clipboard
Copied
Following up on this, it really has me baffled.
I've modified my code to check that the file paths are valid and point to actual files.
var source = File("/Users/toddshark/Desktop/example/example.indd");
var destination = File("/Users/toddshark/Desktop/example/example.pdf");
var sourceData = File("/Users/toddshark/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();
} catch (err) {
app.consoleout(err);
}
} else {
app.consoleout("Something doesn't exist...");
}
I get:
Fri Sep 21 11:46:46 2018 INFO [script] Performing merge...
./InDesignServer: line 13: 63113 Segmentation fault: 11 "$installed_name" "$@"
It crashes. It doesn't log any errors beyond that Segmentation fault.
Copy link to clipboard
Copied
Hi,
did you try the same with a tab delimited text file?
How is the encoding of your csv ?
Regards,
Uwe
Copy link to clipboard
Copied
Yes I've tried both .csv and .txt. I've tried encoding the CSV with the default 'CSV UTF-8 (Comma Delimited)' from Excel. As well as 'MS-DOS Comma Separated' and 'Macintosh Comma Separated' which tend to work better.
Still no idea what is causing .mergeRecords() to crash. I've tried this method on 3 different computers, and it fails on all of them (works on InDesign Desktop on all of them). Furthermore, this is the only method I've found that crashes the server - I can do pretty much everything else (make frames, place images, export PDFs, find / replace, etc...) without crash.
I've found a work around which actually suits my needs so I'm going to abandon trying to get .mergeRecords() to work for now:
Props to Colecandoo for the nudge: How to automate InDesign data merge with C#
var source = File("/Users/toddmorris/Desktop/example/example.indd");
var destination = File("/Users/toddmorris/Desktop/example/example.pdf");
var sourceData = File("Macintosh HD:Users:toddmorris: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]", );
I'm tempted to report the mergeRecords() crash as a bug - just on the grounds the script works fine in Desktop, but breaks Server.
I'll also note, the response from Server to the terminal window that called sampleclient:
Error -1 fault: SOAP-ENV:Client [no subcode]
"End of file or no input: Operation interrupted or timed out"
Detail: [no detail]
I've also got a SO post on the problem, has more info, but same conclusion (as of this writing):
extendscript - InDesign Server Crashing on Data Merge - Stack Overflow
Copy link to clipboard
Copied
We have released an update for InDesign Server CC2019 (v 14.0) which contains some stability fixes. If you are not already on 14.0 (build 130), then we recommend you to update to latest version.
Also, please send the following information to santalwa@adobe.com :
• Error snapshot or video recording of the issue.
Adobe InDesignServer team
Copy link to clipboard
Copied
This seems specific to Indesign server so moving it to the forum for InDesign Server, more people could benefit from the information looking for this specific issue.
-Manan
Copy link to clipboard
Copied
I just downloaded the 2019 Server, set up a quick test document and gave it a shot. It appears to be fixed! Same script file, similar sample document. It was indeed a bug, and it appears fixed in the latest 2019 Server release.
Thanks for all of the help!