Delete Metadata from PDF C#

Removing metadata from PDF files is an essential task to maintain privacy and security. Metadata can include sensitive information such as author names, document titles, creation dates, and more. In this blog post, we’ll walk you through how to delete, remove, redact, clear, or strip metadata from a PDF using C#.

Why Delete Metadata from PDF Files?

Metadata in PDFs can reveal a lot about the document’s history and the people who have handled it. This information can be sensitive and, in some cases, expose private data. By removing metadata, you can ensure that your documents do not carry any hidden information that could compromise privacy or security.

Remove Metadata from PDF Documents in C# - API Installation

You can configure Conholdate.Total for .NET by downloading and install DLL from the New Releases page or use the NuGet installation command below to configure it in Visual Studio IDE:

PM> NuGet\Install-Package Conholdate.Total

Delete Metadata from PDF in C#

You can delete the metadata from any PDF document to strip the information from PDF files using C#:

  • Create an instance of the Redactor class.
  • Erase all PDF metadata using all the metadata filters.
  • Save the output PDF document.

The sample code below shows how to delete metadata from PDF in C#:

Free Evaluation License

You may request a free temporary license to evaluate the APIs to their full capacity.

Conclusion

By following these steps, you can easily delete metadata from a PDF using C#. This ensures that your documents are free from hidden information that could compromise privacy and security. It enables you to handle PDF metadata redaction with minimal code while ensuring privacy and maintaining control over the information shared within your files. If you have any questions or need further assistance, feel free to leave a comment at forum.

FAQs

Why should I remove metadata from my PDF documents?

Removing metadata from PDFs helps protect sensitive information, such as authorship details, document creation dates, and other hidden data that might compromise privacy or security.

Can I selectively remove specific metadata fields?

Yes, the Conholdate.Total for .NET API allows you to specify which metadata fields to remove. You can customize the EraseMetadataRedaction method to target specific fields such as Author, Manager, or Company.

Is it possible to revert the metadata removal?

Once metadata is removed using the redaction process, it cannot be restored. It is recommended to keep a backup of the original document if you think you might need the metadata in the future.

See Also