Copy link to clipboard
Copied
Hi,
I need to get the paste board items if the document contains pasteboard items. When i am searching in forum, i found the below url .
Its removing all items from the page. Actually paste board item is, the items which are outside of the pages right?? or I am guessing it wrongly???
How can i find whether document have paste board items (Outside of pages) or not ?
- Sudha K
Hi Sudha,
if all things you want to ignore are on masters you could start with an array of pageItems in spreads:
var pageItemsOnSpreadsIncludingDocPagesButNotMasters = app.documents[0].spreads.everyItem().pageItems.everyItem().getElements();
and loop the array.
If that is not working it's getting complicated.
Especially with arbitrary shapes.
One algorithm could be to create a rectangular shape in size and position of a page plus the area of the slug and test for items totally outside with duplicates
...Copy link to clipboard
Copied
Try this,
var doc = app.activeDocument;
var pi = doc.pageItems;
for(var i=0;i<pi.length;i++)
{
if(pi.parentPage == null)
{
//
}
}
Regards,
Chinna
Copy link to clipboard
Copied
Thank you....
If the objects are outside side of the page is fine... Its selecting Header contents textframe above the redline. How to avoid this??
Also if the object position is half is outside and half is in marginal. How to capture this case??
Copy link to clipboard
Copied
Hi
Can i get the page of pasteboad items??
Eg., if the pasteboard items are left side of the document i need to get the verso (left) page. If it is right side I need to corresponding right side page. If i get that page i can skip those items using bounds right?
Copy link to clipboard
Copied
Hi Sudha,
if all things you want to ignore are on masters you could start with an array of pageItems in spreads:
var pageItemsOnSpreadsIncludingDocPagesButNotMasters = app.documents[0].spreads.everyItem().pageItems.everyItem().getElements();
and loop the array.
If that is not working it's getting complicated.
Especially with arbitrary shapes.
One algorithm could be to create a rectangular shape in size and position of a page plus the area of the slug and test for items totally outside with duplicates of their shapes and a decent pathfinder operation.
Regards,
Uwe
Copy link to clipboard
Copied
Hi,
Sorry for the late reply....
Thank you so much...
I have proceeded same as u said.
1. Get the all page items from the spreads.
2. Get the width of spead (zero spread origin) with slug value.
3. Check the value of left and right of page items bounds based on page side.
4. If it is found in the paste board other than page side (including slug) considered it is paste board items.
- Sudha k
Copy link to clipboard
Copied
So, basically this question is ...
Copy link to clipboard
Copied
Last time also I asked Sudha to mark correct answer.. I hope she don't aware this..
@Sudha -- please mark if you feel the question is answered
Copy link to clipboard
Copied
Sorry.. Marked...
Copy link to clipboard
Copied
Hi Sudha,
I'm not convinced.
Using "page items bounds"—I guess you mean perhaps visible bounds?—is a bit vague.
Are you using the center of the bounds to decide if the object is left or right from spine?
Left or right from spine?
Tell again: Left or right from spine?
Regards,
Uwe
Copy link to clipboard
Copied
Hi,
I have used spread width value with slug. Also check the objects from left and right side of the spread. I am not checking the objects top and bottom of the spread bcoz pdf may contains title contents so not checking that. is it wrong??
- Sudha K
Copy link to clipboard
Copied
Hi Sudha,
no, it's not wrong. If you are not interested in objects above or below pages you'll be fine, I think.
I made my reply, because I did not see exactly what you are aiming at. 🙂
Best,
Uwe
Copy link to clipboard
Copied
Hi,
I need to check the objects other than pages. In top and bottom of the page, header and footer of pdf may occur so i skipped those object when checking the paste board items.
If I need to check those objects, I have to check the object top and bottom values with the spread height. Is it right? Then we can get all paste board items other than page items.
- Sudha K
Copy link to clipboard
Copied
Hi Sudha,
if the sole purpose of this is to get items that are fully on the pasteboard within your own definitions adding the slug area you are good to go. Sorry for confusing you…
Additionally if you want to know if an item is considered left or right from the spine when crossing the spine, in some occassions there is no right or wrong. Or a: perhaps left, perhaps right. You could perhaps decide from its center. But as you see from my little sample above a human beeing might decide differently from an algorithm.
Regards,
Uwe
Copy link to clipboard
Copied
Ok thank you....