Free plan

Crop / Resize / Booklet

Crop the margins, change the paper size, or make a printable booklet
POST
/v1/pdfs/layout

About this tool

This tool changes how the pages of a PDF are laid out. Crop cuts away margins or a box from the pages. Resize fits the pages onto a paper size such as A4 or Letter. Booklet puts two pages on each sheet so that, once printed and folded, the pages read in the right order. By default, cropping only hides the outside area; the content stays in the file.
For example, you have a 16-page leaflet and want a file you can print on both sides of A4 sheets, fold in half and staple as a booklet.

How to use it

  1. Choose this tool.
  2. Add your PDF.
  3. Choose what to do: crop, resize or booklet.
  4. Set the options for that choice, such as the margin to cut, the paper size and how the page fits, or the sheet size and which side the book is bound.
  5. Press Generate, then download the new PDF.

What you get back

You get a new PDF with the cropped, resized or booklet pages. You can download it.
TEST IT LIVE

Try Crop / Resize / Booklet 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/layout
Tool ID
pdfs.layout
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/layout" \
  -H "X-Api-Key: $DAVIX_H2I_API_KEY" \
  -F 'file=@document.pdf' \
  -F 'operation=crop' \
  -F 'fit=contain' \
  -F 'orientation=auto'

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.layout({
    "file": 'document.pdf',
    "operation": "crop",
    "fit": "contain",
    "orientation": "auto"
  });
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()->layout([
    'file' => 'document.pdf',
    'operation' => 'crop',
    'fit' => 'contain',
    'orientation' => 'auto',
]);
echo $result->requestId;
FAQ

Frequently asked questions

crop: cut margins or a box from pages (non-destructive CropBox, or permanent); resize: fit pages onto a paper size; booklet: arrange pages two per sheet side so the printed, folded stack reads in order.

Crop / Resize / Booklet accepts PDF. You can send several files in one request.

Crop / Resize / Booklet is included in every plan, including Free. Each run uses credits from your monthly allowance.

Send a POST request to /v1/pdfs/layout 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.