Skip navigation
sammy003
Currently Being Moderated

Cross Reference an Object??

Feb 23, 2010 1:48 PM

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?

 
Replies
  • Currently Being Moderated
    Feb 23, 2010 2:53 PM   in reply to sammy003

    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?

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 23, 2010 4:31 PM   in reply to sammy003

    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

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 24, 2010 4:05 AM   in reply to sammy003

    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

     
    |
    Mark as:
  • Currently Being Moderated
    May 20, 2010 4:25 AM   in reply to Harbs.

    Nice one Harbs!

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 26, 2012 8:32 PM   in reply to Harbs.

    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?

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 27, 2012 2:51 AM   in reply to Harbs.

    @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

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 27, 2012 3:15 AM   in reply to Laubender

    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

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 29, 2012 9:08 AM   in reply to Laubender

    (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

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 29, 2012 9:00 PM   in reply to Laubender

    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

     
    |
    Mark as:
  • Currently Being Moderated
    May 16, 2012 6:29 AM   in reply to freelance_pnh

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

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points