28 require_once(
'tcpdf_include.php');
64 $this->
SetFont(
'helvetica',
'', 14);
66 $this->
Cell(180, 6,
'Chapter '.$num.
' : '.
$title, 0, 1,
'', 1);
79 $content = file_get_contents(
$file,
false);
86 $this->
writeHTML($content,
true,
false,
true,
false,
'J');
89 $this->
Write(0, $content,
'', 0,
'J',
true, 0,
false,
true, 0);
103 $pdf->SetAuthor(
'Nicola Asuni');
104 $pdf->SetTitle(
'TCPDF Example 010');
105 $pdf->SetSubject(
'TCPDF Tutorial');
106 $pdf->SetKeywords(
'TCPDF, PDF, example, test, guide');
130 if (@file_exists(dirname(__FILE__).
'/lang/eng.php')) {
131 require_once(dirname(__FILE__).
'/lang/eng.php');
132 $pdf->setLanguageArray(
$l);
138 $pdf->PrintChapter(1,
'LOREM IPSUM [TEXT]',
'data/chapter_demo_1.txt',
false);
141 $pdf->PrintChapter(2,
'LOREM IPSUM [HTML]',
'data/chapter_demo_2.txt',
true);
146 $pdf->Output(
'example_010.pdf',
'I');
const PDF_MARGIN_BOTTOM
Bottom margin.
const PDF_MARGIN_LEFT
Left margin.
const PDF_MARGIN_HEADER
Header margin.
SetFillColor($col1=0, $col2=-1, $col3=-1, $col4=-1, $ret=false, $name='')
Defines the color used for all filling operations (filled rectangles and cell backgrounds).
SetTextColor($col1=0, $col2=-1, $col3=-1, $col4=-1, $ret=false, $name='')
Defines the color used for text.
selectColumn($col='')
Set position at a given column.
const PDF_HEADER_STRING
Header description string.
const PDF_FONT_SIZE_MAIN
Default main font size.
const PDF_FONT_SIZE_DATA
Default data font size.
writeHTML($html, $ln=true, $fill=false, $reseth=false, $cell=false, $align='')
Allows to preserve some HTML formatting (limited support).
const PDF_FONT_NAME_MAIN
Default main font name.
Ln($h='', $cell=false)
Performs a line break.
PrintChapter($num, $title, $file, $mode=false)
Print chapter.
ChapterTitle($num, $title)
Set chapter title.
PHP class for generating PDF documents without requiring external extensions.
const PDF_HEADER_LOGO_WIDTH
Header logo image width in user units.
SetFont($family, $style='', $size=null, $fontfile='', $subset='default', $out=true)
Sets the font used to print character strings.
const PDF_HEADER_LOGO
Deafult image logo used be the default Header() method.
Write($h, $txt, $link='', $fill=false, $align='', $ln=false, $stretch=0, $firstline=false, $firstblock=false, $maxh=0, $wadj=0, $margin='')
This method prints text from the current position.
const PDF_UNIT
Document unit of measure [pt=point, mm=millimeter, cm=centimeter, in=inch].
const PDF_IMAGE_SCALE_RATIO
Ratio used to adjust the conversion of pixels to user units.
Cell($w, $h=0, $txt='', $border=0, $ln=0, $align='', $fill=false, $link='', $stretch=0, $ignore_min_height=false, $calign='T', $valign='M')
Prints a cell (rectangular area) with optional borders, background color and character string...
AddPage($orientation='', $format='', $keepmargins=false, $tocpage=false)
Adds a new page to the document.
setEqualColumns($numcols=0, $width=0, $y='')
Set multiple columns of the same size.
const PDF_PAGE_ORIENTATION
Page orientation (P=portrait, L=landscape).
const PDF_MARGIN_RIGHT
Right margin.
ChapterBody($file, $mode=false)
Print chapter body.
resetColumns()
Remove columns and reset page margins.
const PDF_HEADER_TITLE
Header title.
Extend TCPDF to work with multiple columns.
const PDF_FONT_NAME_DATA
Default data font name.
const PDF_CREATOR
Document creator.
const PDF_PAGE_FORMAT
Page format.
const PDF_FONT_MONOSPACED
Default monospaced font name.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
const PDF_MARGIN_TOP
Top margin.
const PDF_MARGIN_FOOTER
Footer margin.