javascript for acrobat

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • denis

    javascript for acrobat

    Is there someone who could help with a javascript in Acrobat?
    The context is a PDF document containing an alphabetical list of 1000 titles
    (with individual links to other PDF documents) where the user has to make
    his choice. Instead of letting him scan through this long list, we would
    rather let him type what he is looking for, while a javascript would detect
    the matching strings and stripdown the list along
    with the typing.
    Mostly only a few keystrokes (<10) would already be enough to reduce the
    number of matching items to a fairly readable list, where the user could
    then make his choice by hitting the link.

    Thanks in advance for your help.

    Mathilda D. Kerbacho




  • Jeff North

    #2
    Re: javascript for acrobat

    On Tue, 8 Jun 2004 15:04:57 +0200, in comp.lang.javas cript "denis"
    <kerbacho@gmx.n et> wrote:
    [color=blue]
    >| Is there someone who could help with a javascript in Acrobat?
    >| The context is a PDF document containing an alphabetical list of 1000 titles
    >| (with individual links to other PDF documents) where the user has to make
    >| his choice. Instead of letting him scan through this long list, we would
    >| rather let him type what he is looking for, while a javascript would detect
    >| the matching strings and stripdown the list along
    >| with the typing.
    >| Mostly only a few keystrokes (<10) would already be enough to reduce the
    >| number of matching items to a fairly readable list, where the user could
    >| then make his choice by hitting the link.
    >|
    >| Thanks in advance for your help.[/color]

    AFAIK, you can't. A PDF file is static unless everyone has the full
    PDF version installed that allows them to enter information into PDF
    forms.

    Why not create a web page and use a bit of javascript to control the
    user select.

    Comment

    • Mathilda D. Kerbacho

      #3
      Re: javascript for acrobat

      [color=blue]
      > AFAIK, you can't. A PDF file is static unless everyone has the full
      > PDF version installed that allows them to enter information into PDF
      > forms.[/color]
      Javascript works fine with Acrobat (XML forms) ;
      the syntax is slightly different from web environment but the features are
      more or less the same.

      M.D.K.


      Comment

      • Mark Anderson

        #4
        Re: javascript for acrobat

        Mathilda,

        "denis" <kerbacho@gmx.n et> wrote in message
        news:10cbebq39i evi51@corp.supe rnews.com...[color=blue]
        > Is there someone who could help with a javascript in Acrobat?
        > The context is a PDF document containing an alphabetical list of 1000[/color]
        titles[color=blue]
        > (with individual links to other PDF documents) where the user has to[/color]
        make[color=blue]
        > his choice. Instead of letting him scan through this long list, we[/color]
        would[color=blue]
        > rather let him type what he is looking for, while a javascript would[/color]
        detect[color=blue]
        > the matching strings and stripdown the list along
        > with the typing.
        > Mostly only a few keystrokes (<10) would already be enough to reduce[/color]
        the[color=blue]
        > number of matching items to a fairly readable list, where the user[/color]
        could[color=blue]
        > then make his choice by hitting the link.
        >
        > Thanks in advance for your help.
        >
        > Mathilda D. Kerbacho[/color]

        Acrobat v4/v5/v6 JS all support a 'keystroke' event for fields (includes
        lists/combos) and you can use this to hook the script you'll need. As
        for scripts here are couple of suggestions:
        Build the skills your teams need. Give them the O'Reilly learning platform and equip them with the resources that drive business outcomes.

        and

        ....you may need to adapt any advanced DOM stuff for Acrobats more
        limited JS object model.

        Another good place to look for Acrobat JS help is www.planetpdf.com
        including their free and helpful user-to-user forums.


        HTH

        Mark Anderson


        Comment

        • Mathilda D. Kerbacho

          #5
          Re: javascript for acrobat

          Mark Anderson wrote:
          [color=blue]
          > As for scripts here are couple of suggestions:
          > http://www.oreillynet.com/pub/a/java...nygoodman.html
          > and
          > http://www.devarticles.com/c/a/JavaS...t-As-You-Type/[/color]
          Both well documented and close to our purpose, especially the latter.
          Many thanks for the clue.
          [color=blue]
          > ...you may need to adapt any advanced DOM stuff for Acrobats more
          > limited JS object model.[/color]
          Is it feasible?

          M.D.K.


          Comment

          • Mark Anderson

            #6
            Re: javascript for acrobat

            Mathilda,

            "Mathilda D. Kerbacho" <kerbacho@gmx.n et> wrote in message
            news:10ceg1m535 6hm16@corp.supe rnews.com...[color=blue]
            > Mark Anderson wrote:
            >[color=green]
            > > As for scripts here are couple of suggestions:
            > >[/color][/color]
            http://www.oreillynet.com/pub/a/java...nygoodman.html[color=blue][color=green]
            > > and
            > > http://www.devarticles.com/c/a/JavaS...t-As-You-Type/[/color]
            > Both well documented and close to our purpose, especially the latter.
            > Many thanks for the clue.
            >[color=green]
            > > ...you may need to adapt any advanced DOM stuff for Acrobats more
            > > limited JS object model.[/color]
            > Is it feasible?
            >
            > M.D.K.
            >
            >[/color]

            Not in a position to test right now. you just need 2 form elements -
            either text box and list box, or perhaps just a combo. If I were trying
            this I'd strip all the DHTML references (e.g. getElementById etc.) and
            put placeholder comments. So now you have the basic JS logic and just
            <g> need to replace the placeholders with the correct JS names (think
            core JS in a different DOM). Make sure you have the JS Guide for
            Acrobat to hand. In v4/v5 it was on the Acrobat Help menu. Not sure
            where it is on v6 - you might need to dig out your install disk (in all
            cases the doc is a PDF).

            If you get stuck I commend you to the JavaScript sub-section of the
            PlanetPDF user-to-user forums - there are some very experienced and
            friendly PDF+JS folk there.

            Regards

            Mark


            Comment

            • Mark Anderson

              #7
              Re: javascript for acrobat

              2 more references for you:
              JavaScript is a programming language that is primarily used to create interactive and dynamic website content. It can be used to manipulate the Document Object Model (DOM) in a web page, making it a popular choice for creating dynamic user interfaces and web applications.



              Regards

              Mark


              Comment

              • Mathilda D. Kerbacho

                #8
                Re: javascript for acrobat

                Thank you, Mark.
                Your suggestion is encouraging. I'll try.
                [color=blue]
                > If you get stuck I commend you to the JavaScript sub-section of the
                > PlanetPDF user-to-user forums - there are some very experienced and
                > friendly PDF+JS folk there.[/color]
                I have posted my question there. Feasibility was confirmed.

                Kind regards.

                M.D.K.



                Comment

                Working...