Ai file loses color profile after processing.
-
- Member
- Posts: 121
- Joined: Fri Jun 12, 2020 11:23 am
Ai file loses color profile after processing.
I have an illustrator element which makes PDFs from ai files. After this process the ai file loses it's color profile. what can cause this?
In the element i use a script for the Command part, and Illustrator in the Save as option.
In the element i use a script for the Command part, and Illustrator in the Save as option.
Re: Ai file loses color profile after processing.
There is an Illustrator save option that determines whether or not the ICC profile should be included and the default is "false". That probably explains why saving as Illustrator loses it.
This being said, you should not save the PDF with a script for the Command property, but just with the standard "Save as" functionality to save it as PDF. If you also want to keep the Illustrator file and continue with it in the flow, then simply send the AI file both to the configurator and to another folder that continues in the flow.
This being said, you should not save the PDF with a script for the Command property, but just with the standard "Save as" functionality to save it as PDF. If you also want to keep the Illustrator file and continue with it in the flow, then simply send the AI file both to the configurator and to another folder that continues in the flow.
-
- Member
- Posts: 121
- Joined: Fri Jun 12, 2020 11:23 am
Re: Ai file loses color profile after processing.
We cannot use Save as to make PDFs because of our printing software's settings. I can use my PDF making script in the Save as option of the Illustrator element. But doing it this way i get no output from the element which i need to measure the time spent on making PDFs.freddyp wrote: ↑Tue Jan 19, 2021 5:08 pm There is an Illustrator save option that determines whether or not the ICC profile should be included and the default is "false". That probably explains why saving as Illustrator loses it.
This being said, you should not save the PDF with a script for the Command property, but just with the standard "Save as" functionality to save it as PDF. If you also want to keep the Illustrator file and continue with it in the flow, then simply send the AI file both to the configurator and to another folder that continues in the flow.
There is an option to get only a log as the output from the Illustrator element. Is it possible to create this log with a script? What are the requirements for this log file format?
//Edit: found a somewhat solution. Since after the pdf making i only need the illustrator file for it's metadata, i save it as a pdf in the element with the smallest size. from there i can extract the metadata to my following processes.
Re: Ai file loses color profile after processing.
I do not understand that one. Are you referring to a specific custom PDF preset you have to use? In that case add it to the AI on Switch and choose it from the list.We cannot use Save as to make PDFs because of our printing software's settings
You can of course add your script to the "Save as" property. That is certainly more logical than adding it to "Command". From your script you cannot control the Log output of the element. If you want to create your own log file with a timing on how long the script ran, how many images there are in the file, what the document's ICC profile is, etc. I suggest you save the PDF and your own log file in $outfolder, add the paths to the array $outfiles and set $jobfolder to the name you want for the job folder in Switch. Once you have the job folder in Switch you could do an XML pickup (if your log file is an XML) or you could dismantle it.
Read more here: https://www.enfocus.com/manuals/UserGui ... tions.html
-
- Member
- Posts: 121
- Joined: Fri Jun 12, 2020 11:23 am
Re: Ai file loses color profile after processing.
We are using Adobe PDF printer to make pdfs from the ai file. This requires some extra steps to get the PDFs with metadata, but it's manageable. I just need the illustrator element to not save the file at all, because on some occasions the file is very big and it takes a lot of time. But i also need the file to move through the element so that i can measure the time spent on making PDFs. Saving the ai as a pdf with the smallest file size preset seems to be the best solution at the moment. I will try, if we can make the illustrator element close the file without saving with a script.freddyp wrote: ↑Wed Jan 20, 2021 9:12 amI do not understand that one. Are you referring to a specific custom PDF preset you have to use? In that case add it to the AI on Switch and choose it from the list.We cannot use Save as to make PDFs because of our printing software's settings
You can of course add your script to the "Save as" property. That is certainly more logical than adding it to "Command". From your script you cannot control the Log output of the element. If you want to create your own log file with a timing on how long the script ran, how many images there are in the file, what the document's ICC profile is, etc. I suggest you save the PDF and your own log file in $outfolder, add the paths to the array $outfiles and set $jobfolder to the name you want for the job folder in Switch. Once you have the job folder in Switch you could do an XML pickup (if your log file is an XML) or you could dismantle it.
Read more here: https://www.enfocus.com/manuals/UserGui ... tions.html
Re: Ai file loses color profile after processing.
Code: Select all
$doc.close( SaveOptions.DONOTSAVECHANGES );
-
- Member
- Posts: 21
- Joined: Thu May 03, 2018 6:07 pm
Re: Ai file loses color profile after processing.
freddyp wrote: ↑Mon Jan 25, 2021 1:59 pmHI,Code: Select all
$doc.close( SaveOptions.DONOTSAVECHANGES );
I have the same need
I used "$doc.close(SaveOption.DONOTSAVECHANGES)" in the "Save as" script but does not work.
this is my script:
the error returned is:Code: Select all
var $outfiles= []; var $jobfolder = $arg1 try { $doc.close(SaveOptions.DONOTSAVECHANGES) $outfiles.push($outfolder + '/' + $doc); } catch(theError) { $doc.close(SaveOptions.DONOTSAVECHANGES); $error = theError.description; }
what am I doing wrong?C:\ProgramData\Enfocus\Switch\13.1\scripted-plugins\com.enfocus.AdobeIllustrator\Illustrator_SaveAsPDF.vbs(42, 26) Adobe Illustrator: Error 45: Object is invalid. Line: 280 -> $doc.close(SaveOptions.DONOTSAVECHANGES)
Re: Ai file loses color profile after processing.
It is the SaveOptions variable that is not defined. Add the line:
Code: Select all
var SaveOptions = new IllustratorSaveOptions();
-
- Member
- Posts: 21
- Joined: Thu May 03, 2018 6:07 pm
Re: Ai file loses color profile after processing.
Does not work... the same error return..freddyp wrote: ↑Thu Feb 25, 2021 8:43 am It is the SaveOptions variable that is not defined. Add the line:Code: Select all
var SaveOptions = new IllustratorSaveOptions();
Re: Ai file loses color profile after processing.
I finally tried it
When using a script for the "Save as" property Switch closes $doc without saving any changes after your script has run, IF $doc is not null. So when you close the document in your script there is no active document anymore and $doc is invalid but not null, so you should make sure to set $doc to null. But hey, Switch already does what you want to do, so you literally have to do nothing: just use an empty script file.
I think this qualifies for the epithet "Easiest script ever!"
When using a script for the "Save as" property Switch closes $doc without saving any changes after your script has run, IF $doc is not null. So when you close the document in your script there is no active document anymore and $doc is invalid but not null, so you should make sure to set $doc to null. But hey, Switch already does what you want to do, so you literally have to do nothing: just use an empty script file.
I think this qualifies for the epithet "Easiest script ever!"
-
- Member
- Posts: 21
- Joined: Thu May 03, 2018 6:07 pm
Re: Ai file loses color profile after processing.
an empty script?! too hard for me I couldn't get it
PLEASE look at my tests, i tried different cases:
1) SWITCH PROPERTY ARE:
a) open: automatic
b) command: none
c) save as: empty script
in this test illustrator starts, opens the document and closes it without save, BUT the file does NOT move through connection, remains in the input folder
the LOG is:
2) SWITCH PROPERTY ARE:Job processing successfully completed!
a) open: automatic
b) command: script (export artboards in separate PDFs)
c) save as: empty script
in this case command script is successful: artboards move through connection....
the LOG is:
Nothing about illustrator file. Illustrator file DISAPPEARS!Job _00T2L_FolderArtBoards was placed in folder Folder 2
3) SWITCH PROPERTY ARE:
a) open: automatic
b) command: script (export artboards in separate PDFs)
c) save as: this script:
in this case illustrator file move to problem job.var $doc = app.activeDocument;
var $outfiles = [];
var $jobfolder = $arg2
$outfiles.push ($outfolder+'/'+$doc);
the LOG is:
then....Cannot send job: path 'C:/Users/switch.PRINTABLE/AppData/Roaming/Enfocus/Switch Server/temp/6/ScriptElement/34/71/[Document _00T2M_T2800New_SX.ai]' does not exist
I chose 2, with a workaround: the flow copies illustrator file before illustrator element.
I suggest adding in the save as property "close without save". It would be very useful because often adobe files can be very big and saving takes a long time
Re: Ai file loses color profile after processing.
The empty script worked for me, but it is certainly more logical to add the line:
to tell Switch that the input file is actually (one of) the output file(s).
A remark about
$doc is app.activeDocument, so it is not necessary.
And about:
The array $outfiles should contain paths as strings. $doc is not a string, but an object. $doc.name is what you need.
Code: Select all
$outfiles = [$infile];
//or if you already have other paths on the $outfiles array:
$outfiles.push($infile);
A remark about
Code: Select all
var $doc = app.activeDocument;
And about:
Code: Select all
$outfiles.push ($outfolder+'/'+$doc);
-
- Member
- Posts: 21
- Joined: Thu May 03, 2018 6:07 pm
Re: Ai file loses color profile after processing.
Code: Select all
$outfiles.push($infile);
it was easy to see it now
Tank you!!
-
- Member
- Posts: 121
- Joined: Fri Jun 12, 2020 11:23 am
Re: Ai file loses color profile after processing.
This also worked for me, thanks!freddyp wrote: ↑Mon Mar 01, 2021 8:38 am The empty script worked for me, but it is certainly more logical to add the line:to tell Switch that the input file is actually (one of) the output file(s).Code: Select all
$outfiles = [$infile]; //or if you already have other paths on the $outfiles array: $outfiles.push($infile);