$requete = "SELECT id_adh, nom_adh, prenom_adh, adresse_adh,\n\t\t\t\t\t\t\t\t\ttitre_adh, cp_adh, ville_adh, pays_adh, adresse2_adh\n\t\t\t\t\t\t\t\t\tFROM " . PREFIX_DB . "adherents\n\t\t\t \t\t\t\tWHERE "; $where_clause = ""; while (list($key, $value) = each($mailing_adh)) { if ($where_clause != "") { $where_clause .= " OR "; } $where_clause .= "id_adh=" . $DB->qstr($value, get_magic_quotes_gpc()); } $requete .= $where_clause . " ORDER by nom_adh, prenom_adh;"; // echo $requete; $resultat =& $DB->Execute($requete); $pdf = new pdffile(); $pdf->set_default('margin', 0); $param["height"] = PREF_ETIQ_CORPS; $firstpage = $pdf->new_page("a4"); $param["fillcolor"] = $pdf->get_color('#000000'); $param["align"] = "center"; $param["width"] = 1; $param["color"] = $pdf->get_color('#DDDDDD'); if ($resultat->EOF) { die; } $yorigin = 842 - round(PREF_ETIQ_MARGES_V * 2.835); $xorigin = round(PREF_ETIQ_MARGES_H * 2.835); $col = 1; $row = 1; $nb_etiq = 0; $concatname = ""; while (!$resultat->EOF) { $nom_adh_ext = ""; switch ($resultat->fields[4]) {
but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. $Id: example-packer.php 221 2005-06-25 01:22:54Z deelight $ */ require '../phppdflib.class.php'; $pdf = new pdffile(); $pdf->enable('packer'); $page = $pdf->packer->new_page(); $pdf->set_default('smode', 'fill'); $pdf->set_default('fillcolor', $pdf->get_color('red')); $space = new field(100, 200, 100, 200); $pdf->packer->allocate($space); $pdf->draw_rectangle(200, 100, 100, 200, $page); $pdf->set_default('fillcolor', $pdf->get_color('blue')); $space = new field(150, 300, 150, 400); $pdf->packer->allocate($space); $pdf->draw_rectangle(400, 150, 150, 300, $page); $pdf->set_default('fillcolor', $pdf->get_color('green')); $space = new field(400, 600, 600, 800); $pdf->packer->allocate($space); $pdf->draw_rectangle(800, 400, 600, 600, $page); $pdf->set_default('fillcolor', $pdf->get_color('black')); $pdf->set_default('height', 10); $text = implode('', file('text.txt')); $pdf->packer->fill_text($text);
* The following keywords are recognized: * "letter", "legal", "executive", "tabloid", * "a3", "a4", "a5" * or the actual size in the format: * "[width]x[height][in|cm]" * See examples at the end of this file. */ $firstpage = $pdf->new_page("letter"); /* Using the ->draw_text() method: * We're going to set up the text parameters, * first the height */ $param["height"] = 12; /* Now we set the color to red */ $param["fillcolor"] = $pdf->get_color('#ff3333'); /* Set the font. Possible values are: Courier Courier-Bold Courier-Oblique Courier-BoldOblique Helvetica Helvetica-Bold Helvetica-Oblique Helvetica-BoldOblique Times-Roman Times-Bold Times-Italic Times-BoldItalic Symbol ZapfDingbats
$pdf = new pdffile(); $pdf->set_default('margin', 0); $data = ""; for ($i = 100; $i != 255; $i++) { $data .= chr($i) . "ÿ" . chr($i); } $image = $pdf->image_raw_embed($data, "/DeviceRGB", 8, 1, 154); $firstpage = $pdf->new_page("letter"); $p['scale']["x"] = 612 / 154; $p['scale']["y"] = 792; $pdf->image_place($image, 0, 0, $firstpage, $p); $p['scale']["x"] = 300 / 154; $p['scale']["y"] = 150; $p['rotation'] = 270; $pdf->image_place($image, 690, 400, $firstpage, $p); $p['fillcolor'] = $pdf->get_color('white'); $p['mode'] = 'fill'; $pdf->draw_rectangle(792, 0, 792 - 75, 612, $firstpage, $p); $param["height"] = 32; $param["font"] = "Times-Bold"; $param["mode"] = "fill+stroke"; $param['fillcolor']["red"] = 0; $param['fillcolor']["blue"] = 0; $param['fillcolor']["green"] = 0.5; $param['strokecolor']["red"] = 0; $param['strokecolor']["blue"] = 0; $param['strokecolor']["green"] = 0; $pdf->draw_text(70, 680, "Dynamically generated PDF files", $firstpage, $param); $text = <<<EOT Dynamically generated PDF files can enhance your website by making it more interesting and useful to your target audience. Any time you want to deliver a print-ready document across the Internet, the PDF format is the correct delivery medium. Whether it be downloadable or emailed, a document in PDF format is virtually guaranteed to display and print properly on any computer. HTML can't promise this, and neither can proprietary formats, such as Word or Wordperfect documents.