Skip to content

Overview

The pdf-layers component displays the layers of a PDF document, if any.

The document property is used to identify the pdf-document that provides the layers. The pagesviewer property is used to identify the pdf-pages component that should update when the user toggles layer visibility.

Usage

html
<!-- Define the PDF document -->
<pdf-document name="d" />

<!-- Define the PDF pages viewer -->
<pdf-pages document="d" name="p" pageMode="multi" />

<!-- Define the PDF layers component -->
<pdf-layers document="d" pagesviewer="p" />

In this example, a pdf-document named "d" is defined. A pdf-pages viewer named "p" is associated with this document. The pdf-layers component is also associated with the same document and viewer, allowing the user to toggle the visibility of layers in the document.

Properties

PropertyAttributeDescriptionTypeDefault
documentdocumentReference for the PdfDocumentstring | undefined'default'
pagesviewerpagesviewerIdentifies the PdfPages component by its 'name' property.string | undefined'default'

Built with StencilJS