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

How to Javascript a function to add a file attachment from string

New Here ,
Jun 06, 2023 Jun 06, 2023

Hi Community,

we are developing a PDF with from fields and having "NotAllowed" exception with method setDataObjectContents actual in Adobe Acrobat Reader. The goal is to read the form data as string and put it as file attachment into the attachment list of the same PDF.

Is there a way to script this without running into security issues using actual Adobe Acrobat Reader?

 

Many Thx's in advance!

 

691
Translate
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 ,
Jun 06, 2023 Jun 06, 2023

in the future, to find the best place to post your message, use the list here, https://community.adobe.com/

 

p.s. i don't think the adobe website, and forums in particular, are easy to navigate, so don't spend a lot of time searching that forum list. do your best and we'll move the post if it helps you get responses.

 

<moved from using the community>

Translate
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 ,
Jun 07, 2023 Jun 07, 2023

You can use setDataObjectContents in Acrobat Reader when the PDF file has attachments rights.

Or use Adobe Acrobat Pro or Standard.

Translate
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 ,
Jun 07, 2023 Jun 07, 2023

Thanks for your information! That's the question, how to give the PDF file attachments rights?

I did not found any option in the Acrobat Pro to set or Acrobat Reader.

 

Translate
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 ,
Jun 07, 2023 Jun 07, 2023

You can add the rights with this:

https://www.datalogics.com/pdf-reader-extension 

Translate
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
LEGEND ,
Jun 07, 2023 Jun 07, 2023
LATEST

Some background may help understand this restriction and solution.

1. Adobe's hope and intention is to sell Acrobat. Not just to developers/creators, but to everyone. (If all your users pay for Acrobat, they can do this thing).

2. Many, many functions in the JavaScript API are limited to Acrobat only, and there is no choice. In other cases, "Reader extensions" exist. The JavaScript API includes this information for each method through the "quick bar".

3. Reader extensions is a strange name. It actually converts regular PDF into "extended" PDF, using a private signature. If the PDF has the signature, it unlocks specific functions in Reader.

4. Understand that Reader extensions mean Adobe sell less copies of Acrobat, and lose money. Therefore they look to replace the revenue, by charging for the Reader extensions. 

5. In some cases the Reader extensions can be added with Acrobat. In some other cases, the need for Reader extensions has been removed. But in other important cases, Adobe charge substantially to add the extensions. Pricing is by negotiation, but it may well be cheaper to buy Acrobat for each user, if there are only a few hundred users.

Translate
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