• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Get pasteboard items

Contributor ,
Jul 14, 2017 Jul 14, 2017

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 .

Pasteboard items information

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

TOPICS
Scripting

Views

2.3K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jul 18, 2017 Jul 18, 2017

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

...

Votes

Translate

Translate
Enthusiast ,
Jul 14, 2017 Jul 14, 2017

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jul 17, 2017 Jul 17, 2017

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??

Screen shot 2017-07-17 at 2.35.37 PM.png

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jul 17, 2017 Jul 17, 2017

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 18, 2017 Jul 18, 2017

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jul 20, 2017 Jul 20, 2017

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 20, 2017 Jul 20, 2017

Copy link to clipboard

Copied

So, basically this question is ...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Jul 20, 2017 Jul 20, 2017

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jul 20, 2017 Jul 20, 2017

Copy link to clipboard

Copied

Sorry.. Marked...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 20, 2017 Jul 20, 2017

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?

LeftOrRightFromSpine-1.png

Tell again: Left or right from spine?

LeftOrRightFromSpine-2.png

Regards,
Uwe

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jul 20, 2017 Jul 20, 2017

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??

     Screen shot 2017-07-21 at 10.27.26 AM.png

- Sudha K

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 20, 2017 Jul 20, 2017

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jul 20, 2017 Jul 20, 2017

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 20, 2017 Jul 20, 2017

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jul 20, 2017 Jul 20, 2017

Copy link to clipboard

Copied

LATEST

Ok thank you....

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines