14 Replies Latest reply on Jul 20, 2017 11:18 PM by Sudha K

    Get pasteboard items

    Sudha K Level 1

      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

        • 1. Re: Get pasteboard items
          Chinnadk Level 4

          Try this,

           

          var doc = app.activeDocument;
          var pi = doc.pageItems;
          for(var i=0;i<pi.length;i++)
          {
                  if(pi[i].parentPage == null)
                  {
                          //
                      }
              }
          

           

          Regards,

          Chinna

          • 2. Re: Get pasteboard items
            Sudha K Level 1

            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

            • 3. Re: Get pasteboard items
              Sudha K Level 1

              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?

              • 4. Re: Get pasteboard items
                Laubender Adobe Community Professional & MVP

                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

                • 5. Re: Get pasteboard items
                  Sudha K Level 1

                  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

                  • 6. Re: Get pasteboard items
                    [Jongware] Most Valuable Participant

                    So, basically this question is ...

                    • 7. Re: Get pasteboard items
                      tpk1982 Level 4

                      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

                      • 8. Re: Get pasteboard items
                        Sudha K Level 1

                        Sorry.. Marked...

                        • 9. Re: Get pasteboard items
                          Laubender Adobe Community Professional & MVP

                          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

                          • 10. Re: Get pasteboard items
                            Sudha K Level 1

                            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

                            • 11. Re: Get pasteboard items
                              Laubender Adobe Community Professional & MVP

                              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

                              • 12. Re: Get pasteboard items
                                Sudha K Level 1

                                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

                                • 13. Re: Get pasteboard items
                                  Laubender Adobe Community Professional & MVP

                                  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

                                  • 14. Re: Get pasteboard items
                                    Sudha K Level 1

                                    Ok thank you....