Get properties of a PDF
Getting the document properties will allow you to read the default properties of a PDF using the PDF.API.
Some of these include author, creation date, subject, and title.
You can view the full Swagger documentation here.
Request
- cURL
- Javascript
- PHP
curl --location 'https://pdf-api.doclabs.cloud/api/v1/MyDocument.pdf/document/properties?storageName=MyBucketName' \
--header 'Content-Type: application/json' \
--header 'x-api-key: ••••••'
var settings = {
"url": "https://pdf-api.doclabs.cloud/api/v1/MyDocument.pdf/document/properties?storageName=MyBucketName",
"method": "GET",
"timeout": 0,
"headers": {
"Content-Type": "application/json",
"x-api-key": "••••••"
},
};
$.ajax(settings).done(function (response) {
console.log(response);
});
<?php
$client = new Client();
$headers = [
'Content-Type' => 'application/json',
'x-api-key' => '••••••'
];
$request = new Request('GET', 'https://pdf-api.doclabs.cloud/api/v1/MyDocument.pdf/document/properties?storageName=MyBucketName', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();
Response
{
"author": "string",
"creationDate": "string",
"creator": "string",
"keywords": "string",
"subject": "string",
"title": "string"
}