Quantcast
Channel: Adobe Community: Message List
Viewing all articles
Browse latest Browse all 80307

Re: How can I update the RasterItem in a AI file in a C# project?

$
0
0

Just like:

string picPath=@"..."//The full path of the psd file

illutrator.RasterItem raster=null;

try

{

     for(int i=0;i<doc.RaterItems.count;i++)//doc is the AI file that has been open correctly

   {

      raster=doc.RasterItem[i];

      if(raster.Editble&&File.Exists(picPath))

     {

          raster.URL=picPath;

     }

   }

   //Save changes of the AI file

     ...........

 

}

catch(Exception)

{

      ....

}

No exception is thrown but the RaterItems in the AI file stay unchanged,but after the operation I tried to get the RasterItem::URL attribute again ,it  return the url I set to the RasterItem::URL property.


Viewing all articles
Browse latest Browse all 80307

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>