Free plan
Attachments
See, add, take out or remove files hidden inside a PDF
About this tool
A PDF can carry other files inside it, a bit like attachments in an e-mail. This tool can list those files, add a new one, take one out so you can download it, or remove one. To take out or remove a file, use its key from the list. To add a file, you also upload the file to attach.
For example, you pull out the invoice data file that is attached to a PDF invoice.
How to use it
- Choose this tool.
- Add your PDF with Upload or drag and drop.
- Choose what to do: list, add, extract or remove.
- For add, upload the file to attach. For extract or remove, enter the key of the file.
- Press Generate, then download the result.
What you get back
You get a list of the attached files, the extracted file, or a new PDF with the change, depending on what you chose.
TEST IT LIVE
Try Attachments 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/attachments
Tool ID
pdfs.attachments
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/attachments" \
-H "X-Api-Key: $DAVIX_H2I_API_KEY" \
-F 'file=@document.pdf' \
-F 'operation=list' \
-F 'output_bundle=zip' \
-F 'response=url'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.attachments({
"file": 'document.pdf',
"operation": "list",
"output_bundle": "zip",
"response": "url"
});
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()->attachments([
'file' => 'document.pdf',
'operation' => 'list',
'output_bundle' => 'zip',
'response' => 'url',
]);
echo $result->requestId;More in PDFs
