PHP code example of itexpertsbv / klippa
1. Go to this page and download the library: Download itexpertsbv/klippa library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
itexpertsbv / klippa example snippets
Use ITExperts\Klippa\Klippa;
Use ITExperts\Klippa\Klippa\Client\HttpClient;
$key = 'MkKjVvfjG2wJ5WAW3kkqgiZlWW0zN7aq'; // Sample key
// Create directly from Klippa
$klippa = Klippa::HttpClient($key);
// Build your own client first
$client = new HttpClient($key);
$klippa = new Klippa($client);
$base64 = base64_encode(file_get_contente('path/to/file.pdf'));
$document = $klippa->parseDocumentFromBase64($base64);
echo $document->invoiceNumber; // e.g. FT22-0234
$url = 'https://acme.com/invoice.pdf';
$document = $klippa->parseDocumentFromUrl($url);
echo $document->invoiceNumber; // e.g. FT22-0234