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

How to use js scripting to permanently turn off visibility of a layer in an adobe acrobat pdf

New Here ,
Jan 08, 2022 Jan 08, 2022

Copy link to clipboard

Copied

I have pdf files that each have a layer called "Centerline (ANSI)" (see attached snapshot "Centerline (ANSI)" . Before I distribute these files to customers, I want to have this layer permanently hidden or removed. I know how to go into "Layer Properties", turn the "Default State" to "Off", lock it, and then apply password protection to the document to prevent changes (see attached file "Default state -off) but my issue is I have about 200 of these pdf files and this would be time-consuming. Is there a way to automate this process through scripting? Is this done through some kind of batch processing? I know "some" javascript but would know where to begin with this. The goal of the scripting is to PERMANENTLY turn off or delete the centerline layer/ocg of each file through scripting - such as a batch process - without having to go into each file and turn off the layer manually. Is this possible?
TOPICS
Edit and convert PDFs , How to , JavaScript

Views

968

Translate

Translate

Report

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
Advisor ,
Jan 08, 2022 Jan 08, 2022

Copy link to clipboard

Copied

Hello @Eric22562456ozqr,

 

You can do this without scripting, you can apply password protection and remove the layer named Centerline (ANSI) in a Acrobat Action.

 

1. Create a custom preflight profile with custom fixups to remove the layer named Centerline (ANSI)

Screen Shot 2022-01-08 at 9.53.29 PM.pngScreen Shot 2022-01-08 at 9.40.34 PM.png

2. Create a Acrobat Action to run the preflight profile, apply password protection and save the file(s), when creating the action you can point the action to a folder with all the files in the right column near the top.

 

Screen Shot 2022-01-08 at 10.07.35 PM.png

 

3. Set the password/protection settings in the specify settings

Screen Shot 2022-01-08 at 10.08.35 PM.png

Screen Shot 2022-01-08 at 10.18.55 PM.png

Let me know if this make sense or if you have any questions.

 

Regards,

Mike

 

View solution in original post

Votes

Translate

Translate

Report

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
Advisor ,
Jan 08, 2022 Jan 08, 2022

Copy link to clipboard

Copied

Hello @Eric22562456ozqr,

 

You can do this without scripting, you can apply password protection and remove the layer named Centerline (ANSI) in a Acrobat Action.

 

1. Create a custom preflight profile with custom fixups to remove the layer named Centerline (ANSI)

Screen Shot 2022-01-08 at 9.53.29 PM.pngScreen Shot 2022-01-08 at 9.40.34 PM.png

2. Create a Acrobat Action to run the preflight profile, apply password protection and save the file(s), when creating the action you can point the action to a folder with all the files in the right column near the top.

 

Screen Shot 2022-01-08 at 10.07.35 PM.png

 

3. Set the password/protection settings in the specify settings

Screen Shot 2022-01-08 at 10.08.35 PM.png

Screen Shot 2022-01-08 at 10.18.55 PM.png

Let me know if this make sense or if you have any questions.

 

Regards,

Mike

 

Votes

Translate

Translate

Report

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 ,
Jan 09, 2022 Jan 09, 2022

Copy link to clipboard

Copied

LATEST

MIKE YOU ARE A LIFESAVER!!!!!!!!!!!!

 

THANK YOU!

 

 

Votes

Translate

Translate

Report

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