Extract Pages from PDF using REST API
Extract Pages from a PDF using REST API
Using API2PDF, you can hit our /pdfsharp/extract-pages endpoint to provide an existing PDF and tell our service a page range that you would like to extract. Our services uses PdfSharp under the hood to split the PDF based on your request and return a new PDF to you with just that specified page range.
Create an account and check out our documentation to get started for free.
We also offer client libraries in popular languages:
Otherwise, you can write very simple code against the REST API. Below is a simple screenshot example using Python.
#python example
import requests
import json
api_key = 'your-api-key'
endpoint = 'https://v2.api2pdf.com/pdfsharp/extract-pages'
url_to_file = 'https://url-to-your-pdf'
api_response = requests.post(endpoint, json={'url': url_to_file, 'start': 3, 'end': 7 }, headers={'Authorization': api_key})
print(json.loads(api_response.content)['FileUrl'])
We run our service on Google Cloud Run which offers some huge benefits. First, we do not have any rate limits, unlike other services out there. Hit the API as many times as you wish. And second, the cost to service the API is substantially less, resulting in much lower fees than competing services.
Our API is also available as a standalone docker container that you can run in your own cloud environment. Contact us if you are interested in learning more.