Retrieve Image Information
Extract image information from an image using the image-info endpoint.
Extracting image information from the image-info
endpoint is a breeze using DynamicPDF API. Refer to our documentation illustrating calling the endpoint directly (image-info) and using one of our client libraries.
tip
Check out Getting Started and Task Roadmap if you are new to The DynamicPDF API.
info
Refer to the API documentation and the client library documentation for the image-info
endpoint.
Calling Endpoint Directly
curl --location 'https://api.dpdf.io/v1.0/image-info'
--header 'Authorization: Bearer DP--api-key--'
--header 'Content-Type: image/png'
--data '@/C:/temp/solutions/image-info/dynamicpdfLogo.png'
Calling Endpoint Using Client Library
- C# (.NET)
- Java
- Node.js
- PHP
- Go
- Python
public static void RunOne(String key, String basePath)
{
ImageResource imageResource = null;
imageResource = new ImageResource(basePath + "getting-started.png");
ImageInfo imageInfo = new ImageInfo(imageResource);
imageInfo.ApiKey = key;
ImageResponse response = imageInfo.Process();
Console.WriteLine(PrettyPrintUtil.JsonPrettify(response.JsonContent));
}
public static void RunTwo(String apiKey, String basePath)
{
String key = apiKey;
ImageResource imageResource = new ImageResource(basePath + "multipage.tiff");
ImageInfo imageInfo = new ImageInfo(imageResource);
imageInfo.ApiKey = apiKey;
ImageResponse response = imageInfo.Process();
Console.WriteLine(PrettyPrintUtil.JsonPrettify(response.JsonContent));
}
static async RunOne(apiKey, basePath) {
var imageResource = new ImageResource(basePath + "getting-started.png");
var imageInfo = new ImageInfo(imageResource);
imageInfo.apiKey = apiKey;
var response = await imageInfo.process();
if (response.isSuccessful) {
console.log(JSON.parse(response.content));
}
}
static async RunTwo(apiKey, basePath)
{
var imageResource = new ImageResource(basePath + "multipage.tiff");
var imageInfo = new ImageInfo(imageResource);
imageInfo.apiKey = apiKey;
var response = await imageInfo.process();
if (response.isSuccessful) {
console.log(JSON.parse(response.content));
}
}
public static void RunOne(String key, String basePath) {
ImageResource imageResource = null;
imageResource = new ImageResource(basePath + "/getting-started.png");
ImageInfo imageInfo = new ImageInfo(imageResource);
imageInfo.setApiKey(key);
ImageResponse response = imageInfo.process();
System.out.println(PrettyPrintUtility.prettyPrintJSON(response.getJsonContent()));
}
public static void RunTwo(String apiKey, String basePath)
{
String key = apiKey;
ImageResource imageResource = new ImageResource(basePath + "/multipage.tiff");
ImageInfo imageInfo = new ImageInfo(imageResource);
imageInfo.setApiKey(apiKey);
ImageResponse response = imageInfo.process();
System.out.println(PrettyPrintUtility.prettyPrintJSON(response.getJsonContent()));
}
public static function RunOne()
{
$imageResource = new ImageResource(ImageInfoExample::$BasePath . "getting-started.png");
$imageInfo = new ImageInfo($imageResource);
$imageInfo->ApiKey = ImageInfoExample::$ApiKey;
$response = $imageInfo->Process();
echo ($response->JsonContent);
}
public static function RunTwo()
{
$imageResource = new ImageResource(ImageInfoExample::$BasePath . "multipage.tiff");
$imageInfo = new ImageInfo($imageResource);
$imageInfo->ApiKey = ImageInfoExample::$ApiKey;
$response = $imageInfo->Process();
echo ($response->JsonContent);
}
func RunOne(basePath string) {
resource := resource.NewImageResourceWithResourcePath(basePath + "/getting-started.png","")
imageInfo := endpoint.NewImageInfo(resource)
imageInfo.Endpoint.BaseUrl = "https://api.dpdf.io/"
imageInfo.Endpoint.ApiKey = "DP.xxx-api-key-xxx"
resp := imageInfo.Process();
res := <-resp
if res.IsSuccessful() == true {
fmt.Print(string(res.Content().Bytes()))
}
}
func RunTwo(basePath string) {
resource := resource.NewImageResourceWithResourcePath(basePath + "/multipage.tiff","")
imageInfo := endpoint.NewImageInfo(resource)
imageInfo.Endpoint.BaseUrl = "https://api.dpdf.io/"
imageInfo.Endpoint.ApiKey = "DP.xxx-api-key-xxx"
resp := imageInfo.Process();
res := <-resp
if res.IsSuccessful() == true {
fmt.Print(string(res.Content().Bytes()))
}
}
def image_info(api_key, full_path):
resource = ImageResource(full_path + "getting-started.png")
image_info = ImageInfo(resource)
image_info.api_key = api_key
response = image_info.process()
print(response.json_content)