Free plan
PDF layers
See the layers inside a PDF and switch them on or off
About this tool
Some PDFs, such as maps, plans and drawings, are built from layers, a bit like transparent sheets stacked on top of each other. This tool lists the layers of your PDF and shows which are on. You can also switch layers on or off by name, for example to hide the dimensions on a drawing. A PDF without layers has nothing to switch.
For example, you have a floor plan PDF and want to hide the layer called Furniture before sending it to the builder.
How to use it
- Choose this tool.
- Add your PDF (one file).
- Choose whether you only want to list the layers or to switch some on or off.
- To switch layers, type the names of the layers to show and the layers to hide, or choose show all or hide all.
- Press Generate, then download the result or read the list.
What you get back
With the list option you see every layer and whether it is on or off. With the switch option you get a new PDF with your chosen layers on or off, ready to download.
GOOD TO KNOW
Sets the default visibility stored in the file; a viewer lets the reader switch layers again. A PDF with no layers is refused for set. Counts as one PDF operation.
TEST IT LIVE
Try PDF layers in the Studio
One click opens the Studio with this tool already selected. Add your file and see the result in seconds.
Family
PDFs
Plan
Free
Method
POST
Endpoint
/v1/pdfs/layers
Tool ID
pdfs.layers
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/layers" \
-H "X-Api-Key: $DAVIX_H2I_API_KEY" \
-F 'file=@document.pdf' \
-F 'operation=list' \
-F 'show=["Labels"]' \
-F 'hide=["Cut line"]'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.layers({
"file": 'document.pdf',
"operation": "list",
"show": "[\"Labels\"]",
"hide": "[\"Cut line\"]"
});
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()->layers([
'file' => 'document.pdf',
'operation' => 'list',
'show' => '["Labels"]',
'hide' => '["Cut line"]',
]);
echo $result->requestId;More in PDFs
