Translate a PDF and keep its layout
About this tool
How to use it
- Choose this tool.
- Add your PDF with Upload or drag and drop (one file).
- Choose the language to translate into, and the original language if you know it.
- Optionally add a glossary of words with the translation you want.
- Press Generate and download the new PDF.
What you get back
Try Translate a PDF and keep its layout in the Studio
Use it from your code
cURL
curl -X POST "https://app.h2i.davixlabs.io/v1/ai/documents/translate-layout" \
-H "X-Api-Key: $DAVIX_H2I_API_KEY" \
-F 'files=@document.pdf' \
-F 'on_unsupported=error' \
-F 'quality=standard' \
-F 'target_language=xx'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.ai.documents.translateLayout({
"files": 'document.pdf',
"on_unsupported": "error",
"quality": "standard",
"target_language": "xx"
});
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->ai()->documents()->translateLayout([
'files' => 'document.pdf',
'on_unsupported' => 'error',
'quality' => 'standard',
'target_language' => 'xx',
]);
echo $result->requestId;