Software: Apache. PHP/5.5.15 uname -a: Windows NT SVR-DMZ 6.1 build 7600 (Windows Server 2008 R2 Enterprise Edition) i586 SYSTEM Safe-mode: OFF (not secure) C:\dmz\php\pear\fpdf\tutorial\ drwxrwxrwx |
Viewing file: tuto1.htm (4.71 KB) -rw-rw-rw- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) | Minimal exampleLet's start with the classic example:
L ), other page sizes (such as Letter and
Legal ) and units (pt , cm , in ).
There's no page at the moment, so we have to add one with AddPage(). The origin is at the upper-left corner and the current position is by default set at 1 cm from the borders; the margins can be changed with SetMargins(). Before we can print text, it's mandatory to select a font with SetFont(), otherwise the document would be invalid. We choose Arial bold 16:
We can now print a cell with Cell(). A cell is a rectangular area, possibly framed, which contains a line of text. It is output at the current position. We specify its dimensions, its text (centered or aligned), if borders should be drawn, and where the current position moves after it (to the right, below or to the beginning of the next line). To add a frame, we would do this:
Finally, the document is closed and sent to the browser with Output(). We could have saved it to a file by passing the desired file name. Caution: in case when the PDF is sent to the browser, nothing else must be output by the script, neither before nor after (no HTML, not even a space or a carriage return). If you send something before, you will get the error message: "Some data has already been output, can't send PDF file". If you send something after, the document might not display. |
:: Command execute :: | |
--[ c99shell v. 1.0 pre-release build #13 powered by Captain Crunch Security Team | http://ccteam.ru | Generation time: 0.0312 ]-- |