Reorder PDF pages
Drag the pages into the order you want them.
How it works
- Drop your PDF in.
- Drag the page thumbnails around.
- Download the reordered PDF.
What it does
Pages arrive in the wrong order more often than anyone admits — a double-sided scan done in two passes, a report assembled from three sources, a signature page that ended up at the front. Drag the thumbnails into the order you want and download the result.
Dragging is the interface
Pages are cards. Pick one up, put it where it belongs, and the rest close the gap. There is no page-order string to compose and no way to end up with a document whose order you cannot picture, because you are looking at it the whole time.
Useful on scanned double-sided documents
Scanning both sides of a stack in two passes gives you all the fronts and then all the backs. Reordering interleaves them without rescanning anything, which is the difference between a two-minute fix and doing the whole job again.
Nothing is re-encoded
Reordering rewrites the document's index rather than its contents. Text stays text, images keep their resolution, and file size is essentially unchanged. It is one of the few operations on a PDF that genuinely costs nothing.
Doing this from your own code
Reorder the model's pages array and PUT it back.
# fetch the model, change it, put the whole thing back
curl -s https://docubend.com/api/v1/documents/$ID.json \
-H "Authorization: Bearer $TOKEN" -o model.json
# …edit model.json…
curl -s -X PUT https://docubend.com/api/v1/pdfs/$ID \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d "{\"model\": $(cat model.json)}"
const got = await fetch(`${BASE}/api/v1/documents/${id}.json`,
{ headers: { Authorization: `Bearer ${TOKEN}` } });
const model = await got.json();
// …change model.pages…
await fetch(`${BASE}/api/v1/pdfs/${id}`, {
method: "PUT",
headers: { Authorization: `Bearer ${TOKEN}`,
"Content-Type": "application/json" },
body: JSON.stringify({ model }),
});
model = requests.get(f"{BASE}/api/v1/documents/{id}.json",
headers={"Authorization": f"Bearer {TOKEN}"}, timeout=60).json()
# …change model["pages"]…
requests.put(f"{BASE}/api/v1/pdfs/{id}",
headers={"Authorization": f"Bearer {TOKEN}"},
json={"model": model}, timeout=60)
The model is the same JSON the editor works on. Documents reference.
Questions
Will reordering change quality or file size?
No. The page order is rewritten; the page contents are copied as they are.
Can I reorder and delete in one go?
Reordering and deleting are separate tools. Do one, download, and drop the result into the other.
Does it handle a document with a hundred pages?
There is no page limit, but every page is drawn as a thumbnail in your browser, so a very long document depends on your machine.
What happens to internal links?
Links that point at a page follow that page. Links that point at a page number in the text will say the old number — worth checking on a document with a contents page.
Is my document uploaded?
No. It is read and rewritten in this tab.
Next
| Tool | What it does | Runs in | Same thing, programmatically |
|---|---|---|---|
| Merge PDF files | Join several PDFs into one, in the order you choose. | your browser | no endpoint |
| Delete pages from a PDF | Remove the pages you do not want to send. | your browser | the document model |
| Rotate PDF pages | Turn sideways pages the right way up, in the file itself. | your browser | the document model |
| Split a PDF | Pull out the pages you want, or make one file per page. | your browser | GET /api/v1/documents/{id}.pdf |