PDF to PDF/A
curl --request POST \
--url https://api.pdf.co/v1/pdf/convert/to/pdfa \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"url": "https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdfa/sample.pdf",
"callback": "<string>",
"name": "<string>",
"expiration": 60
}
'import requests
url = "https://api.pdf.co/v1/pdf/convert/to/pdfa"
payload = {
"url": "https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdfa/sample.pdf",
"callback": "<string>",
"name": "<string>",
"expiration": 60
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: 'https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdfa/sample.pdf',
callback: '<string>',
name: '<string>',
expiration: 60
})
};
fetch('https://api.pdf.co/v1/pdf/convert/to/pdfa', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.pdf.co/v1/pdf/convert/to/pdfa",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'url' => 'https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdfa/sample.pdf',
'callback' => '<string>',
'name' => '<string>',
'expiration' => 60
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.pdf.co/v1/pdf/convert/to/pdfa"
payload := strings.NewReader("{\n \"url\": \"https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdfa/sample.pdf\",\n \"callback\": \"<string>\",\n \"name\": \"<string>\",\n \"expiration\": 60\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.pdf.co/v1/pdf/convert/to/pdfa")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdfa/sample.pdf\",\n \"callback\": \"<string>\",\n \"name\": \"<string>\",\n \"expiration\": 60\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pdf.co/v1/pdf/convert/to/pdfa")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdfa/sample.pdf\",\n \"callback\": \"<string>\",\n \"name\": \"<string>\",\n \"expiration\": 60\n}"
response = http.request(request)
puts response.read_body{
"pageCount": 1,
"error": false,
"status": 200,
"duration": 31,
"name": "sample.pdf",
"validationReportName": "sample-pdfa-validation.json",
"jobId": "EXAMPLEJOBID0123456789ABCDEFGHIJ--166-400",
"credits": 25,
"remainingCredits": 400000
}{
"error": true,
"status": 400,
"message": "Bad request. Typically due to bad input parameters or unreachable input URLs (e.g., access restrictions like login or password)."
}{
"error": true,
"status": 401,
"message": "Unauthorized. Authentication is required and has failed or has not yet been provided."
}{
"error": true,
"status": 402,
"message": "Not enough credits."
}{
"error": true,
"status": 403,
"message": "Access forbidden for input URL."
}{
"error": true,
"status": 404,
"message": "The requested resource could not be found."
}{
"error": true,
"status": 408,
"message": "The server timed out waiting for the request."
}{
"error": true,
"status": 429,
"message": "Too many requests in a given time period."
}{
"error": true,
"status": 442,
"message": "Input document is damaged or of incorrect type."
}{
"error": true,
"status": 452,
"message": "Invalid URL."
}{
"error": true,
"status": 454,
"message": "Invalid parameters."
}{
"error": true,
"status": 500,
"message": "Something went wrong. Please try again or contact support."
}PDF Conversion
PDF to PDF/A (API Tester)
Submit a PDF/A conversion and receive a background job ID.
POST
/
v1
/
pdf
/
convert
/
to
/
pdfa
PDF to PDF/A
curl --request POST \
--url https://api.pdf.co/v1/pdf/convert/to/pdfa \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"url": "https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdfa/sample.pdf",
"callback": "<string>",
"name": "<string>",
"expiration": 60
}
'import requests
url = "https://api.pdf.co/v1/pdf/convert/to/pdfa"
payload = {
"url": "https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdfa/sample.pdf",
"callback": "<string>",
"name": "<string>",
"expiration": 60
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: 'https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdfa/sample.pdf',
callback: '<string>',
name: '<string>',
expiration: 60
})
};
fetch('https://api.pdf.co/v1/pdf/convert/to/pdfa', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.pdf.co/v1/pdf/convert/to/pdfa",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'url' => 'https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdfa/sample.pdf',
'callback' => '<string>',
'name' => '<string>',
'expiration' => 60
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.pdf.co/v1/pdf/convert/to/pdfa"
payload := strings.NewReader("{\n \"url\": \"https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdfa/sample.pdf\",\n \"callback\": \"<string>\",\n \"name\": \"<string>\",\n \"expiration\": 60\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.pdf.co/v1/pdf/convert/to/pdfa")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdfa/sample.pdf\",\n \"callback\": \"<string>\",\n \"name\": \"<string>\",\n \"expiration\": 60\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pdf.co/v1/pdf/convert/to/pdfa")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdfa/sample.pdf\",\n \"callback\": \"<string>\",\n \"name\": \"<string>\",\n \"expiration\": 60\n}"
response = http.request(request)
puts response.read_body{
"pageCount": 1,
"error": false,
"status": 200,
"duration": 31,
"name": "sample.pdf",
"validationReportName": "sample-pdfa-validation.json",
"jobId": "EXAMPLEJOBID0123456789ABCDEFGHIJ--166-400",
"credits": 25,
"remainingCredits": 400000
}{
"error": true,
"status": 400,
"message": "Bad request. Typically due to bad input parameters or unreachable input URLs (e.g., access restrictions like login or password)."
}{
"error": true,
"status": 401,
"message": "Unauthorized. Authentication is required and has failed or has not yet been provided."
}{
"error": true,
"status": 402,
"message": "Not enough credits."
}{
"error": true,
"status": 403,
"message": "Access forbidden for input URL."
}{
"error": true,
"status": 404,
"message": "The requested resource could not be found."
}{
"error": true,
"status": 408,
"message": "The server timed out waiting for the request."
}{
"error": true,
"status": 429,
"message": "Too many requests in a given time period."
}{
"error": true,
"status": 442,
"message": "Input document is damaged or of incorrect type."
}{
"error": true,
"status": 452,
"message": "Invalid URL."
}{
"error": true,
"status": 454,
"message": "Invalid parameters."
}{
"error": true,
"status": 500,
"message": "Something went wrong. Please try again or contact support."
}Full reference: PDF to PDF/A covers parameters, validation states, billing and limits. This operation starts a background job. Use Background Job Check to retrieve the final files.
Body
application/json
URL to the source file url attribute.
Response
Background job accepted. File links are returned only in the final job result when those files are produced.
Was this page helpful?