// For complete examples and data files, please go to https://github.com/groupdocs-watermark/GroupDocs.Watermark-for-.NET
using (PdfDocument doc = Document.Load<PdfDocument>(Utilities.MapSourceFilePath (FilePath)))
{
// Remove XObject by index
doc.Pages[0].XObjects.RemoveAt(0);
// Remove XObject by reference
doc.Pages[0].XObjects.Remove(doc.Pages[0].XObjects[0]);
doc.Save();
}