Home/ Reference/ Page

page.Layers

The layer collection: page.Layers.Count and .Item(i). This is how you build a stack of background, content and annotation layers.

Signature

page.Layers

Notes

The layer collection: page.Layers.Count and .Item(i). This is how you build a stack of background, content and annotation layers.

Python example (runnable)

Requires pywin32. The example assumes app / doc / page / layer are already connected. See Connection & Init
Python
page = doc.ActivePage
print("Layers: ", page.Layers.Count)

for i in range(1, page.Layers.Count + 1):
    lay = page.Layers.Item(i)            # lay : the i-th layer
    print(i, lay.Name, "Visible: ", lay.Visible)

About this section: Page

Page — pages and page setup.

Other entries in this section