• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Using user entered form field data to code a hyperlink

New Here ,
May 09, 2019 May 09, 2019

Copy link to clipboard

Copied

Hello,

I am creating a flyer with form fields on it, that will ultimately be flattened to read only by submit button and saved as a PDF.

One of the form fields is for the end user to enter a URL. I named it referralLink

Is it possible to pull the data from referralLink and program it to a hyperlink so that after the form and PDF is flattened and exported, the hyperlink will navigate to said URL.

TOPICS
Acrobat SDK and JavaScript

Views

277

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 09, 2019 May 09, 2019

Copy link to clipboard

Copied

It depends. Data can be acquired from an URL with a trusted function in Acrobat Professional. This really only works from a folder level script. Can you install an Acrobat script onto all the systems where this form will be used?

The app.launchURL() function opens a web page.

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 09, 2019 May 09, 2019

Copy link to clipboard

Copied

Exported to what format, exactly? You can display the URL as plain-text and it might get picked up, depending on the format.
Anything else is not likely to work.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 10, 2019 May 10, 2019

Copy link to clipboard

Copied

LATEST

I figured this out:

I am simply creating a PDF flyer template with customizable contact and sales rep information. The rep has a unique URL that they will type in to the form, along with their name, title and contact. There is a graphic of a button (created in the authoring too) that I placed a transparent form submit button with the following code:

var linkers = this.getField("referralLink").valueAsString; //referralLink being the field with the URL

app.launchURL (linkers, true); //opens browser window and navigates to URL on click

Elsewhere on the PDF is a SUBMIT button that flattens the form and opens a save as prompt so that the rep can save and reuse the PDF.

I've figured this out. Thanks for your responses.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines