Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
1

pdf compress via BLOB

Community Beginner ,
Oct 24, 2023 Oct 24, 2023

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

 

 

TOPICS
PDF Services API
357
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 24, 2023 Oct 24, 2023

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Oct 24, 2023 Oct 24, 2023
LATEST

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources