Download #

Downloads the processed file from the PDF tools website.

Endpoint #

The download URL is returned in the response of the execute request.

Parameters #

No additional parameters are required for the download step.

Example using cURL: #

curl -OJL -H "Authorization: Bearer YOUR_API_TOKEN" "http://trupdf.test/api/v1/download/xYNNUCkqVVWEDsxXOLGZxCbz9ggreeNAOMErSl8wRw1WDsiZbnvECaGV6AwdtUtaYLA2PrI9WuPCGOqdiJcfp2d6d0b9p0gnbePz"

Example using PHP: #

use GuzzleHttp\Client;

$client = new Client();
$token = 'YOUR_API_TOKEN';
$response = $client->get($downloadUrl, [
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);

// Save the downloaded file
$filename = basename($downloadUrl);
$fileContents = $response->getBody()->getContents();
file_put_contents($filename, $fileContents);

Response #

The response of the download request contains the processed file.

  • If the output file is a single PDF file, the API returns the file directly in the response.
  • If the output consists of multiple files or if the output file is not a PDF, the API returns a ZIP file containing the processed files.

Error Responses

  • If there is an issue with downloading the file or if the file is not available, the API responds with an appropriate error message.

Notes

  • The download URL is provided in the response of the execute request. Ensure that you use the correct download URL corresponding to the task execution.
  • Save the downloaded file for further processing or use as needed.

This step completes the PDF processing workflow by providing the processed file for download.