Expand my Community achievements bar.

Links Within PDF

Avatar

Former Community Member
I need a way to add links within a PDF.



This would react similar to Adobe Acrobat's settings, but I need a solution using LiveCycle Designer (7.0).



Any help would be greatly appreciated.
100 Replies

Avatar

Former Community Member
When you ask, "is there a machine way to have these specific destinations maintained", are you talking about having the links you've defined in your Word document maintained through the import process when importing the Word document into Designer as an XFA form?



If so, then there unfortunately isn't a way to do that yet because XFA doesn't natively support the notion of links. In this case, you don't really have a choice but to use the technique I described in post #6 of this thread.



There is something else you could use as well: Acrobat Bookmarks. You can read about this in post #1 of the
Adding bookmarks to an interactive form thread but note that
all annotations (such as bookmarks) are discarded when you open and save a PDF form in Designer so unless creating the bookmarks is the last thing you do prior to deploying your form(s) or that you can auto-generate the bookmarks every time the form is loaded (and that the form will only be loaded in Acrobat Pro or Standard), you'd probably be best to stick with the other technique.



Stefan

Adobe Systems

Avatar

Former Community Member
You translated me correctly--yes, I was hoping there was a way the software could do it. And it appears I understood you correctly--supposing that I had to do it manually.



I was indeed aware of the Acrobat Bookmarks, but I've played with them already and they didn't quite work because generating bookmarks as I create in Word is easier than having to do it after translation to .pdf. Thank you for the reminder though!



I've upgraded to Acrobat 7.0, which has taken care of many issues--and given me limitations that I can work around with ease.



Thank you again for all the help!

Avatar

Former Community Member
Is there a way to set links in designer? On thread 2 I found the Invisble button technique but I'm not sure where to enter the "Java code in the click event for the button." Can anyone help me?

Avatar

Former Community Member
Mary,



You can enter JavaScript code for an event pertaining to an object (usually a field or container) by using the Script Editor palette. Simply select the
Script Editor item from the Window menu in Designer and then, after selecting the object whose event you'd like to script, use the Script Editor's
Show property (drop down list on the left hand side) to select the event you would like to script (which would be the Click event, in this case).



Is this all you wanted to know? I'm still wondering what you were referring to when you mentioned, "thread 2"...



Stefan

Adobe Systems

Avatar

Former Community Member
It was the second response to the original posting way back when.

I do have one other question while you're available.

According to the Adobe website I should be able to design a form with a signature field using Acrobat designer in Adobe Professional 7.0 and my users should be able to sign the form in the free Adobe Reader.

Creating the form and the field were great! Love the new software.

However, I cannot get the signature field to respond in Adobe Reader 7.0. I think I might be missing a step in the design or form settings.

Any thoughts or should I post this on the reader board?

Thanks for the response by the way! Always nice to get an answer.

Mary

Avatar

Former Community Member
I see now the posting you were referring to. My instructions on how to locate and use the Script Editor should be what you need. Are you still having trouble with that?



