JSX: Printing doc with print options, then saving without closing causing file to become corrupt
I have the following snippet. Assume "thePrinter" sets the print preset name. If my client opens the doc and prints it using these options, then close it without saving changes, it prints OK, but when they go to reopen the file, they get an alert saying "The file *name* is an unsupported format and can't be opened. If I run the same snippet, but without printing, it works fine. So the issue is either in the print preset, or with how their file system is treating files. Does anyone have any thoughts? Thanks in advance.
if (i == thePrinterNum) {
var thePrinter = getPrinter();
pOptions.printPreset = thePrinter;
pOptions.jobOptions = jbOptions;
}
doc = app.open(File(pathStr + theImage), DocumentColorSpace.RGB);
jbOptions.file = doc.fullName;
userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;
for (var c = 0; c < numPrints; c++) {
doc.print(pOptions);
}
userInteractionLevel = storeUserInteract;
} catch(e) {
alert("Could not print " + theImage);
} finally {
if (doc) {
doc.close(SaveOptions.DONOTSAVECHANGES);
}
}

