This tutorial shows you how to Python REST API can be used to modify PDF metadata directly in the cloud, without any third‑party tools. By leveraging the Aspose.PDF Cloud SDK for Python you can change document properties such as author, title, and keywords, then download the updated file. For more information about the PDF format, see the PDF file info page and the official PDF specification.
Prerequisite
- Create an account API credentials
- Download the Aspose.PDF Cloud SDK for Python
- Set up a Python project and add the SDK as a dependency.
Steps to edit PDF properties with Python Low Code API
- Create the PdfApi object and configure it with your client ID and client secret.
- Upload the source PDF file to cloud storage using the UploadFile method, providing the file name.
- Call the PutSetProperty() method and specify the property name and its new value.
- Repeat step 3 for each additional property you need to update.
- Download the updated PDF file from the cloud storage and save it locally.
The steps above outline the complete workflow for changing PDF properties with the Python RESTful service: upload the document, invoke PutSetProperty() as many times as required, then retrieve the modified file.
Code to modify PDF properties with Python REST API
The snippet demonstrates how to edit PDF file properties using the Python Low Code API. By calling PutSetProperty() repeatedly you can update multiple metadata fields. Be sure to handle any error codes returned by the API for each call, and repeat the process if necessary.
For related tasks such as rearranging pages in a PDF, see the article: Reorder PDF pages with Python REST API.
Keywords: how to change properties of a pdf file with Python Low Code API; update pdf metadata with Python REST API; change pdf properties with Python REST Interface; change properties of pdf file with Python RESTful Service; edit pdf file properties with Python Low Code API.