Duplicate PDF Page API

Make a copy of one or more pages in a PDF document using our PDF page duplication API.

Try It Out

This example duplicates the first and last pages of a document.

1

Use Your Free Credits

Sign up to get 100 free credits, or log in to automatically add your API key to sample code.

Add a File

Add a PDF named document.pdf to your project folder. You can also use our sample file. The file name is case sensitive. Make sure the file name matches the file name in the sample code.

Run a Command

Copy the curl command and run it in that same folder via the terminal or your editor’s terminal. This sample code uses a zero index to call on the first and last pages of the document.

View the Results

Open result.pdf in your project folder to view the results.

Shell
    curl -X POST https://api.pspdfkit.com/build \
        -H "Authorization: Bearer your_api_key_here" \
        -o result.pdf \
        -F document=@document.pdf \
        -F instructions='{
            "parts": [
              { "file": "document", "pages": { "start": 0, "end": 0 } },
              { "file": "document" },
              { "file": "document", "pages": { "start": -1, "end": -1 } }
            ]
          }'

            
Using Postman? Download our official collection and start using the API with a single click. Read more 

Your API Key