-
Notifications
You must be signed in to change notification settings - Fork 0
/
ImageInfoExample.php
32 lines (28 loc) · 999 Bytes
/
ImageInfoExample.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
require __DIR__ . '/vendor/autoload.php';
include_once __DIR__ . '/DynamicPdfExamples.php';
use DynamicPDF\Api\ImageResource;
use DynamicPDF\Api\ImageInfo;
class ImageInfoExample
{
public static function Run(string $apikey, string $path){
ImageInfoExample::RunOne($apikey, $path);
ImageInfoExample::RunTwo($apikey, $path);
}
public static function RunOne(string $apikey, string $path)
{
$imageResource = new ImageResource($path . "getting-started.png");
$imageInfo = new ImageInfo($imageResource);
$imageInfo->ApiKey = $apikey;
$response = $imageInfo->Process();
echo ($response->JsonContent);
}
public static function RunTwo(string $apikey, string $path)
{
$imageResource = new ImageResource($path . "multipage.tiff");
$imageInfo = new ImageInfo($imageResource);
$imageInfo->ApiKey = $apikey;
$response = $imageInfo->Process();
echo ($response->JsonContent);
}
}