How to Delete Pages from PDF using PDF.co and Make
In this tutorial, we will show you how to delete pages from PDF using PDF.co and Make. We will use a sample PDF with four pages and delete pages 1-2.
![Sample Source PDF](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2F2niroq9z%2Fproduction%2F795c987a9f9c57fc7327b2723def1229e5f81638-1539x962.png&w=3840&q=75)
Let’s start by logging in to your Make account and creating a new scenario.
Step 1: PDF.co Module and Make an API Call
First, add the PDF.co module and select the Make an API Call.
![PDF.co Module And Make An API Call](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2F2niroq9z%2Fproduction%2F01de4d8d2e48a46d9c2afb02cf57ea38eddcf754-422x966.png&w=1080&q=75)
Step 2: Make an API Call Configuration
Let’s set up the configuration.
- For the PDF.co API Endpoint Path field, type in
/v1/pdf/edit/delete-pages
endpoint. - For the Input Type field, you can choose either Upload files and inject as ‘url’ param or override ‘url’ param with value as an input.
- Then, enter the direct URL of your source file.
- Type in your desired PDF Output File Name.
- Under the Body param, type pages for the Key and put the number of pages you’d like to delete in the Value.
![Make an API Call Configuration](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2F2niroq9z%2Fproduction%2F15eb9e3c582052f05a25e9e957cec38ae445deac-425x343.png&w=1080&q=75)
![Make an API Call Configuration](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2F2niroq9z%2Fproduction%2Fdb0f769113494f6af4b4289b9ad26a311fa6f1c5-425x877.png&w=1080&q=75)
After setting up the configuration, you may now run the scenario.
Step 3: Run Scenario Result
Excellent! The scenario runs successfully. You can copy the URL and paste it into your browser to view the output.
![Run Scenario Result](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2F2niroq9z%2Fproduction%2F63cc58de9113f7ee1e563c71d9405937943442e0-423x655.png&w=1080&q=75)
Step 4: Output
Here’s the output after we successfully deleted pages 1 and 2.
![Source File Output](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2F2niroq9z%2Fproduction%2Fc2f4d60f294ff93e9740e7ae62c942876c302354-1539x962.png&w=3840&q=75)
In this tutorial, you learned how to delete pages from PDF using PDF.co and Make. You learned how to use the /v1/pdf/edit/delete-pages
endpoint to delete pages. You also learned how to use the PDF.co Web API to delete the number of pages in a PDF document.