Skip to main content
Participating Frequently
January 13, 2020
Answered

save pdf with selected layers

  • January 13, 2020
  • 9 replies
  • 32198 views

I have a pdf that has layers. I want to only have one of the layers visible then save so that the print shop can print in large format. When I save with only selected layer visible, the file still has all the layers showing. How do I fix this?

Correct answer Thom Parker

Hey I'm using buttons to show/hide multiple layers in Acrobat with javascript. How do I save a new PDF with my selection of layers showing? Every time I save a PDF the layers are back to hidden by default. Here's the javascript I use for my button action

 

var docOCGs = this.getOCGs();
for (var i=0; i < docOCGs.length; i++)
{
if (docOCGs[i].name == "Badge Tab")
{
docOCGs[i].state = !docOCGs[i].state;
}
}

 

Appreciate the help.


Set the "initState" property.  However, this only work in Acrobat Pro.   

 

var docOCGs = this.getOCGs();
for (var i=0; i < docOCGs.length; i++)
{
    if (docOCGs[i].name == "Badge Tab")
    {
        docOCGs[i].state = !docOCGs[i].state;
        docOCGs[i].initState = docOCGs[i].state;
    }
}

 

For a strategy that work for Reader you'll need to store the state on the form. For example, in a hidden text field.  Then a document level script can be used to setup the OCG states when the PDF is opened. 

 

 

9 replies

New Participant
August 24, 2025

Go to Patternprojector.com -- it's for projecting sewing patterns like you are doing, and you can click off/on the size layers you want to project. It's also free. It's really very amazing.

New Participant
August 24, 2025

Sorry, wrong address -- it's projectorsewing.com 

New Participant
June 27, 2023

I made a layer I wanted visible with Acrobat and flattened the layer.  Saved it and open with Photoshop.  Only the layer saved showed up.

mhers
Participating Frequently
May 24, 2023

I feel like all these answers are wrong or partial. This wokred for me - 1. deselect the layers you want to hide. 2. Right cleck each layer and select properties. 3. for each option turn off all visibilty options and then save as a new file so you dont alter the original. Default State: OFF Initial State: Visibility  - Never Visible, Print: Never Prints, Export: Never Export 

Known Participant
September 12, 2022

Hi, I get annoyed by this also. If you open the pdf in acrobat and deselect the layers you don't want to see, then save as a jpeg it should work and save only the layers you want to see. Then I print that in photoshop.

Thom Parker
Inspiring
May 29, 2020

All layers have a default visibility value. It is these default values that determine the visibility on opening. On the layers panel, right click on a layer and select properties to set this value. 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
New Participant
April 7, 2021

What if you want the layers to be only turned on when a specific button is selected?  I have 6 layers on top of each other, and have action assigned to 6 radio buttons that turn the layer visibility on/off depending on the choice.  My issue is if i save my document or email a the form the layer deafults back to its default state as "off".  Keeping the default state to "on" is not an option as ou can image 6 layers looks messy.  Any suggestions?

Thom Parker
Inspiring
April 12, 2021

My approach to this issue (which comes up often) is to use a hidden field to save the states of all the layers whenever the file is saved, and then read the contents of this field and change the layers' states according to the data in it when the file is opened.


I usually do the same thing. However in this case the poster indicated they have radio buttons which determine visibility, so there are already form fields holding the state information. So just use those. 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
New Participant
May 26, 2020

I have same problem. What I did was: Unselecting the layers I did not want to, and then to select the printer "Microsoft print to PDF" ..so I saved it as another PDF without those layers.

Of course doing like that, you lose info about the layers and so on but it works if what you want is to send or save PDF with omitted layers.

ls_rbls
Braniac
April 13, 2020

I am thinking that you may need to use tghe Accessibility checker and run a Full Report to see the real errors.

 

After examining the report, use the Print Production tool, select "Preflight" then "PDF Fixups", and click on analyze and fix.

 

This may take long depending on the size of the document in term of pages. Sometimes it may even crash with out of memory errors if you do this while other documents are opened. So if this file is too big take care in maybe splitting the file in smaller chunks of pages to process.

New Participant
March 19, 2020

Did you ever figure this out? I am doing the same thing and having the same issue

ls_rbls
Braniac
January 13, 2020

Hi,

 

If it is a document that you're processing ready for print, and you don't want all the layers visible, would it be convenient if you merge all layers into a single layer?

 

See more options here:https://helpx.adobe.com/acrobat/using/pdf-layers.html 

cspub1Author
Participating Frequently
January 13, 2020

i don't think merging would work. i don't want to show the other layers. only this one. i don't want to delete but need a file i can send to printers that has only the one layer

ls_rbls
Braniac
January 13, 2020

In the link I suggested above it has a section that covers on how to hide them