Pdf To Image Conversion

Introduction

Pdf to image conversion function allow you to easily converts pdf pages to image format. Our functions are too fast and quick to handle any number of pages. Response will be zip file containing all pages of pdf in image format

  • Supported types are Pdf,jpeg jpg jfif png bmp gif pnm tiff svg

Endpoint

Post
   https://api.oyyi.xyz/v1/pdf-image

Parameters

  • file REQUIRED
    • Type: File or uuid
    • UUID can be id of previous conversion so that you don't have to re-upload file to server, and it will save network resource and timing.
      Only Pdf files are allowed and Max Size Allowed for file is 100MB by default. If you need more, you ask us to increase it for you. 429 Error will be return otherwise
  • Extra Parameter

    Apart from these you can also all available common parameter available for media processing request. See Here

Example

Python
import requestsurl = $BASE_URL/pdf-imagetoken = 'your_bearer_token_here'headers = {'Authorization': f'Bearer {token}'}files = {'file': open('my_pdf_file.pdf', 'rb')}response = requests.post(url, headers=headers, files=files)print(response.text)
Javascript
const axios = require('axios');const url = $BASE_URL/pdf-image;const token = 'your_bearer_token_here';const formData = new FormData();formData.append('file', YOUR FILE);const config = {  headers: {    'Authorization': `Bearer ${token}`,    'Content-Type': 'multipart/form-data'  }};axios.post(url, formData, config)  .then(response => console.log(response.data))  .catch(error => console.error(error));
Dart
import 'dart:io';import 'package:http/http.dart' as http;void main() async {  var url = Uri.parse($BASE_URL/pdf-image);  var token = 'your_bearer_token_here';  var request = http.MultipartRequest('POST', url)    ..headers['Authorization'] = 'Bearer $token'    ..files.add(await http.MultipartFile.fromPath('file', 'my_pdf_file.pdf'));  var response = await request.send();  print(await response.stream.bytesToString());}
Laravel
use Illuminate\Http\Client\Response;use Illuminate\Support\Facades\Http;$url = '$BASE_URL/pdf-image';$token = 'your_bearer_token_here';$response = Http::withHeaders([    'Authorization' => 'Bearer ' . $token,])->attach('file', $file_path)->post($url);if ($response->successful()) {    $data = $response->json();} else {m    $message = $response->json()['message']m;}
Curl
curl -X POST \  -H 'Authorization: Bearer your_bearer_token_here' \  -F 'file=@/path/to/your/file' \  $BASE_URL/pdf-image

::

Response

Default
{  "data": {    "id": "4c27a32a-8d3e-4ad4-a19c-91063cb0483f",  "converted_file": "your_random_converted_file.jpg",    "created_at": "2023-02-22T06:25:35.659015Z",     "status": "queued"  }}
Upload Original
{  "data": {    "id": "dd4409a1-68bf-4e0f-821a-498e19c6fdcc",     "id": "dd4409a1-68bf-4e0f-821a-498e19c6fdcc",   "converted_file": "your_random_converted_file.jpg",        "original_file": "original.jpg",    "created_at": "2023-02-22T06:26:53.031758Z",    "status": "done  }}
You can visit here to know to you can fetch file by file id.