<?php

/*
 * Demo: demo_getpdf.php
 * 
 * Primer poziva API funkcije 'getpdf' koja vraca PDF dokument
 *  
 */

//echo "<pre>";

include_once 'infoapi/infoapi.php';

$miapiHandler = new iapiHandler;
$miapiHandler->APIServerURL = SERVER_URL; // definisano u apitest/config.php

$miapiHandler->DebugLevel = DEBUG_LEVEL;
$miapiHandler->DebugSections = DEBUG_SECTIONS;


// naziv API funkcije koja se poziva
$mAPIFunctionName = 'GETPDF';

$mQueryEnvelope = new iapiQueryEnvelope ($mAPIFunctionName);
$mQueryEnvelope->username = USERNAME; // definisano u apitest/config.php
$mQueryEnvelope->password = PASSWORD; // definisano u apitest/config.php


$mQuery = $mQueryEnvelope;
$mResponse  = $miapiHandler->Execute($mQuery);
$mContentType = $miapiHandler->GetContentType();
$mContent = $miapiHandler->GetContent();

header ("Content-Type: " . $mContentType, true);

echo $mContent;