Excluir metadados PDF com API REST C#

Este artigo descreve como excluir PDF metadados com API REST C#. Você aprenderá a remover automaticamente metadados de PDF com API C# Low Code usando o Cloud SDK baseado em .NET. Os detalhes também serão compartilhados para trabalhar com os metadados do arquivo PDF, como inserir e excluir as propriedades personalizadas do arquivo.

Pré-requisito

Etapas para limpar metadados de PDF com interface C# REST

  1. Instancie o objeto PdfApi definindo a chave de API e o SID do aplicativo para remover propriedades personalizadas
  2. Carregue o arquivo PDF de destino no objeto Documento com propriedades personalizadas
  3. Chame o método DeleteProperties() para excluir as propriedades personalizadas
  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 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 code has shown how to clean PDF metadata with C# .NET-based API. If you want to add a new custom property, you may use pdfApi.PutSetProperty() method that checks if the property with this name is available, then updates its value, otherwise, add it as a custom property. If you want to display the current set of properties in the PDF file, use the GetDocumentProperties() method and iterate through the list in the API response.

This article has taught us the process of deleting all the custom properties in the PDF file. If you want to add new custom properties or set values of the existing properties, refer to the article on Update PDF metadata with C# REST API.

 Português