Copy link to clipboard
Copied
Hi,
I am trying to read document info using javascript. Can read path and text items but how can i found embedded items?
Also how can get the properties of document info using javascript?
Thanks,
Sudha K
If you have a document with one placed image, and another copy of the same placed image but you clicked the "Embed" button, the embedded image becomes what is called the "RasterItem".
Do this experiment with the two kinds of art mentioned above and run this snippet to see the "typename" property of those items.
#target illustrator
function test(){
var doc = app.activeDocument;
var thisItem;
for(var i = 0; i < doc.pageItems.length; i++){
thisItem = doc.pageItems;
alert(thisIte
...Copy link to clipboard
Copied
If you have a document with one placed image, and another copy of the same placed image but you clicked the "Embed" button, the embedded image becomes what is called the "RasterItem".
Do this experiment with the two kinds of art mentioned above and run this snippet to see the "typename" property of those items.
#target illustrator
function test(){
var doc = app.activeDocument;
var thisItem;
for(var i = 0; i < doc.pageItems.length; i++){
thisItem = doc.pageItems;
alert(thisItem.typename);
};
};
test();
As you will see, your placed item will be called "PlacedItem" and your embedded one will be called "RasterItem".
Does this help you on the right track?
Copy link to clipboard
Copied
Hi,
Thank you...
Yes, its showing as you said.... I have placed same image as you said. Embedded images are returning as type "RasterItem" and other one is returning "PlacedItem" how?. Both are same kind of images only know..
All embedded images are Raster items? What i am assuming is all non-editable files (ie., photos) are raster images is it right?
Copy link to clipboard
Copied
Yes, when you embed a PlacedItem, it turns into a RasterItem - in the Illustrator's UI you can visually see the difference when the "X" that goes through the placed image disappears once the Embed button is clicked.
Copy link to clipboard
Copied
Ok... Thank you...
All non editable images are raster art?
How can i get the other info of document info details? clipping mast objects and other information...
Copy link to clipboard
Copied
I can found the clipping art using the below syntax.
if(pathItem.clipping == ture)
alert("Clipped object")
Copy link to clipboard
Copied
Hi you can collect all information of all items using the pageItems[] to return .typename like this:
#target illustrator
#targetengine main
var allItems = app.activeDocument.pageItems;
for (var i = 0; i < allItems.length; i++){
alert(allItems.typename);
};
Try...