Example #1
0
#!/usr/bin/php
<?php 
// $argv .. array
// $argc
require 'pdfcrowd.php';
if ($argc < 2) {
    echo "usage: test.php username api_key [apihost [http-port https-port]]\n";
    exit(1);
}
if ($argv > 3) {
    Pdfcrowd::$api_host = $argv[3];
}
if ($argv == 6) {
    Pdfcrowd::$http_port = $argv[4];
    Pdfcrowd::$https_port = $argv[5];
}
$api_host = Pdfcrowd::$api_host;
$http_port = Pdfcrowd::$http_port;
$https_port = Pdfcrowd::$https_port;
echo "using {$api_host} ports {$http_port} {$https_port}\n";
chdir(dirname($argv[0]));
$test_dir = './test_files';
function out_stream($name, $use_ssl)
{
    $fname = "./test_files/out/php_client_{$name}";
    if ($use_ssl) {
        $fname .= "_ssl";
    }
    return fopen($fname . '.pdf', 'wb');
}
$html = "<html><body>Uploaded content!</body></html>";