Hyperlink for images

How to apply hyperlink for images. Please advice

var myDoc = app.activeDocument;   
var  myGr = app.activeDocument.links;   
//    var myLink = myDoc.links; 
//alert(myGr.length)   
    for(a=0; a<myGr.length; a++)   
      try{  
        var myGrName = String(myGr[a].name);   
        var mySplitName = myGrName.split(".")[0];
        app.select(myGr[a].parent)   
        myHyperlinkPageItemSource =  app.activeDocument.hyperlinkPageItemSources.add(app.selection[0])   
        var myHyperlinkURLDestination = app.activeDocument.hyperlinkURLDestinations.add( String(mySplitName));  
        var myHyperlink = app.activeDocument.hyperlinks.add(myHyperlinkPageItemSource, myHyperlinkURLDestination, {name:  String(mySplitName)})     
        } catch(e){}   
alert("Process Completed")  

Similar Messages

  • Create hyperlink for all images

    Hello everyone,
    I am new to scripting, but I am assuming my current task needs some scripting.
    I have a catalog laid out in InDesign.  It is about 250 pages and each page has about 10 image so there are about 2500 images.  The way I have them laid out is each image is placed inside a frame.  Now, I need to hyperlink each image to an external web site.  For example, for an image whose name is (12345.jpg), the hyperlink will be "https://www.testabc.com/productdetails.aspx?itemnum=12345".  Similarly if the next item is 67890, then the hyperlink would need to be "https://www.testabc.com/productdetails.aspx?itemnum=67890".  All images are linked to a folder on the computer.
    Can you please suggest how best to write and run this script.  Any and all help would be greatly appreciated.
    Thank you

    I can't test the script at the moment, but looking at it, I do notice that the entire for loop is within a try-catch. That means that if it encounters an error, it stops processing any more graphics. There may be a good reason for this, but I think you could just move the try-catch into the for loop, so it can catch any individual linking error without stopping completely. Something like this:
    var myDoc = app.activeDocument; 
    var  myGr = app.activeDocument.allGraphics; 
    alert(myGr.length) 
        for(i=0; i<myGr.length; i++) 
          try{
            var myGrName = String(myGr[i].itemLink.name); 
            var mySplitName = myGrName.split(".")[0]; 
            app.select(myGr[i].parent) 
            myHyperlinkPageItemSource =  app.activeDocument.hyperlinkPageItemSources.add(app.selection[0]) 
            var myHyperlinkURLDestination = app.activeDocument.hyperlinkURLDestinations.add("https://www.testabc.com/productdetails.aspx?itemnum=" + String(mySplitName)));
            var myHyperlink = app.activeDocument.hyperlinks.add(myHyperlinkPageItemSource, myHyperlinkURLDestination, {name: "https://www.testabc.com/productdetails.aspx?itemnum=" + String(mySplitName)})   
            } catch(e){} 
    alert("Process Completed")
    The forum's syntax highlighting is giving me a hard time, but I would probably throw an "alert(myGrName)" into those catch brackets so you can begin to try to figure out where it's erroring out (if that is indeed the problem).
    Another thought is that, if there's a chance of multiple images with the same number, you might want to have your hyperlinkURLDestination check for an already existing destination before adding a new one.

  • Hyper link of public image(hyperlink or image) can not be saved on windows server 2012 and sharepoint 2010 problem

    hyper link of public image(hyperlink or image) can not be saved on windows server 2012 and sharepoint 2010 problem, is this a bug?
    thanks for any reply.
    Rosone

    It is not a bug, you might be using IE in Windows server 2012 and and browser might be restricting your site actions to respond properly.
    Check this in a different browser or access site in a differ OS.
    Adnan Amin MCT, SharePoint Architect | If you find this post useful kindly please mark it as an answer.

  • Image instead of List Name, and hyperlink the image to view 'All Items.aspx' page

    Hi,
    I would like remove the Page title for list (i.e., name of the list in view all items.aspx page) , and instead use image and hyperlink the image
    to 'All items.aspx" page.
    Using developer tool found the element (#PageTitle) and added 'Script Editor' webpart and below css script to it. I am successful in replace the
    title to image, however, I am unable to add the HTML tag for hyperlink. Where do I need to add or how do I add? Could anyone help me please??
    <style type="text/css">
    #pageTitle
    background-image: url('http://w2k81368:2116/SiteAssets/Test.jpg');
    background-repeat:no-repeat;
    text-indent: 100%;
    white-space: nowrap;
    </style>
    Regards,
    Sunitha

    Hi Sunitha,
    According to your description, my understanding is that you want to change the list title to an image.
    I recommend to add the code below to the list page:
    <script src="http://code.jquery.com/jquery-1.10.2.min.js" type="text/javascript"></script><script type="text/javascript">
    $(document).ready(function (){
    var s = "<img alt='SP' src='http://w2k81368:2116/SiteAssets/Test.jpg'>";
    var $t = $("#DeltaPlaceHolderPageTitleInTitleArea span span a");
    $t.html(s);
    </script>
    After that, the list title will change to the image and it will show allitems.aspx page when clicking the image.
    Thanks,
    Victoria
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Victoria Xia
    TechNet Community Support

  • Need help with hyperlink for jpeg

    I sound like a noob.. but i have a single jpeg with different images on it... and i want to create a hyperlink for specific areas that you point to and not the entire jpeg.... i just can't seem to figure out how to do this, any help would be greatly appreciated

    Welcome to the discussions. See here:
    http://allaboutiweb.com/index.php/2009/01/fake-an-image-map-in-iweb/
    You may find more suggestions by clicking here.

  • Edited hyperlinked shape images not hyperlinking properly when published

    At my website:
    www.trianglepolysteel.com
    I've tried to add and edit hyperlinked shape images at the top of the page, namely "The PolySteel Systems" and "FAQs". No matter what I do--bring to front, recreate a brand new image, copy and paste one I know works--the published version does not hyperlink properly. I unselect "make all hyperlinks inactive" in the hyperlink inspector pane, rollover my mouse to ensure that all buttons take me to the proper place, then click them to prove it. Works in iWeb, not on the published page.
    Does anyone know how iWeb creates the code? When I save changes I've made, does it rewrite code for the entire page, or does it plug in edits at the end of the existing code? When I go in to view source in safari, it looks like it put the two edited/added images in a different location.
    Help! Visitors/potential customers are missing a valuable link on my site.
    Bradley

    OT,
    Yes, each is its own image, as making one text box and hyperlinking each word/phrase results in the unchangeable (arrrgh!) grey underlined text that changes to red on rollover.
    I've already been experimenting with exactly what you mentioned. I just tried shrinking all the image boxes, without encroaching on the text, so they would clearly not overlap. I'm publishing to me.com for these experiments so I don't have to keep publishing the entire site to a folder, then ftping to my server. Here's the page I just experimented with:
    http://web.mac.com/bradleyoder/iWeb/Triangle%20PolySteel/WhatIsPolySteel.html
    In iWeb, all links are good to go, no overlapping, etc. Curiously enough, on this page, there are even more dysfunctional hyperlinks with those image boxes.
    Any further thoughts?
    Bradley

  • How does one add hyperlinks to images in Mail signatures?

    Greetings esteemed Mac boffins,
    How do I add hyperlinks to images that I have added to signatures in Mac Mail?
    There seems to be no option for it.
    Regards,
    Ryan

    It's just not working for me.  I can't figure it out.
    As you can see in the screenshot, I have the icon selection and when I go to the "add link" menu item, it's greyed out.
    I have provided 2 screenshots for reference.

  • Hyperlink on images???

    Is there really no way to add an hyperlink to images in Pages? Seems icredible that all there is are workarounds to do this.
    Please help.
    Mark

    Laubender wrote:
    I wanted to point out and asking, if you made sure a proper Destination for hyperlinks were created by testing this part of your code and looking up the Destination in the GUI.
    Uwe
    I can't test the GUI since the code never gets past the line
    Dim myHyperlinkSource = aDoc.HyperlinkPageItemSources.Add(rect)
    That said, the URLs work fine if I place them in separate cells. I'm pretty sure that the problem is simply the choice of objects here, but I can't figure it out.

  • Relative paths for images upset by forwarding requests

    Hello World.
              I am using a web app deployed in Weblogic 5.1 with service pack 8.
              I have hit a problem which puzzles me. When I forward a request from
              one JSP to another (say from A to B) the web server seems to take the
              URLs of the images on the served file (B) relative to the path on the
              calling file (A). Here's a detailed explanation...
              Suppose I have a the web app structured as follow
              /oddApp/launch/A.jsp
              /oddApp/B.jsp
              /oddApp/images/tick.gif
              Page A simply stores its request URI and forwards its request to page B
              <jsp:forward page="/B.jsp" />
              Page B displays its requestURI, contextPath and servletPath. It also
              attempts
              to show three images
              <img src="images/tick.gif">
              <img src="../images/tick.gif">
              <img src="/images/tick.gif">
              When I invoke page B directly, the first image is shown, the others are not.
              When I invoke page A, it forwards to B and the second image is shown, the
              others are not.
              In each case the URI, contextPath and servletPath are correctly displayed
              with regard to page B.
              URI = [oddApp/B.jsp]
              contextPath = [oddApp]
              servletPath = [B.jsp]
              The URI in A.jsp is also correct (i.e. /oddApp/launch/A.jsp).
              The search for the images seems to be relative to the original URI (i.e. not
              the URI used to forward), which strikes me as daft. It means that page B
              must be aware of where it is being called from. It is perfectly plausible
              that
              relative paths which suit when called from one location are incorrect when
              called from another.
              I had thought that including the leadling slash (as shown as the third
              image)
              would cause the search relative to the document root (/oddApp/), but this
              appears not to be the case. The search is done relative to the root of the
              server not the web app.
              Adding jsp mappings in the deployment descriptor of the web app does not
              help (I had thought it a long shot anyway).
              Does anyone have any thoughts on this?
              PHiL
              

    i face the same problem (WinNT, WLS6.0): my wep app has a contextRoot " root " which makes it react to the URL: http://host:port/root /: it is this folder which will be used as a basis by the Web server But in the jps I use a relative URL for images: / images/toto.gif : it works very well when I deploy my jsp out of a Web-app by setting a document.root to the weblogic web server.On the other hand, once deployed in a Web-app, images are not found because the default path of the browser is http://host:port, without the context root of the Web-app! In other words, my war has images/*.gif in its root but when /images/toto.gif is resolved in a jsp, as the relative URL is not prefixed by my context-root, the image is not search in the war! actually, if I type http://host:port/root/toto.gif, my image appearsany clues? an alias on the web server? a setting in web.xml/application.xml and their weblogic equivalent files?
              

  • How to provide hyperlink for a particular field in ALV

    Hi,
      How to provide hyperlink for a particular field in alv report.
    Regards,
    Ramu.

    Yes you can do that. using the fieldcatalog there is an option for that. give HOT_SPOT = 'X'. for the column you want.
    wa_field-hotspot = 'X'.
    REPORT  ztest_alv.
    TYPE-POOLS:slis.
    DATA:it_fieldcat  TYPE  slis_t_fieldcat_alv,
         wa_field LIKE LINE OF it_fieldcat.
    DATA: BEGIN OF it_likp OCCURS 0,
           vbeln TYPE likp-vbeln,
          END OF it_likp.
    DATA: layout TYPE slis_layout_alv.
    wa_field-fieldname = 'VBELN'.
    wa_field-tabname = 'IT_LIKP'.
    wa_field-hotspot = 'X'.
    wa_field-outputlen = 10.
    wa_field-no_zero = 'X'.
    wa_field-seltext_l = 'Sales'.
    APPEND wa_field TO it_fieldcat.
    SELECT vbeln FROM likp
    UP TO 10 ROWS
    INTO TABLE it_likp.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
        i_callback_program      = sy-repid
        is_layout               = layout
        i_callback_user_command = 'USER_COMMAND'
        it_fieldcat             = it_fieldcat
      TABLES
        t_outtab                = it_likp
      EXCEPTIONS
        program_error           = 1.
    *&      Form  user_Command
    *       text
    *      -->UCOMM      text
    *      -->SELFIELD   text
    FORM user_command USING ucomm TYPE sy-ucomm
                        selfield TYPE slis_selfield.
      CASE ucomm.
        WHEN '&IC1'.
          SET PARAMETER ID 'VL'  FIELD selfield-value.
          CALL TRANSACTION 'VL02N' AND SKIP FIRST SCREEN.
      ENDCASE.
    ENDFORM.                    "user_Command

  • How do I show file size in the Finder icon view for images?

    How can I add the file size to the icon view "File Info" for images?
    I know how to get it to display the image size under View Options. In this mode it shows pixel dimensions for some images (not for svg or pdfs tho) and file size for some non-images (rar, zip, but not txt or plain text files).
    Is there some plist I can modify?

    Just found the answer in a post with this subject: 
    How Do I Change the Mailbox Font Size in the Sidebar?

  • DrawImage takes long time for images created with Photoshop

    Hello,
    I created a simple program to resize images using the drawImage method and it works very well for images except images which have either been created or modified with Photoshop 8.
    The main block of my code is
    public static BufferedImage scale(  BufferedImage image,
                                          int targetWidth, int targetHeight) {
       int type = (image.getTransparency() == Transparency.OPAQUE) ?
                        BufferedImage.TYPE_INT_RGB :
                        BufferedImage.TYPE_INT_RGB;
       BufferedImage ret = (BufferedImage) image;
       BufferedImage temp = new BufferedImage(targetWidth, targetHeight, type);
       Graphics2D g2 = temp.createGraphics();
       g2.setRenderingHint
             RenderingHints.KEY_INTERPOLATION, 
             RenderingHints.VALUE_INTERPOLATION_BICUBIC
       g2.drawImage(ret, 0, 0, targetWidth, targetHeight, null);
       g2.dispose();
       ret = temp;
       return ret;
    }The program is a little longer, but this is the gist of it.
    When I run a jpg through this program (without Photoshop modifications) , I get the following trace results (when I trace each line of the code) telling me how long each step took in milliseconds:
    Temp BufferedImage: 16
    createGraphics: 78
    drawimage: 31
    dispose: 0
    However, the same image saved in Photoshop (no modifications except saving in Photohop ) gave me the following results:
    Temp BufferedImage: 16
    createGraphics: 78
    drawimage: 27250
    dispose: 0
    The difference is shocking. It took the drawImage process 27 seconds to resize the file in comparison to 0.78 seconds!
    My questions:
    1. Why does it take so much longer for the drawImage to process the file when the file is saved in Photoshop?
    2. Are there any code improvements which will speed up the image drawing?
    Thanks for your help,
    -Rogier

    You saved the file in PNG format. The default PNGImagReader in core java has a habit of occasionally returning TYPE_CUSTOM buffered images. Photoshop 8 probably saves the png file in such a way that TYPE_CUSTOM pops up more.
    And when you draw a TYPE_CUSTOM buffered image onto a graphics context it almost always takes an unbearably long time.
    So a quick fix would be to load the file with the Toolkit instead, and then scale that image.
    Image img = Toolkit.getDefaultToolkit().createImage(/*the file*/);
    new ImageIcon(img);
    //send off image to be scaled A more elaborate fix involves specifying your own type of BufferedImage you want the PNGImageReader to use
    ImageInputStream in = ImageIO.createImageInputStream(/*file*/);
    ImageReader reader = ImageIO.getImageReaders(in).next();
    reader.setInput(in,true,true);
    ImageTypeSpecifier sourceImageType = reader.getImageTypes(0).next();
    ImageReadParam readParam = reader.getDefaultReadParam();
    //to implement
    configureReadParam(sourceImageType, readParam);
    BufferedImage img = reader.read(0,readParam);
    //clean up
    reader.dispose();
    in.close(); The thing that needs to be implemented is the method I called configureReadParam. In this method you would check the color space, color model, and BufferedImage type of the supplied ImageTypeSpecifier and set a new ImageTypeSpecifier if need be. The method would essentially boil down to a series of if statements
    1) If the image type specifier already uses a non-custom BufferedImage, then all is well and we don't need to do anything to the readParam
    2) If the ColorSpace is gray then we create a new ImageTypeSpecifier based on a TYPE_BYTE_GRAY BufferedImage.
    3) If the ColorSpace is gray, but the color model includes alpha, then we need to do the above and also call seSourceBands on the readParam to discard the alpha channel.
    3) If the ColorSpace is RGB and the color model includes alpha, then we create a new ImageTypeSpecifier based on an ARGB BufferedImage.
    4) If the ColorSpace if RGB and the color model doesn't include alpha, then we create a new ImageTypeSpecifier based on TYPE_3BYTE_BGR
    5) If the ColorSpace is not Gray or RGB, then we do nothing to the readParam and ColorConvertOp the resulting image to an RGB image.
    If this looks absolutely daunting to you, then go with the Toolkit approach mentioned first.

  • Hyperlink for a row content (Not for a filed/column)

    Hello Friends,
    I need to insert hyperlink for particular row value. I have code for adding hyperlink for a field that is column.
    Newspaper
    language
    epaper
    xxxxx
    xxx
    [email protected]
    yyyyy
    yyy
    [email protected]
    zzzzz
    zzz
    [email protected]
    for each row I must have different link. i.e. for xxx newspaper I must have a link [email protected] associated with that and when I click on that it should take me to that link in browser.
    Is there any field(like col-text and col-pos) in the table  lvc_t_fcat so that I can add the link here.
    Please share any idea for this requirement.
    Thanks in advance.

    see the link attached with the previous replay.
    DATA:
    BEGIN OF t_itab OCCURS 0.    "Output data
    INCLUDE STRUCTURE sflight.
    DATA carrid_handle TYPE int4.   "Corresponding link id from t_hype_link(this field for 'carrid')
    DATA END OF t_itab.
    Registering field CARRID_HANDLE with 'CARRID' in fieldcatlog.
    fs_fcat-fieldname = 'CARRID'.
    fs_fcat-web_field = 'CARRID_HANDLE'.
    fs_hype_link-handle = '1' .             "link id
    fs_hype_link-href = 'http://www.google.com' .
    APPEND fs_hype_link TO t_hype_link.
    LOOP AT t_itab .
    IF t_itab-carrid = 'AA'.
    t_itab-carrid_handle = '1' .         "assigning link for each row
    ENDIF.
    MODIFY t_itab.
    ENDLOOP.

  • Recommended image size and dimensions for images displayed on iPad retina?

    What are the recommended dpi image size and dimensions for images designed in DPS app as displayed on an iPad retina?

    Take a look at the following link:
    http://blogs.adobe.com/indesigndocs/2012/03/guidelines-for-creating-folios-for-ipad-3.html

  • Error opening PDF in 9.1.0 ("Insufficient Data for image") and 7.0.9

    I generate PDF documents in code (basically converts TIFF images to PDF, using FOP).
    Few of the PDFs can not be viewed on Adobe Reader 9.1.0, and 7.0.9. But, these open fine on 8.0 version.
    With 9.1.0 version I get error as "Insufficient Data for image"
    With 7.0.9  the error is "A drawing error occured"
    8.0 works fine and opens the PDF.
    Is there any issue with 9.1.0 for opening PDFs, I got this version installed recently on my system.
    Appreciate an early help/views on this issue.
    Thanks,
    Umakant

    Try this - from adobe support!
    It worked for me and (as it seems) solved a one year long anoying issue.
    1. Exit Acrobat.
    2. Choose Start > Run, and type: %APPDATA%\Adobe\Acrobat\ into the Open text box. Click OK.
    3. Right-click either the 6.0 or 7.0 folder, and choose Delete.
    I deleted both folders.
    Dont worry these two preferences folders will automatically be renewed by acrobat!

Maybe you are looking for