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

Clickable Button to run an action/shortcut.

Community Beginner ,
Feb 16, 2018 Feb 16, 2018

Copy link to clipboard

Copied

What I want to do is create a form that is fillable from a Delimited text file. I already have all of that set up and working. I however want to make it simpler for my colleagues who aren't as savvy by allowing them to click a button embedded in the PDF that will automatically point to the delimited file and just launch the "import data from delimited text file" box so that they can just choose what they need. I am not great with writing javascript, does anyone have a basic idea if this is doable and what script would be needed to call the file?

Thanks in advance.

TOPICS
Acrobat SDK and JavaScript , Windows

Views

460

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 ,
Feb 16, 2018 Feb 16, 2018

Copy link to clipboard

Copied

If you want to specify the file path in the script it has to run from a "privileged context", ie a .js file that's installed on the user's local machine.

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 Beginner ,
Feb 16, 2018 Feb 16, 2018

Copy link to clipboard

Copied

Is there any alternative to this? we are at a university and I don’t think we have access to the folders where the .js file would have to be installed. (If you could confirm the folders I can check)

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 ,
Feb 16, 2018 Feb 16, 2018

Copy link to clipboard

Copied

Not without a lot of effort. You can use a button to open the file selection dialog, and then the row selection dialog, though.

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 Beginner ,
Feb 16, 2018 Feb 16, 2018

Copy link to clipboard

Copied

How would this be done?

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 ,
Feb 16, 2018 Feb 16, 2018

Copy link to clipboard

Copied

Using this code:

this.importTextData();

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 Beginner ,
Feb 16, 2018 Feb 16, 2018

Copy link to clipboard

Copied

Does anything go inside the parenthesis? And is this in the buttons JavaScript section or the JavaScript section for the file itself?

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 ,
Feb 16, 2018 Feb 16, 2018

Copy link to clipboard

Copied

LATEST

In this case, no. Use it as I provided it.

And it should go as the Mouse Up event of your button.

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 ,
Feb 16, 2018 Feb 16, 2018

Copy link to clipboard

Copied

Yes, but what you are asking about is creating an Automation tool, not a form feature. As Try67 has already stated, this type of activity requires privilege.

You can read more about automation and data handling here:

Automating Acrobat can save you loads of time.

https://www.pdfscripting.com/public/ExcelAndAcrobat.cfm

The last tool listed on this page displays a popup menu of options from a CSV (comma separated), for auto-filling fields on a form, which sounds a lot like what you need.

Search Downloads

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