1
pdf compress via BLOB
Community Beginner
,
/t5/acrobat-services-api-discussions/pdf-compress-via-blob/td-p/14182441
Oct 24, 2023
Oct 24, 2023
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:
[code] => INVALID_INPUT_URL
[message] => The input URL is either invalid or unsupported.
Its a bit confusing. I send the blob via the input uri.
Is there something wrong?
Is there something wrong?
Thanks!
$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);
TOPICS
PDF Services API
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
christianb54171755
AUTHOR
Community Beginner
,
/t5/acrobat-services-api-discussions/pdf-compress-via-blob/m-p/14182596#M7327
Oct 24, 2023
Oct 24, 2023
Copy link to clipboard
Copied
i just found out, that "BLOB" is the azure BLOB service, no i used dropbox instead
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Adobe Employee
,
LATEST
/t5/acrobat-services-api-discussions/pdf-compress-via-blob/m-p/14182655#M7330
Oct 24, 2023
Oct 24, 2023
Copy link to clipboard
Copied
And to be clear, it wasn't a URL, not binary/base64 content.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

