Linking the data with JavaScript for PDF link merge field

Hi all

In InDesign, I use the data merge to generate a PDF file with data from a data source file. The fusion of data will fill a product ID field. I want to write a script that changes the product number field so that it contains a JavaScript link in the PDF file.


For example, the number of the product [1234-567] will launch: app.launchURL ("plsddr://localhost/1234-567 |") * "(, true);" When the product number link is clicked on in the PDF file.

Can anyone provide an example of how this could be done, or point me in the right direction? If there is a better way to go about it, please let me know.

Thank you!

What findText returns is a list of text, but it is completely interchangeable with the word. It seems that InDesign can change at will between the characters, words, lines, paragraphs, and stories.

Text can consist of a single SpecialCharacter (a column break, or a return or one of the SpecialCharacters enumeration) or a "String" standard JavaScript object - a simple Unicode string.

The property that "holds" the text is 'content' - so, it all adds to 'get' the text that has been found, you will use generally

Next = list.pop ();

Alert ("the text content of this is"' + next.contents +' "'");

and you can build further on it - use it as a URL HyperlinkDestination or something like that. The fixed points of point-'next' - text 'live', it was found in, so be careful not to change. Do something like

Next.contents = "hey what happened."

will change the text in your document. But it is also useful to add, for example, a hyperlink to the actual position on this text has been found.

(A Council about the changes: you want to change your document, the original findText elements stressed will be ruined once you changed one!) To avoid this, work backwards from the last element found at the first. findText (true) reverses the order of the found items, from the last to the first - see JS help on that).

Regarding

(Also, how to print the contents of a Word object?)

It depends on what you mean by "printing". On a printer?

Tags: InDesign

Similar Questions

  • How to paste into the text field of the Clipboard with JavaScript?

    I implement the following actions in the form of javascript:

    1. a user clicks on a link on the PDF to open a web page

    2. the user uses the web page to find information and then copy text from the web page

    3. the user clicks a button on the pdf form and it formats the text to the Clipboard and paste them into the text fields.

    I can't find any references for the reading of the data from the Clipboard with javascript in PDF Forms. is it not possible?

    Perhaps 'not possible' was a little too hard. It would be a security hole if she accepts a script in a form to copy the contents of the Clipboard without the user explicitly allowing it. It has been possible to copy the contents of the Clipboard into a form field using the app.execMenuItem method without the user knowing / allowing it, but that hole was closed. The restriction can be overcome, as explained in the documentation: http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.143.html

  • How to get the date of deployment for the RT code?

    I'm using LabVIEW 8.5 and MAX 4.4.1f0 and cFP-2110. I want back the date of the deployment. Is it possible to recover the date of deployment for the RT code?

    Thank you

    Martine

    Hi John,.

    You must be able to FTP into your PSC 2110 from a Windows Explorer window and check the date of 'Change' of the startup.rtexe/or-rt/startup folder.

    Aaron P

    National Instruments

    Technical sales engineer

    http://www.NI.com/support

  • all my data is all save on the local disk c, how to share the data with the other drive, local drive d.

    all my data records on the local disk c, how to share the data with the other drive, local drive d.

    Hi Jasonbichard,

    1. what type of drive is D? Is - this another partition on the same disk?

    2 Windows operating system you are using?

    You can change the location of the disk to save the data in the d: instead of C: and check if it helps.

    a. navigate to the location (username) C:\Users\.
    b. right click on the folder that you want to change the location, and then select Properties.
    c. click on the location tab and change the location to D: drive.

    d. click on apply and Ok.

  • Update fail, have 3 updates that load, but then the icon appears again advise that even the dates are ready for loading.

    I have Windows XP Home Edition Version 2002 Service Pack 3.  I have 3 updates that load, but then the icon appears again advise that even the dates are ready for loading.  Is it possible that updates sent me are for the 2003 Version?  Whenever I update these 3 updates, a window shows updated loading successfully, but they still remain as an icon in my taskbar?

    CrystalBall © SEZ...

    See the RESPONSE message in this thread-online http://answers.microsoft.com/thread/49ed2fe1-6782-4498-814a-ccfa6ec1dfc9

  • How to read the data with different XML schemas within the unique connection?

    • I have Oracle database 11g
    • I access it via JDBC: Slim, version 11.2.0.3, same as xdb.
    • I have several tables, each has an XMLType column, all based on patterns.
    • There are three XML schemas different registered in the DB
    • Maybe I need to read the XML data in multiple tables.
    • If all the XMLTypes have the same XML schema, there is no problem,
    • If patterns are different, the second reading will throw BindXMLException.
    • If I reset the connection between the readings of the XMLType column with different schemas, it works.

    The question is: How can I configure the driver, or the connection to be able to read the data with different XML schemas without resetting the connection (which is expensive).

    Code to get data from XMLType is the implementation of case study:

     1   ResultSet resultSet = statement.executeQuery( sql ) ; 
    2   String result = null ;
    3    while(resultSet.next()) {
    4   SQLXML sqlxml = resultSet.getSQLXML(1) ;
    5   result = sqlxml.getString() ;
    6   sqlxml.free();
    7   }
    8   resultSet.close();
    9    return result ;

    It turns out, that I needed to serialize the XML on the server and read it as BLOB. Like this:

     1    final Statement statement = connection.createStatement() ;  2    final String sql = String.format("select xmlserialize(content xml_content_column as blob encoding 'UTF-8') from %s where key='%s'", table, key ) ;  3   ResultSet resultSet = statement.executeQuery( sql ) ;  4   String result = null ;  5    while(resultSet.next()) {  6   Blob blob = resultSet.getBlob( 1 );  7   InputStream inputStream = blob.getBinaryStream();  8   result = new Scanner( inputStream ).useDelimiter( "\\A" ).next();  9   inputStream.close(); 10   blob.free(); 11   } 12   resultSet.close(); 13   statement.close(); 14  15   System.out.println( result ); 16    return result ; 17
    

    Then it works. Still, can't get it work with XMLType in resultset. On the customer XML unwrapping explodes trying to pass to another XML schema. JDBC/XDB problem?

  • See the date with timestamp column column

    Hello

    In the table have am capture the creation_date as date data type column. I prepare a report to display the date. Is it possible to display the date with creation of time stamp

    I use oracle 10g Enterprise Edition

    The table name is LICENSING name column is CREATION_DATE

    Please suggest me

    Thank you
    Sudhir

    Which indicates that the data currently stored in the table always have an hour of midnight. Whatever the application / process that inserts the data is, apparently, not the component "time" DATE in the desired way. You will need to set the insertion process to spend time in your report.

    Justin

  • Get the date with the millisecond of the table

    I want to get the date with milliseconds in table format in the variable. How to get there?

    SQL > create table test_date (col1 date);

    Table created
    SQL > insert into test_date values (sysdate);

    1 row inserted

    SQL > commit;

    Validation complete

    SQL > select * from test_date;

    COL1
    -----------
    18/12/2009


    Here I have to get datewith "millisecond" format and put it into the variable varchar2 (50) and pass this
    to Java.


    SQL > select to_char (COL1, ' mm/dd/yyyy hh24:mi:ss. FF') of test_date;

    Select to_char (COL1, ' mm/dd/yyyy hh24:mi:ss. FF') of test_date

    ORA-01821: date format not recognized

    SQL >

    Thank you
    Khaldi

    user601042 wrote:
    I want to get the date with milliseconds in table format in the variable. How to get there?

    SQL > create table test_date (col1 date);

    Your data col1 type should be TIMESTAMP.

    See you soon
    Sarma.

  • Stimulant of the button with javascript under a button in pdf format

    Hi all

    Is it possible to stimulate using acrobat javascript or javascript livecycle @under a key press button?

    For ex. I click on a button and who work as Atl + F (File menu) or win + R (run box) under windows.

    Hope this is clear.

    Thank you

    Arvind

    LiveCycle Designer uses the same JavaScript engine that Acrobat and Reader when the LiveCycle form is in PDF format. So, as stated in the form Acrobat JavaScript, the JavaScript engine and capabilities. As explained in the Acrobat JavaScript forum, JavaScript used in Acrobat or Reader is the willingness to 'sand' or very isolated from the JavaScript of your computer program. This was done to protect users of form Acrobat or Reader to run malicious code.

    It might be possible if you were writing a plugin add-on using a computer program have complied and the information provided in the Acrobat SDK kit. You must manually install this program on your system. For others to use the code, you will need to register as a developer with Adobe and have each user to install the code on their system at their own risk.

  • Help with Javascript for the button Delete

    Hi, Im new JavaScript and have my code works partially, but the trouble with a nested if-then-else statement.

    I have a page element, P4_COUNT, and if its value is 0, the button Delete will allow the user to delete the record. If the number is > 0, a message should appear stating that the record cannot be deleted. That's what I have so far and it works, but the first ELSE is misplaced. This code is the URL target for my button remove.

    JavaScript:var response; response = confirm ("are you sure you want to delete this POC?'");
    If {(response)
    If (document.getElementById('P4_COUNT').value == 0) {}
    doSubmit ('DELETE');
    }
    }
    else {-this other fires when the user hits cancel on the first question above not what I want, I want another one here who said only: "removal cancelled '"}
    -This one should only be fired if p4_count is not equal to 0
    var answer2;
    answer2 = confirm ('you cannot remove this POC, that this POC is associated with a RIF.');
    If {(answer2)
    Alert ('cancelled deletion');
    }
    else {}
    Alert ('cancelled deletion');
    }
    }


    The above should follow this logic:

    Are you sure you want to delete this POC?
    Yes - if p4_count = 0 then
    delete the record
    on the other
    second line: cannot delete this record
    OK - prompt removal cancelled
    Cancel - prompt removal cancelled
    end if;
    Cancel - prompt removal cancelled


    Help, please. Thank you, Laura

    Published by: user8936524 on May 10, 2010 14:14

    Hello

    Try if it works. I didn't test it

    javascript:if($v('P4_COUNT')*1==0){
    var answer=confirm('Are you certain you want to delete this POC?');
    if(answer){doSubmit('DELETE');}
    else{alert('Deletion Cancelled');}
    }else{alert('You may not delete this POC, as this POC is associated to an FRR.');}
    

    BR, Jari

  • Impossible to change the Data Execution Prevention for a specific program

    Original title: Data Execution Prevention

    Hi, can't seem to be able to change my Data Execution Prevention for one of the programs that I'm running. I followed the instructions from microsoft, but nothing happens. Can someone help? Thank you.

    Hello

    EricLaw IEInternals - a peek at Internet Explorer from inside. -Understanding DEP/NX
    http://blogs.msdn.com/ieinternals/archive/2009/10/10/understanding-data-execution-prevention-crashes-in-IE8.aspx

    The problem might actually be an addon or another program causing the problem and you
    must verify that 1.

    What antivirus/antispyware/security products do you have on the machine? Be one you have
    EVER had on this machine, including those you have uninstalled (they leave leftovers behind which)
    may cause strange problems).

    Start - all programs - Accessores - system tools - IE with no Addons - does this work better?

    IE - Tools - Internet Options - Advanced - tab click on restore, and then click Reset - apply / OK

    IE - Tools - Internet Options - Security - reset all Zones by default level - apply / OK

    not better?

    Close IE and try again IE or IE with no Addons

    IE - tools - manage Addons (for sure disable SSV2 if she's here, is no longer necessary, but)
    Java always install it and it causes problems - you never update Java to go back in and turn it off again.)
    Search for other possible problems.

    Windows Defender - tools - software explore - look for problems with programs that do not look
    right. Allowed are usually OK and "unauthorized" are not always bad. If a doubt
    program to ask about it here.

    Could be a free - BHOremover - BHO - standalone program, needs no installation, download and
    run - not all are bad but some can cause your question. (Toolbars are BHO)
    http://securityxploded.com/bhoremover.php

    Startup programs
    http://www.Vistax64.com/tutorials/79612-startup-programs-enable-disable.html

    Also get Malwarebytes - free - use as scanner only. If you ever think malware and which would be
    stands with Prevx running except for a cookie of occasional low level (not a big deal), the update
    and then execute it as a scanner.

    http://www.Malwarebytes.org/

    I would add prevx so.

    Prevx - home - free small, fast, exceptional protection CLOUD, working with other security
    programs. It is a single scanner, VERY EFFICIENT, if it finds something come back here
    or use Google to see how to remove.
    http://www.prevx.com/

    PCmag - Prevx - Editor's choice
    http://www.PCMag.com/Article2/0, 2817,2346862,00.asp

    -------------------------------------------------------------------

    Do yourself a big favor and work through 1 above.

    Data execution prevention Internet Explorer Windows 7 included - several methods here difficult
    http://HubPages.com/hub/data-execution-prevention-Internet-Explorer

    Feature Data Execution Prevention, or DEP in Windows Vista & Windows 7 - see also the links to the
    at the bottom of this page.
    http://www.WinVistaClub.com/F33.html

    How control DEP but I don't recommend turning it off and certainly not to let power off.

    How to enable DEP on or off for a program of Vista (and Windows 7)
    http://www.Vistax64.com/tutorials/65790-DEP-turn-off-programs.html

    How to enable or disable DEP in Vista (and Windows 7)
    http://www.Vistax64.com/tutorials/120778-DEP-enable-disable.html

    ====================================

    If nothing else works you can try this however I would use as a last resort.

    IE - Tools - Options - Advanced Options - Internet Security Section - clear the check box enable memory
    Protection to mitigate the attacks online - APPLY - OK close and restart IE

    Hope this helps. |

    Rob Brown - MS MVP - Windows Desktop Experience: Bike - Mark Twain said it right.

  • Add the Date and time in PDF format when printing in Acrobat Pro ms

    Hello!

    I am trying to find a way to add a date stamp and time in a PDF file in Acrobat Pro ms when the document is printed. I found a great video on how to do it, but the version of Acrobat is older and the method no longer works.

    Old video version: https://acrobatusers.com/tutorials/how-to-add-a-date-stamp-to-a-form.

    The video lasts only 1.5 minutes and described what I need a t-shirt! I know that the process requires javascript, but I have no experience with this and need a very simple description of what I need to do (very, very basic if you please). As and for the record, I'm working on a Windows 7.

    mrsholliemae wrote:

    I am able to locate where to edit the document and the option "add text".

    ...

    Do not use it.

    Use the 'form to prepare' and add a text box.

  • How to remove line empty when the data are not for a text field

    I created a PDF with Acrobat Pro 11 model. This model has an address of the employer with the address line 1, address line 2, city, State, zip code, country. The requirement is to show address line 1 and line 2 address in separate lines and address line 2 cannot be present always. If address line 2 is not present then the PDF should not show a blank line. How do I get there?

    These data are populated through xml by a publisher of BI. New line characters do not work.

    Appreciate your help on this.

    Hi sprphoto123,

    If you do not enter data in the text field 2 then you can set the form field property to is not mandatory, but if you want to disable the 2nd text field, you can add a check box in front of it to turn off the field. This can be achieved using JavaScript.

    Kind regards

    Nicos

  • How to use the date with the report parameter format

    Hi all

    How to use the date format with this tag function,

    <? param@begin:P_FROM_DATE? > <? $P_FROM_DATE? >

    This date of form source of report and setting is coming as this 2012/11/01 00:00:00.

    So now I need this in MY-DD-YYYY marker. I tried like this..? param@begin:P_FROM_DATE? > <? $format - date: P_FROM_DATE; ' DD-MON-YYYY '? >

    but its giving error. Can someone pls how to convert to the format of date custom.

    Thanks and greetings
    Srikkanth.M

    Problem solved.

    REF this link

    Date Format of XML

  • Need help with Javascript for Acrobat 9 Pro

    Hello

    I have created a PDF form in Adobe Acrobat 9 of Profession.  Not having not much experience with Javascript, I found this forum very helpful and have many examples of script used to other issues, I had.  I was hoping that someone could help me with the following script, I tried many variations, cannot operate.

    var ratio = this.getField("ratio").value
    concentration of var = this.getField("concentration").value
    var result = this.getField("result").value
    If (ratio.value > = 50.00)
    {result.value = 'PASS' ;}
    If (ratio.value".value > = 40.00)
    {result.value = 'PASS' ;}
    If ((concentration.value ==61) & & (ratio.value > = 49,25))
    {result.value = 'PASS' ;}
    If ((concentration.value ==61) & & (ratio.value > = 39.25))
    {result.value = 'PASS' ;}
    If ((concentration.value ==62) & & (ratio.value > = 48.50))
    {result.value = 'PASS' ;}
    If ((concentration.value ==62) & & (ratio.value > = 38.50))
    {result.value = 'PASS' ;}
    on the other
    {result.value = "FAIL" ;}

    It's just a piece of code, concentration values run from 61 to 99 and the value of the ratio varies for each value of the concentration, there is a high ratio and a low ratio.  The result of this field to complete the field of results with a SUCCESS or a FAILURE.  This isn't working... any help is greatly appreciated!

    If this script is attached to the Calculate of the "result" field event, if I understand correctly the logicm code should be something like:

    // Get a reference to the ratio field
    var ratio = this.getField("ratio");
    
    // Get a reference to the concentration field
    var concentration = this.getField("concentration"); 
    
    // Default
    var res = "FAIL";
    
    if (ratio.value >= 40.00) {
        res = 'PASS';
    }
    
    if ((concentration.value == 61) && (ratio.value >= 39.25)) {
        res = 'PASS';
    }
    
    if ((concentration.value == 62) && (ratio.value >= 38.50)) {
        res ='PASS';
    }
    
    // Set this field's value
    event.value = res;
    

    If the code is placed elsewhere, you must indicate the location.

Maybe you are looking for