Copy link to clipboard
Copied
Hi All,
I have a requirement to list count of gradient and patterns, ppi value of raster images. If i try to retrieve the count of gradient and patterns,
it lists unused gradrients and patterns. Please help me to list out count which shows in document info.
Here is the code i tried:
//Pattern count
ai::int32 idPatternCount = 0;
sAIPattern->CountPatterns(&idPatternCount);
//Gradient count
ai::int32 idGradientsCount = 0;
sAIGradient->CountGradients(&idGradientsCount);
In the API document, i am not able to find the method to retrieve raster image PPI. Please help me on this.
Regards,
Selva
Copy link to clipboard
Copied
You can calculate it by using the function GetRasterInfo at Raster Suite. The bounds of the AIRasterRecord - size of raster object in pixels.
Copy link to clipboard
Copied
CountPatterns() & CountGradients just tell you what's in the document pattern & gradient lists, so it makes sense that wouldn't be helpful. I don't think there's anything in the API that lets you know what's 'in use' for anything like that, including symbols or graphic styles as well.
Copy link to clipboard
Copied
Is there any other way to get used patterns and gradients count.
Copy link to clipboard
Copied
It is possible, for example, maybe to remove unused by PlayActionEvent and then count
Copy link to clipboard
Copied
There is no menu optios to select unsed gradients and patterns. Can you please help me with sample code to select and remove unsed gradients and patterns.
Copy link to clipboard
Copied
Gradients and patterns - is also swatches. So, perhaps, you can remove unused swatches and then CountGradients and CountPatterns?
Have you tried to work as a functions ValidatePattern and ValidateGradient?
Copy link to clipboard
Copied
I tried ValidatePattern and ValidateGradient, it lists both used and unused the patterns and gradients.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more