Skip to content

Commit 46cb5e6

Browse files
committed
Added example for converting URL
1 parent fd5e6e2 commit 46cb5e6

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

examples/convert-url.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
require_once __DIR__ . '/../vendor/autoload.php';
4+
5+
use \ConversionTools\ConversionClient;
6+
7+
// put token here from your Profile page at https://conversiontools.io/profile
8+
$token = '';
9+
10+
$fileOrUrlInput = 'https://google.com';
11+
$fileOutput = 'result.pdf';
12+
13+
$options = [];
14+
15+
$client = new ConversionClient($token);
16+
try {
17+
$client->convert('convert.website_to_pdf', $fileOrUrlInput, $fileOutput, $options);
18+
} catch (Exception $e) {
19+
print 'Exception: ' . $e->getMessage() . "\n";
20+
}

0 commit comments

Comments
 (0)