This guide walks you through deleting PDF metadata with the C# REST API. You’ll learn how to automatically remove PDF metadata using the C# Low‑Code API powered by the .NET Cloud SDK, and explore how to manage PDF file metadata—adding or deleting custom file properties.
Prerequisite
- Create an account API credentials
- Download Aspose.PDF Cloud SDK for Dotnet to delete custom metadata
- Setup C# project with the above SDK
Steps to Clean Metadata from PDF with C# REST Interface
- Instantiate the PdfApi object by setting the API key and App SID for removing custom properties
- Load the target PDF file into the Document object having custom properties
- Call the DeleteProperties() method to delete the custom properties
- Display the stripped-down list of the properties if required using the pdfApi.GetDocumentProperties() method
- Download the updated PDF file
The above steps summarize the process of developing a PDF properties remover with C# Low Code API. Call the UploadFile() method to upload the target PDF file and call the DeleteProperties() method to delete the custom properties. Note that you cannot remove the built-in properties but can erase the values using the pdfApi.PutSetProperty() method and setting the Value attribute to null.
Code to Strip PDF Metadata with C# RESTful Service
This example demonstrates how to clean PDF metadata with the C# .NET‑based API. To add a new custom property, call pdfApi.PutSetProperty()—it will update the value if the property already exists or create it as a custom property otherwise. To view the current set of properties in the PDF, invoke GetDocumentProperties() and iterate through the list returned in the API response.
In this guide we’ve walked through how to remove every custom property from a PDF file. When you’re ready to add new custom properties or modify existing ones, see the article on Update PDF metadata with C# REST API.