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

Strip PDF form fields but keep content inputted into the fields?

Explorer ,
Dec 12, 2023 Dec 12, 2023
Hi. I'm looking for a method to;
 
1) make a PDF form with image, text and checkbox input fields, save.
2) fill in content,
3) Strip the PDF of these input fields but keep the content that has been inputted into the fields. Aka.. a text input field becomes just text.
 
I need this as I'm showing the PDF in 3rd party software that doesn't handle form fields properly. I want to be able to make a lot of PDFs with different content, strip fields, save and then read into this 3rd party software.
 
Any ideas?
TOPICS
PDF forms
3.4K
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 ,
Dec 13, 2023 Dec 13, 2023

"What I mean is that if I make the checkboxes non-printable, and keep them as fields, and then flatten all text and image input fields."

Otherwise you can select all checkboxes, cut them, flatten the form fields, then paste.


Acrobate du PDF, InDesigner et Photoshoptographe

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 ,
Dec 13, 2023 Dec 13, 2023

Just print to PDF when you're done filling file.

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 ,
Dec 13, 2023 Dec 13, 2023

Ah ok I will try that but I need to keep some of the form objects still (checkboxes), but transform the text and image fields to normal text and images.

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 ,
Dec 12, 2024 Dec 12, 2024
LATEST

That seems extremely janky for something that should be a simple option on one of the most widely used programs in the world. Acrobat Pro is horrible software.

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 ,
Dec 13, 2023 Dec 13, 2023

You can do that using a simple script:

this.flattenPages();

If you want it to not flatten some fields then you would need to set them first as non-printing (ie. either hidden or visible, but doesn't print), then run this command:

this.flattenPages({bNonPrint: 1});

Just be aware this process is NOT reversible, so make sure to save the flattened file under a new name, or to keep a backup of the original somewhere.

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 ,
Dec 13, 2023 Dec 13, 2023

Also note that if you do this you'll lose all information that's not available on the screen, such as overflowing text in a text field with a scroll-bar.

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 ,
Dec 13, 2023 Dec 13, 2023

ok thanks!!! will this make it possible to use the form fields (checkboxes) not flattened in the PDF after exporting? But see th eothers as just text and images?

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 ,
Dec 13, 2023 Dec 13, 2023

No, flatten means that you take away the interactivity and all that happens in the background. A bit like printing and scanning, accept that there will be no need for running OCR.

ABAMBO | Hard- and Software Engineer | Photographer
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 ,
Dec 13, 2023 Dec 13, 2023

What I mean is that if I make the checkboxes non-printable, and keep them as fields, and then flatten all text and image input fields.. and then open the PDF in the 3rd party software where I can view the PDF with form fields or without.. can I still use the checboxes and check/uncheck?

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 ,
Dec 13, 2023 Dec 13, 2023

Why would you do that, as you want to flatten the file? 3rd Party software may or may not work correctly with your file.

ABAMBO | Hard- and Software Engineer | Photographer
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 ,
Dec 13, 2023 Dec 13, 2023

It a tabletop roleplaying form that will show in virtual tabletop software online. The users need to be able to interact with 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 ,
Dec 13, 2023 Dec 13, 2023

If you print, you will lose checkbox interactivity.

Why not use text box instead of text fields?

 

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 ,
Dec 13, 2023 Dec 13, 2023

When you say print.. what do you mean? I will only use it digitally on screen.

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 ,
Dec 13, 2023 Dec 13, 2023

Print file and select Adobe PDF as printer.

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 ,
Dec 13, 2023 Dec 13, 2023

@Nesa Nurani ,

I said that flattening was the digital equivalent of printing and scanning. 😉

ABAMBO | Hard- and Software Engineer | Photographer
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 ,
Dec 13, 2023 Dec 13, 2023

ok.. I have dropdowns with content as well that needs to be fixed with content and not dropdown-able in the PDF but I will do some experimentation.

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 ,
Dec 13, 2023 Dec 13, 2023

> will this make it possible to use the form fields (checkboxes) not flattened in the PDF after exporting? But see th eothers as just text and images?

 

Correct. The unflattened fields will continue working just like before.

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 ,
Dec 13, 2023 Dec 13, 2023

"What I mean is that if I make the checkboxes non-printable, and keep them as fields, and then flatten all text and image input fields."

Otherwise you can select all checkboxes, cut them, flatten the form fields, then paste.


Acrobate du PDF, InDesigner et Photoshoptographe
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 ,
Dec 13, 2023 Dec 13, 2023

There is a flattener among the (free) abracadabraTools:

https://www.abracadabrapdf.net/utilitaires/utilities-in-english/abracadabratools_en/


Acrobate du PDF, InDesigner et Photoshoptographe
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 ,
Dec 13, 2023 Dec 13, 2023

I have now set the checkboxes to "Visible but not printable", and objects I need to flatten to "visible".

I used the "Flatten" feature of abracadabra, and it flattened ALL objects.

I opened the Javascript debugger console and script, and entered this script:

this.flattenPages({bNonPrint: 1});

as suggested above but nothing happened when clicked the green circle button. I tried to run the script all over the javascript editor but I couldn't get the script to run. also tried to remove the "this." prefix.

What is wrong?






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 ,
Dec 13, 2023 Dec 13, 2023

To run the code select it and press Ctrl+Enter.

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 ,
Dec 13, 2023 Dec 13, 2023

Ok thanks I clicked Command+Enter on my Mac and it ran the script but ALL objects got flattened. Darn

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 ,
Dec 14, 2023 Dec 14, 2023

I used the "Flatten" feature of abracadabra, and it flattened ALL objects.

That's why I suggested cutting, flattening, and pasting.

 


Acrobate du PDF, InDesigner et Photoshoptographe
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 ,
Dec 14, 2023 Dec 14, 2023

Sorry, my bad. It should be "nNonPrint", not "bNonPrint"...

Attached is a sample file that shows it in action.

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 ,
Dec 13, 2023 Dec 13, 2023

I found this page and a script named "Flatten page Content Tool" Free Acrobat Automation Tools | pdfscripting.com
This works, but can it be adjusted to only Flatten objects that are printabe by adding this commend somewhere? In this way I can choose exactly what I need flattened.

this.flattenPages({bNonPrint: 1});

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