Copy link to clipboard
Copied
Hello to the community,
This one has a rather weird behavior, which we did not notice in the past.
Calling the Document.packageForPrint method on a Windows 10 Pro, CC-2018 workstation works like a charm: the specified child folder can be created, then can gather all expected files such as: Indd, Idlm, PDF, "Document fonts" folder related files, "Links" folder and related files, "Instructions.txt" file, etc. A real charm, I say!
However, on the InDesign Server (AIS) CC-2018 (13.0) server, the behavior is really weird:
Whereas the server seems to be able to create the specified child folder and gather all expected files and subfolders (as on the workstation), it turns out that, for an unknown reason, *it eventually deletes the specified child folder*, once the method call returns. So, none of your exported files remains...
Even if you, as a Windows user, were on purpose standing in the target folder with your Windows Explorer: you simply can see the child folder and its contents for a few seconds (while the "packageForPrint" method is running, I suppose), then... you see everything disappearing !?!
Even if you try to prevent this unexpected deletion, by creating and letting opened a sort of "lock" file.
Excerpt:
if (Folder(sOutputFolderName).create == false)
{
we never come here
}
/* The following is only for locking purpose; should there be no weird behavior, we would not have coded this, obviously */
var lockFileName = sOutputFolderName + "/lock.txt";
var lockFile = new File(lockFileName);
lockFile.open("w");
lockFile.write("Hello Adobe!\r\n");
lockFile.close();
lockFile.open("a");
/* Now, the method call itself: */
var ok = myDocument.packageForPrint(
new Folder(sOutputFolderName), // to
true, // copyingFonts
true, // copyingLinkedGraphics
true, // copyingProfiles
true, // updatingGraphics
false, // includingHiddenLayers
true, // ignorePreflightErrors
true, // creatingReport
true, // includeIdml
true, // includePdf
"Smallest File Size", // pdfStyle
false, //useDocumentHyphenationExceptionsOnly
"", // versionComments
true // forceSave
);
if (ok == false)
{
// we never come here
}
End excerpt
Anybody here had this behavior in the past, or could advise on what could be the reason of it?
Thanks!
Kind regards,
CD
Copy link to clipboard
Copied
Is there any chance another routine deals with file removal ? I saw bugs in the past with packageForPrint but none that looks similar with what you see. Did you try packaging to different places and different parameters ?
Copy link to clipboard
Copied
Thanks for your contribution.
No other routine in our environment is known to deal with file removal.
We indeed tried different folders and different parameters, but the result is the same: all files and folders are properly created, before they suddenly disappear from the file system.
Meanwhile, we had no other solution than implementing an alternative home-made "packageforPrint2", which exports IDML and PDF, as well as collects links and fonts.