Free plan

Edit Pages

Rotate, delete, reorder, add or mark pages of a PDF
POST
/v1/pdfs/manipulate

About this tool

This tool edits the pages of a PDF. You can rotate pages, delete them, put them in a new order, add blank pages or pictures, draw shapes, add links and bookmarks, and mark up pages with highlights, notes or stamps. Your edits run one after the other, so later steps see the result of earlier ones. You can also add pictures to use as stamps.
For example, you want to move the last page of a report to the front, rotate a sideways page, and delete the empty page 5.

How to use it

  1. Choose this tool.
  2. Add your PDF, and any pictures you want to use as stamps.
  3. Add the edits you want, such as rotate, delete pages or change the order, and fill in the page numbers.
  4. Choose whether notes and marks should be flattened into the page, which makes them part of the page itself.
  5. Press Generate, then download the edited PDF.

What you get back

You get a new PDF with all your edits applied, ready to download.
GOOD TO KNOW
The op vocabulary above is the complete, engine-validated set (14 operations). GET /v1/capabilities lists a shorter subset of operation names (see docs/api: known discrepancy).
TEST IT LIVE

Try Edit Pages in the Studio

One click opens the Studio with this tool already selected. Add your file and see the result in seconds.
Open in the Studio
Family
PDFs
Plan
Free
Method
POST
Endpoint
/v1/pdfs/manipulate
Tool ID
pdfs.manipulate
Authentication
API key
Accepts
PDF
Background jobs
Yes
Usage group
Pdf
For developers

Use it from your code

cURL

curl -X POST "https://app.h2i.davixlabs.io/v1/pdfs/manipulate" \
  -H "X-Api-Key: $DAVIX_H2I_API_KEY" \
  -F 'file=@document.pdf' \
  -F 'operations=[{"op":"rotate"}]' \
  -F 'flattenAnnotations=all' \
  -F 'output_bundle=zip'

Node.js

const { DavixH2I } = require('@davixlabs/h2i-sdk');

const h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });
const result = await h2i.pdfs.manipulate({
    "file": 'document.pdf',
    "operations": [
      {
        "op": "rotate"
      }
    ],
    "flattenAnnotations": "all",
    "output_bundle": "zip"
  });
console.log(result.data, result.requestId);

PHP

<?php
require 'vendor/autoload.php';

$h2i = new \Davix\H2I\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);
$result = $h2i->pdfs()->manipulate([
    'file' => 'document.pdf',
    'operations' => [[
            'op' => 'rotate',
        ]],
    'flattenAnnotations' => 'all',
    'output_bundle' => 'zip',
]);
echo $result->requestId;
FAQ

Frequently asked questions

Rotate, delete, reorder, add or mark pages of a PDF. It can do several jobs from one endpoint: operations[].op, operations-list, items.

Edit Pages accepts PDF. You can send several files in one request.

Edit Pages is included in every plan, including Free. Each run uses credits from your monthly allowance.

Send a POST request to /v1/pdfs/manipulate with your API key in the X-Api-Key header. Official SDKs for Node.js, Python, PHP, Go, Java, .NET and Ruby do the same for you, and the code box on this page shows ready-to-copy examples. For large work it can also run as a background job, so your request returns straight away.