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

flattenPages method problem

Explorer ,
Jan 20, 2023 Jan 20, 2023

Dear visitors and customers of the Adobe Forum. First of all, I would like to cordially greet everyone.
On this occasion, I would like to ask you for your opinion or your solution (or at least a good critique) for the following problem that I encountered in my short and initial practice in using Acrobat Pro.

Task.
Suppose *The Office* submits a simple FORM in a PDF file created for a *Final Customer*. *Final Customer* fills in the fields of the FORM and sends it back to *The Office*. *The Office* can only receive the edit-protected PDF file with the fields containing data issued by the *Final Customer* locked. (simply *The Office* can only accept flattened PDF files).

This FORM contains:
- fillable fields,
- dropdown lists,
- calculation fields,
- "Reset Form" button,
- "FLATTEN Page" button.

The main purpose:
send the FORM to the *Final Customer* giving the possibility to use fillable fields + choose the item in the dropdown list + perform the calculation + reset the FORM + and, (!-) above all (-!) , the *Final Customer* it must be able to ->flatten<- the file before resend, to make it protected from modifications.

User requirement:
I would like to have the possibility to protect the file from changes, after filling out the FORM, with the Javascript method -> =this.flattenPages()= using the "Flatten Page" button.
This requirement gives the possibility to split two commands:
1 - "Save File" and 2 - "Flatten Page".
The "saving" of the file can take place several times, modifying it each time when it is necessary for the Final Customer.
However, the function of "flattening" the file can only happen ONE time (due to the character of the function, which erases all JavaScript code).

Description of the problem.
Using Adobe Acrobat Pro 2022, I created the FORM described in the "Task" section and implemented the "User requirement" attached Javascript code to the Form objects.

In *The Office* side under Acrobat Pro 2022 application all user requirements work fine. The FORM responds to all commands including the =this.flattenPages()= method integrated into the "Flatten Page" button.

Sending the FORM to the *Final Customer*.

In the *Final Customer* side under the Adobe Acrobat Reader 2022 application, the =this.flattenPages()= method integrated in the "Flatten Page" button DOES NOT WORK.

Problem description in detail:
The *Final Customer* receives the FORM via Email. Open the FORM with the Adobe Acrobat Reader 2022 application. All the features of the FORM:
- fillable fields,
- dropdown lists,
- calculation fields,
- "Reset Form" button,
= they are functional and lead to the required results.

excluded (!)
- "FLATTEN Page" button,
= is NOT working. Javascript code embedded in the button simply does NOT run. And the user requirement is not satisfied.

Remarks:
the =this.flattenPages()= method integrated in the "Flatten Page" button is a standard Javascript method belonging to Doc Object Methods. All methods of Doc Object Methods [example: getField(), getField(), resetForm(), saveAs(), ..... ] are executable in Adobe Acrobat Reader 2022 *Final Customer* side..., .. .. all,.... excluding(!) => flattenPages().

Dear colleagues, I would like to ask your opinion : is the User requirement feasible ???
I attach the file containing the FORM.

Best regards.

before_FLATTEN.png

 

after_FLATTEN.png

 

 

 

 

 

TOPICS
PDF forms
2.1K
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
1 ACCEPTED SOLUTION
Community Expert ,
Jan 23, 2023 Jan 23, 2023

This info is available in the "Acrobat-PDFL SDK: JavaScript Reference" next to each method and property:

 

Capture_2301231447.png


Acrobate du PDF, InDesigner et Photoshopographe

View solution in original post

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 ,
Jan 20, 2023 Jan 20, 2023

I think I understand what you are trying to achieve.

I would consider using a signature approach.

Once a Final Customer fills and signs a form, the document is locked (your flaten function).

read more from Certificate-based signatures, Adobe Acrobat

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
Explorer ,
Jan 23, 2023 Jan 23, 2023

Dear colleague.
Thank you for your answer.
I really think I'm proceeding according to your recommendations.
I presume:
that, (most likely) the problem described by me is related to the different versions of Adobe products. Even though, both JavaScript fragments 1.=this.resetForm(fields)= + 2.=this.flattenPages()= belonging to Doc Object Methods, only ONE is executed outside Acrobat Pro [precisely it is 1.=this .resetForm(fields)=]. Another method [2.=this.flattenPages()=], is a "privileged" method, which requires the versions of Abobe products covered by the license.

Guess:
In the product such as Adobe Acrobat Pro, covered by the license, all Javascript methods of the Doc Object Methods are executed.
Instead, in Abobe products, do not cover yourself from the license like Acrobat Reader, NOT ALL Javascript methods can be executed => due to lack of product license.

This is just my guess, for which I can't find confirmation.

Problem would be overcome (removed):
so if my assumption will be confirmed I could consider the problem solved.

I send you my best regards.

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 ,
Jan 20, 2023 Jan 20, 2023

Acrobat Reader cannot flatten a form.

This requires Acrobat Pro or Acrobat Standard.


Acrobate du PDF, InDesigner et Photoshopographe
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 ,
Jan 23, 2023 Jan 23, 2023

This info is available in the "Acrobat-PDFL SDK: JavaScript Reference" next to each method and property:

 

Capture_2301231447.png


Acrobate du PDF, InDesigner et Photoshopographe
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
Explorer ,
Jan 23, 2023 Jan 23, 2023

Dear colleague.
Thank you very much for your COMPLETE and DEFENITIVE response. Thanks to you, I can consider the problem solved. I am also very grateful to the source "Acrobat-PDFL SDK: JavaScript Reference" , which is a real find for me.
On the occasion, I send you my most cordial greetings.
I wish you good luck and see you next time.

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 ,
Jan 23, 2023 Jan 23, 2023
LATEST

Adobe will be delighted with the proposed solution, because each end user will need a license for Acrobat. (The JavaScript Reference makes this clear). Adobe's mission is to sell Acrobat to everyone.

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