Remove pages from a PDF programatically

Kostas, Developer

Managing PDF documents often requires performing various operations, such as splitting, merging, and deleting pages. Deleting specific pages from a PDF can be a tedious task, especially when dealing with large files. However, we offer a convenient and simple solution with our Delete PDF Pages API. This API allows developers to effortlessly remove unwanted pages from PDF documents programmatically. In this blog post, we'll explore the features and benefits of ConvertAPI's Delete PDF Pages API and how it can streamline your PDF management workflow.

Integration and Code Examples

To demonstrate the ease of integrating the Delete PDF Pages API into your application, we provide code examples in various programming languages, such as Python, JavaScript, PHP, and others. These examples guide you through the necessary steps to send requests and receive responses from the API.

A simple cURL command to delete the page range from a PDF would look like this:

curl -F "File=@/path/to/my_file.pdf" -F "PageRange=1,5,7-10,13-15"

Key Features and Functionality

ConvertAPI's Delete PDF Pages API offers several essential features that enhance the PDF management experience. These include:

  • Custom Page Range Selection: The API allows you to specify which pages to delete, whether it's a single page, a range of pages, or a combination of both. This flexibility enables precise control over the page deletion process using a single Page Range parameter.
  • Password Protected Document Management: You can process documents that are protected with a password. Simply pass the Password parameter together with the Page Range and you are good to go!
  • Custom PDF automation workflows: After deleting pages, you can choose more actions with the resulting document. ConvertAPI supports PDF actions like PDF Split, PDF Merge, PDF Rotate, PDF Compress, PDF Watermark, PDF Protect and so on, enabling seamless integration with your workflow. You can find all PDF tools on the PDF Tools REST API page.
  • Security and Privacy: ConvertAPI ensures the security and privacy of your documents during the conversion process. All file transfers occur over secure connections, and your data is automatically deleted from ConvertAPI's servers after processing.

Use cases

We explore several common use cases where our Delete PDF Pages API can be valuable. Whether you need to remove sensitive information, extract specific sections, or simplify document navigation, this API offers a solution.


ConvertAPI's Delete PDF Pages API provides a straightforward and efficient solution for deleting specific pages from PDF documents. By automating this process, you can save time and simplify your PDF management workflow. Whether you're a developer working on an application or an individual seeking a quick and convenient way to delete PDF pages, ConvertAPI has you covered. Try out the Delete PDF Pages API today and experience the power of seamless PDF management.