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

How to convert text field into text?

Community Beginner ,
Jul 10, 2023 Jul 10, 2023

I would like to make text field into text. The fields are filled in with text already, so I would like to use that and be able to make it as text only, and not a editable form field. I've been deleting form fields and pasting text which takes time and want to speed up this process. Any help is much appreciated!

TOPICS
How to , JavaScript , PDF , PDF forms
1.0K
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 ,
Jul 10, 2023 Jul 10, 2023

You can flatten them, using the following code (which can be executed from the JS Console, an Action or a Custom Command):

 

this.flattenPages();

 

Note that this will affect not just text fields, but all fields of all types, as well as links and comments. It's also non-reversible!

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 Beginner ,
Jul 10, 2023 Jul 10, 2023

ah I see, thank you!

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 Beginner ,
Jul 10, 2023 Jul 10, 2023

hmm, is there another way to do this without converting all fields amd all field types?

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 ,
Jul 10, 2023 Jul 10, 2023

You can set the fields as read-only and set their default values to their current ones, so they don't clear when the form is reset. It's not the same, but it's the easiest way to do it...

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 ,
Jul 10, 2023 Jul 10, 2023
LATEST

You could use a selective flattening tool like this one:

https://www.pdfscripting.com/public/Selective-Flatten-Tool-Description.cfm

 

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

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