Skip to main content
Participant
October 24, 2023
Question

pdf compress via BLOB

  • October 24, 2023
  • 1 reply
  • 478 views

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?

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);

 

 

This topic has been closed for replies.

1 reply

Participant
October 24, 2023

i just found out, that "BLOB" is the azure BLOB service, no i used dropbox instead

Raymond Camden
Community Manager
Community Manager
October 24, 2023

And to be clear, it wasn't a URL, not binary/base64 content.