10 Replies Latest reply: May 16, 2012 6:29 AM by freelance_pnh RSS

    Cross Reference an Object??

    sammy003 Community Member

      How do I cross reference an object using Indesign CS4?

      I've got a PDF that I've dropped into a frame, which I applied an Object Style.  Now I need to create a cross references in the document, that point to the PDF (a chart).  I've got to do this with several PDF's.

       

      When I go to create a cross reference, I can only apply it a Paragraph Style or a Text Anchor, I don't get an Object Style to choose from.

       

      I could put some text in behind the chart, and arrage the chart to the front, but i'd rather create a cross reference to the Object itself.

       

      What do i do?

        • 1. Re: Cross Reference an Object??
          P Spier CommunityMVP

          Peter Gold will probably come along with a better plan (he's a whiz with cross refs), but how about pasting the graphics as inlines into text frames?

          • 2. Re: Cross Reference an Object??
            peter at knowhowpro Community Member

            sammy003 wrote:

             

            How do I cross reference an object using Indesign CS4?

            I've got a PDF that I've dropped into a frame, which I applied an Object Style.  Now I need to create a cross references in the document, that point to the PDF (a chart).  I've got to do this with several PDF's.

             

            When I go to create a cross reference, I can only apply it a Paragraph Style or a Text Anchor, I don't get an Object Style to choose from.

             

            I could put some text in behind the chart, and arrage the chart to the front, but i'd rather create a cross reference to the Object itself.

             

            What do i do?

            Cross-references only point to text - either a text anchor or a paragraph - not to objects.

             

            If your placed PDF is in an anchored frame, you can point the cross-reference to the paragraph in which the frame is anchored.

             

            If your placed PDF is not in an anchored frame, you can do what you suggest above, or you have these other options:

             

            * place the PDF into a text frame

             

            * create a text frame and group it with the PDF; point the cross-reference to the paragraph in the text frame, or insert a text anchor in the text and point the cross-reference to it.

             

            * you can paste the grouped PDF and text frame object into a text frame to make it an anchored frame.

             

            The idea of a cross-reference is usually to point to a caption or heading. You can't point to the text in a placed PDF because it's really a graphic. You'll probably want a caption to identify the chart. The caption is the text you cross-reference to. The caption can be in the paragraph that holds the anchor, in a text frame grouped with the graphic, in a paragraph above or below the graphic, or in an anchored frame that's positioned near the graphic.

             

            If your layout will not reflow, you probably don't need an anchored frame, but if the layout will reflow, you'll want to use the ability of an anchored to move with the text.

             

            Read about cross-references and anchored frames in Help. If your caption will be numbered, such as "Figure 3," also read about numbered lists and numbering properties of paragraph styles.

             

            HTH

             

            Regards,

             

            Peter

            _______________________

            Peter Gold

            KnowHow ProServices

            • 3. Re: Cross Reference an Object??
              Harbs. CommunityMVP

              This script will insert a destination anchor into a graphic frame. It's a bit of a hack...

               

              Select the graphic frame and run the script...

               

              var name  = prompt("Pick a name","","Create anchor in graphic frame");
              if(name){
                  makeObjectAnchor(app.selection[0],name);
              }
              function makeObjectAnchor(object,destinationName){
                  var tf = object.textFrames.add();
                  app.documents[0].hyperlinkTextDestinations.add(tf.parentStory.insertionPoints[0],{name:destinationName});
              }
              
              

              Harbs

              • 4. Re: Cross Reference an Object??
                Frans van der Geest CommunityMVP

                Nice one Harbs!

                • 5. Re: Cross Reference an Object??
                  freelance_pnh Community Member

                  Hi Harb,

                   

                  I have tried out your script in Indesign CS5.
                  The thing is that I end up with <PB> instead of the real page number in the source text...
                  In the cross-references panel, I have PB written in red and it says "Invalid destination: on the pasteboard"
                  Can someone help please?

                  • 6. Re: Cross Reference an Object??
                    Laubender CommunityMVP

                    @Harbs – I see the same as freelance_pnh.

                     

                    To my surprise the problem is, if you add a text frame to that object, in InDesign CS5.5 (I did not test for other versions) it will be added to page 1 of the document regardless where your object (the holding frame for the image) sits (e.g. on page 3)!

                     

                    To change that I recommend a slight change in your script:

                     

                    var name  = prompt("Pick a name","","Create anchor in graphic frame");
                    if(name){
                        makeObjectAnchor(app.selection[0],name);
                    }
                    function makeObjectAnchor(object,destinationName){
                        //Let's change the geometric bounds of the added text frame to the bounds of the object that holds the graphic:
                        var tf = object.textFrames.add({geometricBounds:object.geometricBounds});
                        
                        app.documents[0].hyperlinkTextDestinations.add(tf.parentStory.insertionPoints[0],{name:destinationName});
                    }
                    

                     

                    Uwe

                    • 7. Re: Cross Reference an Object??
                      Laubender CommunityMVP

                      To illustrate this (EDIT: with "this" I mean the problem that occurs with the original version of your script) see the following screen shots:

                       

                      1. The image after the script on spread 2, page 3:

                       

                      GraphicOnPage3.png

                       

                      2. The added text frame visualized by clicking at the <> object in the layers palette:

                       

                      AddedTextFrameToGraphicFrameOnPage1.png

                       

                      Note also the strange visualization of the coordinate system depicted in the rulers.

                      My rulers are set to spread. Zero point in the upper left corner of the first page in the spread.

                       

                      Uwe

                       

                      Message was edited by: Laubender

                      • 8. Re: Cross Reference an Object??
                        Laubender CommunityMVP

                        (Just tested with InDesign CS4. All the same issues with the original code.)

                         

                        @freelance_pnh – did you test the altered code? Does it work work for you now?

                         

                        Btw.: this thread is rather old. The OP sammy003 never answered. So what…

                         

                        Uwe

                        • 9. Re: Cross Reference an Object??
                          freelance_pnh Community Member

                          Hi Laubender,

                           

                          I just tied it. Looks like it's working.
                          Your a genius.
                          I will give you some more in depth feed back after I used it on all the document

                          THANK YOU

                          • 10. Re: Cross Reference an Object??
                            freelance_pnh Community Member

                            Hi Laubender.
                            I have used the script on 2 books and everything was ok.
                            Thanks again.