Once you've activated the Script Editor for the button's Click event, just enter the following script (from that post -- should work either in FormCalc or JavaScript so you shouldn't need to modify the scripting language):



xfa.host.currentPage = 2;


Now about not being able to sign forms in the Adobe Reader. Unfortunately, this is a feature which isn't available to users using Reader unless the form they've loaded has been extended to allow the user to do such things as sign the form or save the data they've entered locally (a.k.a. "local save"). To do this, you need to use the
Adobe Reader Extensions or you can just load the form into Acrobat Professional (which permits all this functionality "out of the box").



Stefan

Adobe Systems

Avatar

Former Community Member
From the information online, we thought this was a tool within Adobe 7.0 Professional. The information online made it sound like Adobe 7.0 Professional allowed the author to extend the reader capabilities using a tool called "Reader Extensions." That is our whole reason for using Adobe 7.0 Professional instead of Adobe 5.0.

What are Adobe Reader Extensions?

Avatar

Former Community Member
Unfortunately, while it's true that Acrobat Professional 7.x does give you the possibility the enable
commenting in forms "out of the box" so that users of the Adobe Reader can comment on specific PDFs, it doesn't give you the additional capability of enabling such things as "local save" and signing forms. For that, you need to use the Adobe Reader Extensions.



You can read about Reader Extensions (RE)
here.



RE lets you activate "hidden" (or restricted) functionality in the free Adobe Reader on a per-form basis so that when that form is loaded into the Reader, the user suddenly has the ability to do what you've enabled the form to do (like sign the form or save entered data locally in order to continue filling it at a later time).



If you're enabling individual forms, you would use the web interface that's installed with RE. If you're Reader-Extending multiple forms, however, you may consider using the batch processing tool that's included.



Stefan

Adobe Systems

Avatar

Former Community Member
Stefan, thans for the information. I was afraid RE was additional software. We are currently only working with one form so I don't thing additional software will be justified.



However, I do have one more question on links. In excel, information in a cell on sheet one can be automatically copied into another cell on sheet two without making the user copy/paste the information. Is it possible to do something like that in Adobe 7.0 Professional with a java script? If yes, can you show me what that script might look like? I know next to nothing about Java Scripts.



Thank-you again for the time you've spent answering my questions. This is all so new to me.

Mary

Avatar

Former Community Member
Sorry, now I'm back to the Script Editor problem.

I was able to add the button, make it invisible, change the event to Click but when I went to type in the Script you gave me (in the box below the event, right?) it isn't showing anything I type? Am I typing it in the wrong place? Maybe, I'm just in over my head on this.

Why can't you apply hyperlinks in Adobe professional after creating all of your fields in designer? I open the form in Adobe Professional, edit it in Designer, and from that point on I no longer have the capability to insert hyperlinks in the form. Doesn't matter what I do, even if I save it as another name, no hyperlink capability. That's my real problem. Java Scripts is a work around to that problem.

Avatar

Former Community Member
With respect to having the content of a field replicated in other similar fields on other pages, you can do this without using any script in Designer if you make the fields
Global (which means that entering a value in one causes all other fields with the same name -- throughout the entire form -- to get the same value).



You can do this in one of two ways:







  1. Place a field on every
    body page of your form, give them all the same name and, using the Binding tab of the Object palette, set the Default Binding property to
    Global. You'll get a message box notifying you that all fields with the same name will now have a Global binding. Choose "OK".


  2. Switch the canvas to the
    master page tab by selecting the "Master Pages" item from the View menu in the main menu bar. Now, place a single field on the page at the location where it should appear on all pages. Then, using the Binding tab in the Object palette, set the field Default Binding to
    Global (choose "OK" from the warning dialog that appears).







The difference between solutions #1 and #2 is that solution #1 requires you to place distinct fields -- with the same name -- on all pages in your form while solution #2 only requires a single field which is then automatically replicated on all pages of your form -- which use the same master page (assuming you don't use master pages, this means each page of your form will get the field by default). The advantage of solution #2 over solution #1 is that if your form is dynamic in that its page count varies depending on the data that's merged into it, for example, you don't need to worry about figuring-out how to create a new field dynamically since each instance of a body page in Designer uses a master page -- the master page on which you placed the field to be replicated, by default.



I've attached a ZIP file containing two forms: One uses the first solution (body pages with distinct global fields on each one) and the second uses the second solution (master page with a single global field that gets automatically replicated).



Stefan

Adobe Systems

Avatar

Former Community Member
Now for your questions on using the Script Editor:



You say you don't see the script as you're typing it in...







» Is the editor window gray?



This would mean that it's disabled -- most likely because the button isn't selected. In order to set the script for the button's Click event, you must first select the button.







» Where's the insertion cursor when you're trying to type-in the script?



If it's on the gray line at the top where the name of the even is indicated, you won't be able to type because the editor won't let you modify that line. Place the insertion cursor on the next line.







Unfortunately, I'm a little at a loss as to why you wouldn't be able to type-in the script. Hopefully one of those solutions will do the trick.



I've attached a sample form which uses the script I had previously suggested on a button to make the form jump to its second page when the button is clicked.



Stefan

Adobe Systems

Avatar

Former Community Member
Finally, you asked why you can't add hyperlinks in Acrobat after you've designed your form in Designer.



This is because designing a form in Designer and saving it as PDF actually creates a PDF document with an embedded XDP file (the XDP file that you save if you save the form as XDP instead of PDF). At this point, the PDF file is just a wrapper around the actual form file (the XDP). What happens, then, when you open the PDF in Designer is that the attached XDP file is extracted and the PDF wrapper is discarded -- including anything that's considered an annotation (comments, attached files, shapes, etc.) and bookmarks. Therefore, when you load the form (PDF with an embedded XDP) in Acrobat Pro, it doesn't let you use those features because modifying the form in Designer afterwards will cause all those additions to be lost.



This doesn't mean, however, that you can't have bookmarks in your form, for example, because you can still create them using JavaScript and the AcroForm Object Model. You can access the AcroForm Object Model from any event by using the following object (in JavaScript):



event.target


This object is actually the AcroForm Document object which contains the form when it's loaded in (hosted by) Acrobat. From there, you can do this to add a bookmark:



event.target
.bookmarkRoot.createChild("Next Page", "this.pageNum++");




If you place that code in the root subform's ("form1" by default) Layout:Ready event (which occurs once the form's layout has been finalized), the bookmark will be automatically generated everytime the form is loaded in Acrobat. For more information on this, along with a sample, you should read my first post in the
Adding Bookmarks To An Interactive Form thread.



Stefan

Adobe Systems

Avatar

Former Community Member
I am trying to open a link within PDF in a new browser window using

app.launchURL().

It works fine in adobe 7 but does not work in lesser versions. please help. Is there any alternative ??



Thanks

Kishore

Avatar

Former Community Member
Unfortunately, the
app.launchURL is the only method you could use for what you want to do and it was only implemented in Acrobat 7.0 which is why it doesn't work in earlier versions of Acrobat (including Reader).



Stefan

Adobe Systems

Avatar

Former Community Member
Stefan,

It's Mary again. (The adobe signature pest.)

Can you think of any other way to Protect an approval "signature" but allow it to be filled in when opened in Reader like the other fields in a form? Is there any kind of password protection you can place on a field?

My boss really wants to use the adobe form but can't get around the Reader Extensions prices.

Thanks for the VB codes and advice. I finally got it all working.

Mary

Avatar

Former Community Member
Mary,



I'm glad to hear you got the rest of your form working with those scripts!



Unfortunately, there's no other technology I'm aware of that'll give you the same assurances of data integrity (data hasn't changed since form was signed), non-repudiation (you can't deny it wasn't you who signed the form) and security that a digital signature can offer you.



Now if you're interested in
simulating a signature whereby certain fields get "locked" once they're filled (baring in mind that this is
not a replacement for digital signatures as this method doesn't guarantee data integrity and non-repudiation), you could have a look at the following thread where I discussed a technique suggested by another customer:




Single field password protected



The final solution and sample is included in the 8th post to the thread.



Stefan

Adobe Systems

Avatar

Former Community Member
You're a genius! I think this solution just might satisfy my boss. If you don't hear from me it worked, otherwise we'll talk soon.

I never thought working with Adobe would teach me so much about scripting. I've learned a lot and everyone on this forum has been such a wonderful help.

Thank-you all so much.

Mary

Avatar

Former Community Member
Stefan,

Can I use the example from you referred me to to do the following?



Protect the fields upon opening the file,

Unprotect when a button is clicked,

Re-protect upon completion of entering the information.



Is there something I would need to add at the beginning of the string in order to accomplish this? Could I simply place the "protection" portion of the script at both the beginning and end of the script? Would that work?



Talk to you soon and Thanks in advance!

Mary

Avatar

Former Community Member
Sure, but I don't think it's quite as simple as you're thinking it might be.



If I understand correctly, you want the fields to be initially "locked" if they haven't been "protected" already. Once they're "protected", they can no longer be "unlocked". Is that correct?



I've modified the form from the thread I had referred you to in order to incorporate this design change. Essentially, the script you needed was already on the first version of the form but you now needed a second button which would let you unlock the fields and which would only be visible if the fields weren't already protected on load.



Have a look at this sample and let me know if that's what you were wanting to do.



Stefan

Adobe Systems

Avatar

Former Community Member
I wish I could send you the form. This is a long message.

I have four Approval pages. Each page has 9 "signature" text fields. (Not signature fields!) Each text field has a "Yes" or "No" button to approve or not approve the project status. (We've lost the date field for now.) I also have an Approval Summary Page where each approval is supposed to be automatically recorded.



Here is what my boss wants. It's way over my head and I can't figure out how to manipulate the script you sent me to make it work.



He would like to see if they click "Yes" it puts the current date in text field 66 and the persons name "Mario Ramos" in text field 102.

If they select "No" he would like to see "Not Approved" in both text field 66 and text field 102.



I have gone into the script you wrote for protecting and unprotecting the fields but I can't figure this out.



I have looked at these scripts so much they make no sense to me anymore. Ever get that way? I am sure the one I have now is nothing like the one you originally sent me. Now it looks like this... (YIKES!)



if (TextField66.rawValue != yes && TextField66.rawValue.length > 0 Then TextField102.rawValue != MarioRamos && TextField102.rawValue.length > 0)

{

// "lock" the fields

TextField66.border.fill.color.value = "230,230,230";

TextField66.access = "readOnly";

TextField102.border.fill.color.value = "230,230,230";

TextField102.access = "readOnly";



// save value of lock

Lock.rawValue = "1";



// make the lock button disappear after some time

app.setTimeOut("this.getField('form1[0].#subform[0].Protect[0]').hidden = true;", 1000);

}

else

{

app.alert("Please enter data in both fields prior to locking them.");

}



Sorry, I am such a pest, but I am learning.

Thanks,

Mary