Free plan
Convert Document
Change a document into another type, like Word to PDF
About this tool
This tool changes a document from one kind of file to another, for example Word to PDF, or PDF to Word. You choose the type you want. The types that are possible depend on the file you add. If your Word, Excel or PowerPoint file is locked, you can type its password so it can be opened.
For example, you turn a Word letter into a PDF so it looks the same on every phone and computer.
How to use it
- Choose this tool.
- Add your document with Upload or drag and drop.
- Choose the type you want to get, such as PDF or Word.
- Press Generate.
- Download the converted file.
What you get back
You get a new file in the type you chose, ready to download. The original is not changed.
GOOD TO KNOW
Requires LibreOffice (sandboxed) on the server: a runtime capability, see GET /v1/capabilities. PDF->office conversion reconstructs layout heuristically. Binary Office files (DOC / XLS / PPT) are converted only inside the full sandbox. DjVu and XPS are read by their own programs (djvulibre, libgxps; runtime capabilities) and can only be turned into PDF.
TEST IT LIVE
Try Convert Document in the Studio
One click opens the Studio with this tool already selected. Add your file and see the result in seconds.
Family
Documents
Plan
Free
Method
POST
Endpoint
/v1/documents/convert
Tool ID
documents.convert
Authentication
API key
Accepts
PDF, DOCX, XLSX, PPTX, ODT, ODS +25 more
Background jobs
Yes
Usage group
Documents
For developers
Use it from your code
cURL
curl -X POST "https://app.h2i.davixlabs.io/v1/documents/convert" \
-H "X-Api-Key: $DAVIX_H2I_API_KEY" \
-F 'file=@document.pdf' \
-F 'to=jpeg' \
-F 'pdfaLevel=2b' \
-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.documents.convert({
"file": 'document.pdf',
"to": "jpeg",
"pdfaLevel": "2b",
"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->documents()->convert([
'file' => 'document.pdf',
'to' => 'jpeg',
'pdfaLevel' => '2b',
'output_bundle' => 'zip',
]);
echo $result->requestId;Documentation
Guides that use this tool
More in Documents
