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

How to use the User's Documents folder in Javascript?

Community Beginner ,
Jan 05, 2020 Jan 05, 2020

Copy link to clipboard

Copied

This works fine in the Javascript area of a pdf document:

this.exportAsXFDF({cPath:"/C/My folder/2020/File.XFDF",bAnnotations:true})

 But I don't know how to change the C/My folder/2020/File.XFDF to The User's Document folder/2020/File.XFDF?

TOPICS
Acrobat SDK and JavaScript

Views

559

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

correct answers 1 Correct answer

Community Beginner , Jan 14, 2020 Jan 14, 2020

Today I worked on it and it and used a variable for the user documents map and filename. Then checked it with the app.alert function. And then put the variable after cPath and it workes fine. (Windows 8.1).

Votes

Translate

Translate
LEGEND ,
Jan 05, 2020 Jan 05, 2020

Copy link to clipboard

Copied

The things available to you are deliberately limited and deliberately locked out of embedded JavaScript, but check out app.getPath, it looks like it is designed to return what you need.

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 ,
Jan 05, 2020 Jan 05, 2020

Copy link to clipboard

Copied

Yes, you can get it using this code, but you have to run it from a privileged context:

app.getPath("user", "documents");

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 ,
Jan 07, 2020 Jan 07, 2020

Copy link to clipboard

Copied

Thank you for your reply, but I don't know where the privileged context is, only where the Javascript area of a pdf document is.

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 ,
Jan 07, 2020 Jan 07, 2020

Copy link to clipboard

Copied

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 ,
Jan 14, 2020 Jan 14, 2020

Copy link to clipboard

Copied

LATEST

Today I worked on it and it and used a variable for the user documents map and filename. Then checked it with the app.alert function. And then put the variable after cPath and it workes fine. (Windows 8.1).

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