I have a class with namespace which require many other classes further . main class is
<?php
/**
* Deals with PDF document level aspects.
*/
namespace Aspose\Cloud\Pdf;
use Aspose\Cloud\Common\AsposeApp;
use Aspose\Cloud\Common\Product;
use Aspose\Cloud\Common\Utils;
use Aspose\Cloud\Event\SplitPageEvent;
use Aspose\Cloud\Exception\AsposeCloudException as Exception;
use Aspose\Cloud\Storage\Folder;
class Document
{
public $fileName = '';
public function __construct($fileName='')
{
$this->fileName = $fileName;
}
/**
* Gets the page count of the specified PDF document.
*
* @return integer
*/
public function getFormFields()
{
//build URI
$strURI = Product::$baseProductUri . '/pdf/' . $this->getFileName() . '/fields';
//sign URI
$signedURI = Utils::sign($strURI);
//get response stream
$responseStream = Utils::ProcessCommand($signedURI, 'GET', '');
$json = json_decode($responseStream);
return $json->Fields->List;
}
}
I am using this like this in index.php
<?
ini_set('display_errors', '1');
use Aspose\Cloud\Pdf;
$document=new Document;
echo $document->GetFormFields();
//or like this
echo Document::GetFormFields();
//also tried this
echo pdf::GetFormFields();
?>
Error
Fatal error: Class 'Document' not found in /var/www/pdfparser/asposetry/index.php on line 5
Document class path is Aspose/Cloud/Pdf/Document.php
attempt one
working if i use to include in index.php include(Aspose/Cloud/Pdf/Document.php)
but then further namespace produce error. Very difficult to change every use
namespace with include
. can anybudy tell me the solution for this ??
thanks.