Copy link to clipboard
Copied
Create following design using Adobe Illustrator CC 2018. Red ellipse with transparency Difference.
Both yellow and red ellipses do function in RGB mode, hence the overlap becomes green.
Once the working area has been filled with the required content, a VB program will be started, and its pushbutton clicked. Generated file Test.ai (saved in AI 8.0 format) does not contain flatten transparencies, but, quite contrary, to what has been documented by Adobe, transparencies are automatically removed!
Source code applied in Visual Basic .NET:
Maybe I might have missed something somewhere, because the outcome (Test.ai) is not according to Adobe specs, and, differs from the right outcome when done manually via the user interface of Adobe Illustrator CC 2018.
What went wrong here?
Copy link to clipboard
Copied
Moved to Illustrator Scripting​
Copy link to clipboard
Copied
I'm not shure about VB. However, I think you need to set compatibility up 11(IllustratorCS). Illustrator ver.8 not support transparencies.
Copy link to clipboard
Copied
@Ten A:
Indeed, Illustrator ver.8 does not support transparencies, thus does not know what transparencies are, so cannot handle them. That's exactly why option aiPreserveAppearance is available: to instruct Adobe Illustrator CC 2018 to flatten the transparency, so an Illustrator 8.0 application is able to preserve the appearance of the design. But what actually happens is that the transparency is simply removed from the original design and consequently the design lost its original appearance. That's quite bad! Totally unacceptable! At the level of appearances it will lead to incompatibilities when communicating AI data to other software suites.
I was not sure about VB .NET and C# .NET either, so please allow me to demonstrate that the problem noted is not strictly limited to actual usage of C# .NET and VB .NET. Have also tested the following probably much more common JavaScript approach:
Critical part of the script itself which is accepted by Adobe Illustrator CC 2018, but does not seem to work at all:
Reading the outputted AI 8.0 file:
The transparency is gone.
WHEN DOING IT MANUALLY:
Choose Preserve Appearance and Overprints, then click OK.
Reading the output:
The picture is just as expected. The appearance has been preserved with AI 8.0 format.
WHY DOES THIS NOT WORK WITH SCRIPTING ????
Copy link to clipboard
Copied
If scripting commands fail, try to use an Illustrator action to try and save this way so as to have the settings property work.
var actionString = [
"/version 3",
"/name [ 4 %%% Test %%%",
" 54657374",
"]",
"/isOpen 1",
"/actionCount 1",
"/action-1 {",
" /name [ 8 %%% Action 1 %%%",
" 416374696f6e2031",
" ]",
" /keyIndex 0",
" /colorIndex 0",
" /isOpen 1",
" /eventCount 1",
" /event-1 {",
" /useRulersIn1stQuadrant 0",
" /internalName (adobe_saveACopyAs)",
" /localizedName [ 11 %%% Save A Copy %%%",
" 53617665204120436f7079",
" ]",
" /isOpen 0",
" /isOn 1",
" /hasDialog 1",
" /showDialog 0",
" /parameterCount 9",
" /parameter-1 {",
" /key 1668445298 %%% crtr %%%",
" /showInPalette -1",
" /type (integer)",
" /value 8",
" }",
" /parameter-2 {",
" /key 1702392878 %%% ext. %%%",
" /showInPalette -1",
" /type (integer)",
" /value 1",
" }",
" /parameter-3 {",
" /key 1768842092 %%% incl %%%",
" /showInPalette -1",
" /type (integer)",
" /value 0",
" }",
" /parameter-4 {",
" /key 1918989423 %%% rato %%%",
" /showInPalette -1",
" /type (real)",
" /value 100.0",
" }",
" /parameter-5 {",
" /key 1886545516 %%% prfl %%%",
" /showInPalette -1",
" /type (integer)",
" /value 1",
" }",
" /parameter-6 {",
" /key 1718378868 %%% flat %%%",
" /showInPalette -1",
" /type (integer)",
" /value 2",
" }",
" /parameter-7 {",
" /key 1851878757 %%% name %%%",
" /showInPalette -1",
" /type (ustring)",
" /value [ 59 %%% wherever I saved it %%%",
" ...",
" ...",
" ]",
" }",
" /parameter-8 {",
" /key 1718775156 %%% frmt %%%",
" /showInPalette -1",
" /type (ustring)",
" /value [ 35 %%% Adobe Illustrator Any Format Writer %%%",
" 41646f626520496c6c7573747261746f7220416e7920466f726d617420577269",
" 746572",
" ]",
" }",
" /parameter-9 {",
" /key 1702392942 %%% extn %%%",
" /showInPalette -1",
" /type (ustring)",
" /value [ 6 %%% ai,ait %%%",
" 61692c616974",
" ]",
" }",
" }",
"}",
"",
].join("\n").replace(/%%%\s[^%]+\s%%%/g, "");
I made this action translation string array which can be used.
Copy link to clipboard
Copied
@Ten A
@Silly-V
Feedback:
Workaround (usage of a dynamic action script) proved to work excellently once the syntax chosen is correct.
C# programming environment offers a possibility of adding a dynamic action script directly into an executable as an embedded resource, which the executable itself via its graphical user interface can repeatedly read, store, load, execute, and unload.
And, Adobe still has a discrepancy to solve between the official scripting documentation and the actual functionality found in Illustrator versions CS6 up to and their latest flag ship CC 2018.