Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Tue Apr 21, 2020 12:41 pm

Hello!
Is it possible to add or remove custom metadata from a pdf file with the api?
Below is an image of the metadata.
If possible, what would be the addition and removal code?
Thanks in advance!

gafforelli
 
Posts: 37
Joined: Sat Sep 15, 2018 6:38 pm

Wed Apr 22, 2020 2:01 am

Hello,

Thanks for your inquiry.
Please refer to the following code snippet. If you have further questions, please feel free to contact us.
Code: Select all
        'Add custom properties
        pdf.DocumentInformation.SetCustomerDefined("Vendor number", "965842")
        pdf.DocumentInformation.SetCustomerDefined("Vendor name", "ACME")

        'Remove custom properties
        pdf.DocumentInformation.RemoveCustomerDefined("Vendor name")


Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Wed Apr 22, 2020 11:24 am

Hi Rachel!
thank you so much
Worked perfectly!

gafforelli
 
Posts: 37
Joined: Sat Sep 15, 2018 6:38 pm

Thu Apr 23, 2020 1:04 am

Hello,

Thanks for your feedback.
Feel free to contact us if you need further assistance.
Have a nice day!

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Return to Spire.PDF