Free plan
Document Preview
Make a picture of the first page of a document
About this tool
This tool turns pages of a document into pictures, so you can see them without opening the file. By default it makes the first page only. You can ask for other pages or all pages, and choose the picture width and type. It works with PDF, Word, Excel, PowerPoint and similar files.
For example, you want a small thumbnail of the first page of each report to put in a list.
How to use it
- Choose this tool.
- Add your document with Upload or drag and drop.
- Choose which pages you want, such as first, all or 1-3.
- Press Generate.
- Download the picture or pictures.
What you get back
You get one picture per page, as PNG, JPEG or WebP files you can download.
TEST IT LIVE
Try Document Preview 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/preview
Tool ID
documents.preview
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/preview" \
-H "X-Api-Key: $DAVIX_H2I_API_KEY" \
-F 'file=@document.pdf' \
-F 'width=400' \
-F 'format=png' \
-F 'dpi=1'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.preview({
"file": 'document.pdf',
"width": 400,
"format": "png",
"dpi": 1
});
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()->preview([
'file' => 'document.pdf',
'width' => 400,
'format' => 'png',
'dpi' => 1,
]);
echo $result->requestId;More in Documents
