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

115

Likes

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
Adobe Community Professional ,
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

Likes

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
Most Valuable Participant ,
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.

Likes

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.

Likes

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