Ai file loses color profile after processing.

Post Reply
PdFUser5000
Member
Posts: 62
Joined: Fri Jun 12, 2020 11:23 am

Ai file loses color profile after processing.

Post by PdFUser5000 » Tue Jan 19, 2021 2:22 pm

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.

freddyp
Advanced member
Posts: 572
Joined: Thu Feb 09, 2012 3:53 pm

Re: Ai file loses color profile after processing.

Post by freddyp » 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.

PdFUser5000
Member
Posts: 62
Joined: Fri Jun 12, 2020 11:23 am

Re: Ai file loses color profile after processing.

Post by PdFUser5000 » Wed Jan 20, 2021 7:47 am

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.
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.
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.

freddyp
Advanced member
Posts: 572
Joined: Thu Feb 09, 2012 3:53 pm

Re: Ai file loses color profile after processing.

Post by freddyp » Wed Jan 20, 2021 9:12 am

We cannot use Save as to make PDFs because of our printing software's settings
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.

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

PdFUser5000
Member
Posts: 62
Joined: Fri Jun 12, 2020 11:23 am

Re: Ai file loses color profile after processing.

Post by PdFUser5000 » Mon Jan 25, 2021 12:18 pm

freddyp wrote:
Wed Jan 20, 2021 9:12 am
We cannot use Save as to make PDFs because of our printing software's settings
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.

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
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
Advanced member
Posts: 572
Joined: Thu Feb 09, 2012 3:53 pm

Re: Ai file loses color profile after processing.

Post by freddyp » Mon Jan 25, 2021 1:59 pm

Code: Select all

$doc.close( SaveOptions.DONOTSAVECHANGES );

flussidicaio
Newbie
Posts: 17
Joined: Thu May 03, 2018 6:07 pm

Re: Ai file loses color profile after processing.

Post by flussidicaio » Thu Feb 25, 2021 12:56 am

freddyp wrote:
Mon Jan 25, 2021 1:59 pm

Code: Select all

$doc.close( SaveOptions.DONOTSAVECHANGES );
HI,
I have the same need
I used "$doc.close(SaveOption.DONOTSAVECHANGES)" in the "Save as" script but does not work.
this is my script:

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;
		
	}
the error returned is:
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)
what am I doing wrong?

freddyp
Advanced member
Posts: 572
Joined: Thu Feb 09, 2012 3:53 pm

Re: Ai file loses color profile after processing.

Post by freddyp » 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();

flussidicaio
Newbie
Posts: 17
Joined: Thu May 03, 2018 6:07 pm

Re: Ai file loses color profile after processing.

Post by flussidicaio » Thu Feb 25, 2021 11:01 pm

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();
Does not work... the same error return.. :cry:

Post Reply