Delete PDF Metadata with Java REST API

This article explains how to PDF Java developers can automatically remove metadata from a PDF file using the Java REST API, leveraging the Aspose.PDF Cloud SDK for Java. For more information about the PDF format, see the PDF file info page.

Prerequisite

Steps to Clean Metadata from PDF with Java REST Interface

  1. Instantiate the PdfApi object by setting the API key and App SID for removing custom properties
  2. Load the target PDF file into the Document object that contains custom properties
  3. Call the DeleteProperties() method to delete the custom properties
  4. Display the stripped‑down list of the properties if required using the pdfApi.getDocumentProperties() method
  5. Download the updated PDF file

The above steps summarize the process of developing a PDF properties remover with Java Low Code API. Call the UploadFile() method to upload the target PDF file and then invoke DeleteProperties() to delete the custom properties. Note that built‑in properties cannot be removed, but their values can be cleared by using the pdfApi.putSetProperty() method and setting the Value attribute to null.

Code to Strip PDF Metadata with Java RESTful Service

This code demonstrates how to clean PDF metadata with the Java‑based API. To add a new custom property, use pdfApi.putSetProperty()—the method checks whether the property exists and updates its value or creates it as a custom property. To display the current set of properties in the PDF file, call getDocumentProperties() and iterate through the returned list.

The article covers deleting all custom properties from a PDF file. For adding new custom properties or updating existing ones, see the related guide on Update PDF metadata with Java REST API.

Keywords: delete pdf metadata with Java REST API; remove metadata from pdf with Java Low Code API; clean pdf metadata with Java-based API.