DefaultTitle
  1. Common-Breadcrumbs-Home::Home
  2. Page
  3. PdfToImage

PdfToImage

Method-PdfToImage-Description::Convert specified PDF page to image.

copy
Something went wrong, try again
copy
            
                    
        
Body parameter
Method-Common-Parameter::Parameter Method-Common-Value::Value Method-Common-Description::Description

pdfPageToImageRequest

Method-Common-Required::Required

copy
PdfPageToImageRequest Method-PdfToImage-pdfPageToImageRequest-Description::
PdfPageToImageRequest
Method-Common-Parameter::Parameter Method-Common-Value::Value Method-Common-Description::Description

Format

Method-Common-Required::Required

PageExportFormat Method-Format-Property-Description::Image file format.

Height

Method-Common-Required::Required

int32 Method-Height-Property-Description::The converted image height. Default is PDF page height.

PageNumber

Method-Common-Required::Required

int32 Method-PageNumber-Property-Description::Number of PDF file page. Starts with 1. Default is 1.

PdfBase64File

Method-Common-Required::Required

close-icon
string Method-PdfBase64File-Property-Description::Base64 encoded PDF document to process.

Width

Method-Common-Required::Required

int32 Method-Width-Property-Description::The converted image width. Default is PDF page width.
copy Copy to clipboard
        
package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api-qa.conholdate.cloud/v5.0/pdf/page/to-image"
  method := "POST"

  payload := strings.NewReader(`{
      "Format": "Jpeg",
      "PageNumber": 1,
      "Width": 1,
      "Height": 1,
      "PdfBase64File": "Base64 encoded file...",
    }`)

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Content-Type", "application/json")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
                   
         
            
File file = new File("path/to/file/fileName.pdf");
byte[] encoded = Base64.encodeBase64(FileUtils.readFileToByteArray(file));
String base64EncodedFile = new String(encoded, StandardCharsets.US_ASCII);

OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, 
    "{" +
      "\"Format\": \"Jpeg\"," +
      "\"PageNumber\": 1," +
      "\"Width\": 1," +
      "\"Height\": 1," +
      "\"PdfBase64File\": \"" + base64EncodedFile + "\"," +
    "}");

Request request = new Request.Builder()
  .url("https://api-qa.conholdate.cloud/v5.0/pdf/page/to-image")
  .method("POST", body)
  .addHeader("Content-Type", "application/json")
  .build();

Response response = client.newCall(request).execute();
                   
        
            
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => 'https://api-qa.conholdate.cloud/v5.0/pdf/page/to-image',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => '',
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 0,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_POSTFIELDS =>'{
      "Format": "Jpeg",
      "PageNumber": 1,
      "Width": 1,
      "Height": 1,
      "PdfBase64File": "Base64 encoded file...",
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
                   
        
            
import requests
import json

url = "https://api-qa.conholdate.cloud/v5.0/pdf/page/to-image"

json_data = json.dumps({
      "Format": "Jpeg",
      "PageNumber": 1,
      "Width": 1,
      "Height": 1,
      "PdfBase64File": "Base64 encoded file...",
})
headers = {
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=json_data)

print(response.text)
                   
        
            
curl --location --request POST 'https://api-qa.conholdate.cloud/v5.0/pdf/page/to-image' \
--header 'Content-Type: application/json' \
--data-raw '{
      "Format": "Jpeg",
      "PageNumber": 1,
      "Width": 1,
      "Height": 1,
      "PdfBase64File": "Base64 encoded file...",
}'
                   
        
            
require "uri"
require "json"
require "net/http"

url = URI("https://api-qa.conholdate.cloud/v5.0/pdf/page/to-image")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request.body = JSON.dump({
      "Format": "Jpeg",
      "PageNumber": 1,
      "Width": 1,
      "Height": 1,
      "PdfBase64File": "Base64 encoded file...",
})

response = https.request(request)
puts response.read_body

                   
        
            
var client = new RestClient("https://api-qa.conholdate.cloud/v5.0/pdf/page/to-image");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
var body = "{" + 
      "\"Format\": \"Jpeg\"," +
      "\"PageNumber\": 1," +
      "\"Width\": 1," +
      "\"Height\": 1," +
      "\"PdfBase64File\": \"" + base64EncodedFile + "\"," +
"}";
request.AddParameter("application/json", body,  ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
                       
            
Method-PdfToImage-Overview-UnderTitle

Method-PdfToImage-Overview-Title

Method-PdfToImage-Overview-Text


Method-PdfToImage-Feature1-Title

Method-PdfToImage-Feature1-Text

Method-PdfToImage-Feature2-Title

Method-PdfToImage-Feature2-Text

Method-PdfToImage-Feature3-Title

Method-PdfToImage-Feature3-Text
Method-PdfToImage-HowTo-Title
clock
Method-PdfToImage-Step1-Title
Method-PdfToImage-Step1-Text
arrow
clock
Method-PdfToImage-Step2-Title
Method-PdfToImage-Step2-Text
arrow
clock
Method-PdfToImage-Step3-Title
Method-PdfToImage-Step3-Text
clock
Method-PdfToImage-Question1
Method-PdfToImage-Answer1
clock
Method-PdfToImage-Question2
Method-PdfToImage-Answer2
clock
Method-PdfToImage-Question3
Method-PdfToImage-Answer3
clock
Method-PdfToImage-Question4
Method-PdfToImage-Answer4
Method-PdfToImage-FAQ-UnderTitle

Method-PdfToImage-FAQ-Title

Method-PdfToImage-FAQ-Text