Skip to main content
Participant
January 17, 2025
Question

Flatten shapes created as comments

  • January 17, 2025
  • 3 replies
  • 304 views

I've just finished a form and have since realized I committed an Adobe sin and used the comments tools to create what i intended to be visble lines to help divide up sections of the form.  I'm using Acrobat Standard and am curious if anyone can offer me some guidance on converting these lines into static elements and making them unselectable.  I didn't even notice this was an issue until I doubled back to test ans adjust the tab order and these lines showed as selectable..  Or, if they can't be converted in some manner, is there a way i can replace them with other lines to take their place?  I don't have the heart to start over from scratch.

 

I've seen some other threads suggesting the comments can be flattened with javascript?  Is that an option?  If so, could someone help me with that?

 

3 replies

Thom Parker
Community Expert
Community Expert
January 17, 2025

Run this code in the console window

this.flattenPages();

 

It'll flatten all annotations in the PDF.  

 

There is a free flattening tool here:

https://www.pdfscripting.com/public/Free_Acrobat_Automation_Tools.cfm 

 

There is a selective flattening tool here, but it's not free:

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

 

 

 

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
PDF Automation Station
Community Expert
Community Expert
January 17, 2025

You can flatten them.  However, the process will flatten all annotations and all form fields unless you do it properly.  You must set the bNonPrint parameter to 1 (Non-printing annotations are left as is) and then set the form fields display property to display.noPrint and set  the print property of any other annotations that you don't wish to flatten to false.  After flattening, change the displays and print properties back to the way they were.  The flattening script to run would be:

this.flattenPages({bNonPrint: 1});

You can simply run this script in the console.  If you are using Standard, I don't believe you can open the console with the UI so create a button (visible but doesn't print) with the following mouse up action:

console.show();

www.pdfscripting.com used to have a free tool that automates all of this for you.  I don't know if it's still available.

Participant
January 17, 2025

Please can someone help me in filling out the forms