Copy link to clipboard
Copied
Dear community.
I try to compress PDF files over the api service and build a code, based on the documentation.
I always get the result:
$file_content = file_get_contents($filepath);
$data = array(
"input" => array(
"uri" => base64_encode($file_content),
"storage" =>"BLOB"
),
"output" => array(
"storage" =>"BLOB"
)
);
$json_data = json_encode($data);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://pdf-services.adobe.io/operation/compresspdf');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $json_data);
// Headers setzen
$headers = array();
$headers[] = 'x-api-key: ' . $config["adobe"]["client_id"];
$headers[] = 'Content-Type: application/json';
$headers[] = 'Authorization: Bearer ' . $config["adobe"]["token"];
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);
if (curl_errno($ch)) {
echo 'Fehler:' . curl_error($ch);
}
curl_close($ch);
Copy link to clipboard
Copied
i just found out, that "BLOB" is the azure BLOB service, no i used dropbox instead
Copy link to clipboard
Copied
And to be clear, it wasn't a URL, not binary/base64 content.