This sample shows how to add XObjects to layers in a PDF document using Docotic.Pdf library.
The PdfXObject class has the Layer property. To associate an XObject with a layer assign the layer to the property.
To remove a XObject from a layer, you only need to set the XObject.Layer
property to null
.