Location: PHPKode > scripts > PDFTemplate > pdftemplate/PDFTemplate.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
	<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=iso-8859-1">
	<TITLE>PDFTemplate Documentation</TITLE>
	<META NAME="GENERATOR" CONTENT="StarOffice/5.2 (Linux)">
	<META NAME="AUTHOR" CONTENT=" ">
	<META NAME="CREATED" CONTENT="20010418;17044500">
	<META NAME="CHANGEDBY" CONTENT=" ">
	<META NAME="CHANGED" CONTENT="20010420;15545000">
</HEAD>
<body bgcolor="white">
<H1>PDF Template Documentation</H1>
<H2>1) Usage</H2>
<pre>
$mypdf = new PDFTemplate("pdf.xml",$debug);
$mypdf-&gt;Assign("NAME","Jon Doe");
$mypdf-&gt;Assign("USERNAME","jdoe");
$mypdf-&gt;Assign("PASSWORD","54321");
$mypdf-&gt;Parse();

$mypdf-&gt;Close();
</pre>
<h3>class initialization</h3>
<p>The parameters are the name of the file and an optional debug flag.  setting debug to 1 will result in a text out of the PDF renderer parsing.  Use this to debug erroneous XML files.</P>
<h3>Assign</h3>
Assigns the variable in parameter one to the value of parameter two.
<h3>Parse</h3>
<p>
The Parse command parses the entire file and renders each page to the client while substituting the variables.
</p>
<h3>Close</h3>
<p>
the close command closes the PDF document and finishes sending the document to the client.
</p>
<H2>2) Fonts</H2>
<P>Helvetica</P>
<P>Courier</P>
<P>Times-Roman</P>
<H2>3) Elements/Input file format.</H2>
<P>Begins with a standard XML tag line.</P>
<pre>
&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;
</pre>
<P>Then the opening PDF tag.</P>
<pre>&lt;pdf xmlns:pdf="pdf.dtd"&gt;</pre>
<P>The file must end with a &lt;/PDF&gt;</P>
<H3>PAGE</H3>
<p>Specifies a page break.  All tags contained within the page tag will appear on the same page. (as long as it all fits)</p>
<P>Attributes:</P>
<P>MARGIN:  Margin size in inches.  Default 0.5 inches</P>
<P>WIDTH: Page width in inches.  Default 8.5 inches.</P>
<P>HEIGHT: Page height in inches.  Default 11 inches.</P>
<H3>PARA</H3>
<P>A paragraph marking.  Text will be word wrapped and a line feed
after the last line of text. All text must be in a paragraph.</P>
<P>Attributes:</P>
<P>INDENT: set to 1 to indent the first line of the paragraph by 1
half inch.</P>
<P>TAB: indent the entire paragraph by x inches.</P>
<P>ALIGN: alignment. Left,center,right,justified.</P>
<P>NOBREAK: set to 1 to prevent the trailing line feed.</P>
<H3>BOLD</H3>
<P>Changes the font to bold</P>
<H3>ITALIC</H3>
<P>Changes the font to italics</P>
<H3>FONT</H3>
<P>Changes the current font.</P>
<P>Attributes:</P>
<P>FONT: the font to change to.</P>
<P>SIZE: the point size.</P>
<H3>TAB</H3>
<P>Set the TAB attribute to the next point where text is printed to
this offset from left edge of page (ignoring margin.)</P>
<P>This tag does not have a closing TAG. use it like &lt;TAB tab="4"/&gt;</P>
<H3>BR</H3>
<P>Forces a hard break with no linefeed.</P>
<P>This tag does not have a closing TAG.  use it like &lt;BR/&gt;</P>
</BODY>
</HTML>
Return current item: PDFTemplate