How to Delete Empty Pages using PDF.co and Make
In this tutorial, we will show you how to delete empty pages using PDF.co and Make.
We will use this sample PDF Document and delete the empty page.
IN THIS TUTORIAL
Step 1: Create a New Scenario
- To begin. First, log into your Make account and click on the Create a new scenario button.
Step 2: Google Drive Module
- Next, search and select the Google Drive app module.
Step 3: Download a File
- Then, choose the Download a File module.
Step 4: Google Drive Configuration
Let’s set up the Google Drive configuration.
- For the Enter a File ID field, choose Select from the list to see available folders from Google Drive.
- For the Choose a Drive field, select My Drive.
- For the File ID field, enter the specific folder where the file was stored.
Now, let’s add another module to get detailed information about the PDF document, its properties, and security permissions.
Step 5: Add PDF.co Module
- Search and select the PDF.co module.
Step 6: Make an API Call
- Next, select the Make an API Call module. This tool will make a call to PDF.co API.
Step 7: Setup Make an API Call
Let’s set up the Make an API Call.
For the API Endpoint Path dropdown box, Type the v1/pdf/info
. This endpoint will extract basic information about input PDF files, PDF file security permissions, and other information.
- For the Input Type dropdown box, select the Upload files and inject as ‘url’ param. It will automatically input files from Google Drive.
Now, let’s add another app to check every page and see if the returned text is empty or not.
Step 8: Add Another PDF.co Module
- Search and select the PDF.co module.
Step 9: Make an API Call
- Next, select the Make an API Call module.
Step 10: Make an API Call Configuration
- For the API Endpoint Path dropdown box, type in
/v1/pdf/convert/to/text-simple
. This endpoint will convert every page into simple text, and check if the returned text is empty or not. - For the Input Type dropdown box, select the Upload files and inject as ‘url’ param. It will automatically input files from Google Drive.
- Under the Body param. For Item 1, type
inline
for the Key and set it totrue
for the Value. - For Item 2, type
async
for the Key and set it tofalse
for the Value. Set it totrue
, if you want to run processing asynchronously and return JobId that you may use it to check the state of the background job
Now, let’s add another app to delete the empty page from the PDF document.
Step 11: Add Another Module
- Kindly search and select the PDF.co module.
Step 12: Make an API Call
- Next, select the Make an API Call module.
Step 13: Setup Make an API Call
Let’s set up the Make an API Call configuration.
- For the API Endpoint Path dropdown box, type in
v1/pdf/edit/delete-pages
. This endpoint will delete the empty pages from the PDF document. - For the Input Type dropdown box, choose the Upload files and inject as ‘url’ param. It will automatically input files from your drive.
- In the Output File Name dropdown box, enter your desired output name.
- Under the Body param. For Item 1, type
pages
for the Key and add the list of pages you want to delete for the Value. - For Item 2, type
async
for the Key and set it tofalse
the Value. Set it totrue
, if you want to run processing asynchronously and return JobId that you may use it to check the state of the background job.
Once you set up the configuration, click on the run button to see the result.
Step 14: Run Scenario Result
- The scenario runs successfully, kindly copy the URL and paste it into your browser to view the output.
Step 15: Delete Pages Output
- Great! We successfully deleted the empty page from the PDF document.
In this tutorial, you learned how to delete empty pages using PDF.co and Make. You learned how to use the v1/pdf/convert/to/text-simple endpoint to convert every page into simple text and check if the returned text is empty or not. You also learned how to use the v1/pdf/edit/delete-pages endpoint to delete pages from PDF documents.