Location: PHPKode > projects > pdfDOM > pdfdom-0.5/tests/test.php
<?php
$root_path = "../";
define('FPDF_FONTPATH', $root_path."fpdf/font/");
include($root_path . "fpdf/fpdf.php");
include($root_path ."classes/class.coordinateobject.php");
include($root_path ."classes/class.container.php");
include($root_path ."classes/class.page.php");
include($root_path ."classes/class.textcontainer.php");
include($root_path ."classes/class.table.php");
//echo FPDF_FONTPATH;

$text = "Autoconf is a tool for producing shell scripts that automatically configure software source code packages to adapt to many kinds of UNIX-like systems. The configuration scripts produced by Autoconf are independent of Autoconf when they are run, so their users do not need to have Autoconf.

The configuration scripts produced by Autoconf require no manual user intervention when run; they do not normally even need an argument specifying the system type. Instead, they individually test for the presence of each feature that the software package they are for might need. (Before each check, they print a one-line message stating what they are checking for, so the user doesn't get too bored while waiting for the script to finish.) As a result, they deal well with systems that are hybrids or customized from the more common UNIX variants. There is no need to maintain files that list the features supported by each release of each variant of UNIX.

For each software package that Autoconf is used with, it creates a configuration script from a template file that lists the system features that the package needs or can use. After the shell code to recognize and respond to a system feature has been written, Autoconf allows it to be shared by many software packages that can use (or need) that feature. If it later turns out that the shell code needs adjustment for some reason, it needs to be changed in only one place; all of the configuration scripts can be regenerated automatically to take advantage of the updated code.

The Metaconfig package is similar in purpose to Autoconf, but the scripts it produces require manual user intervention, which is quite inconvenient when configuring large source trees. Unlike Metaconfig scripts, Autoconf scripts can support cross-compiling, if some care is taken in writing them.

Autoconf does not solve all problems related to making portable software packages--for a more complete solution, it should be used in concert with other GNU build tools like Automake and Libtool. These other tools take on jobs like the creation of a portable, recursive `Makefile' with all of the standard targets, linking of shared libraries, and so on. See section 2. The GNU Build System, for more information.

Autoconf imposes some restrictions on the names of macros used with #if in C programs (see section B.3 Preprocessor Symbol Index).

Autoconf requires GNU M4 in order to generate the scripts. It uses features that some UNIX versions of M4, including GNU M4 1.3, do not have. You must use version 1.4 or later of GNU M4.

See section 15.5 Upgrading From Version 1, for information about upgrading from version 1. See section 18. History of Autoconf, for the story of Autoconf's development. See section 17. Frequent Autoconf Questions, with answers, for answers to some common questions about Autoconf.

See the Autoconf web page for up-to-date information, details on the mailing lists, pointers to a list of known bugs, etc.

Mail suggestions to the Autoconf mailing list.

Bug reports should be preferably submitted to the Autoconf Gnats database, or sent to the Autoconf Bugs mailing list. If possible, first check that your bug is not already solved in current development versions, and that it has not been reported yet. Be sure to include all the needed information and a short `configure.ac' that demonstrates the problem.

Autoconf's development tree is accessible via CVS; see the Autoconf web page for details. There is also a CVSweb interface to the Autoconf development tree. Patches relative to the current CVS version can be sent for review to the Autoconf Patches mailing list.

Because of its mission, Autoconf includes only a set of often-used macros that have already demonstrated their usefulness. Nevertheless, if you wish to share your macros, or find existing ones, see the Autoconf Macro Archive, which is kindly run by Peter Simons.";



class MyOwnPageHandler extends pdTextContainer
{
	function MyOwnPageHandler ()
	{
		global $newpage;
		
		pdTextContainer::pdTextContainer();

	}
	
	function onRemainingText($mtext)
	{
		global $pages, $newpage;
		
		$page = new pdPage();	
				
		$text = new MyOwnPageHandler;
		$text->coordinates->setXYWH(10,10,100,100);
		$text->setText($mtext);
		
		$page->id = "newpage";
		$page->addContainer($text);
		
		$page->preRender();
		
		array_unshift($pages, &$page);
		
	}	
}

$pages = array();

$root = new pdPage();

$con1 = new pdTextContainer;
$con2 = new pdTextContainer;
$con3 = new MyOwnPageHandler;


$con1->coordinates->setXYWH(1,1,4,1);
$con2->coordinates->setXYWH(2,1,1,1);

$con1->setClippingObjects($con2);

$con1->coordinates->setXYWH(20,65,151,103);
$con2->coordinates->setXYWH(140,25,21,21);
$con3->coordinates->setXYWH(40,25,51,51);

$root->addContainer($con1);
$root->addContainer($con2);
$con2->addContainer($con3);

$con3->setExpanding(false);
//$con1->setExpanding(true);
/*$con1->setClippingObjects($con2);
$con2->setClippingObjects($con3);*/

$con3->setZ(400);
$con2->setZ(300);
$con1->setZ(100);
//$con1->hidden = true;

$con1->setBorder(2);
$con2->setBorder(2);
$con2->setBorder(3);

$con2->linkTo(&$con3);
$con1->linkTo(&$con2);
$con1->setText($text);

$con1->setPadding(2);
$con2->setPadding(2);
$con3->setPadding(2);

$_pdfDom_PDF->setFont("Arial");

$root->id = "root";

$root->preRender();

$root->render();

foreach ($pages as $page)
{
	$page->render();	
}



$_pdfDom_PDF->setDisplayMode("fullpage");
$_pdfDom_PDF->output();

//echo $con3->_text;

?>
Return current item: pdfDOM