function PDF_NewsletterLabels($sLabelFormat) { parent::PDF_Label($sLabelFormat); $this->Open(); }
function list2labels($doc_name = 'labels.pdf', $label_type = '5160', $include_title = false, $include_company = false) { $labels = new PDF_Label($label_type); $labels->Open(); $entry_count = 0; $dataset = $udm->getData(); foreach ($dataset as $currentrow) { $new_entry = ''; $new_entry = $currentrow['Name'] . "\n"; if ($currentrow['occupation'] > '' && $include_title) { $new_entry .= $currentrow['occupation'] . "\n"; } if ($currentrow['Company'] > '' && $include_company) { $new_entry .= $currentrow['Company'] . "\n"; } $new_entry .= $currentrow['Street'] . "\n"; if ($currentrow['Street_2'] > '') { $new_entry .= $currentrow['Street_2'] . "\n"; } if ($currentrow['Street_2'] > '') { $new_entry .= $currentrow['Street_3'] . "\n"; } $new_entry .= $currentrow['City'] . ", "; $new_entry .= $currentrow['State'] . " "; $new_entry .= $currentrow['Zip']; if ($currentrow['Country'] > '' && $currentrow['Country'] != "USA" && $currentrow['Country'] != "U.S.A." && substr($currentrow['Country'], 0, 13) != "United States") { $new_entry .= "\n" . $currentrow['Country']; } if ($currentrow['Street'] != '' && $currentrow['Zip'] != '') { $entry_count++; $myzip = $labels->ParseZipCode($currentrow['Zip']); if ($myzip != "") { $validzips++; } $labels->Add_PDF_Label($new_entry, $myzip); } } $new_entry = $validzips . " labels printed with bar codes\n{$entry_count} total labels printed"; $labels->Add_PDF_Label($new_entry); $labels->Output($doc_name, 'I'); }
$login = $tab_users_fichier['login'][$i_fichier]; $password = $tab_users_fichier['mdp'][$i_fichier]; DB_STRUCTURE_ADMINISTRATEUR::DB_modifier_user($id_base, array(':login' => $login, ':password' => crypter_mdp($password))); $lignes_mod .= '<tr class="new"><td>' . html($tab_users_fichier['nom'][$i_fichier] . ' ' . $tab_users_fichier['prenom'][$i_fichier] . ' (' . $tab_users_base['info'][$id_base] . ')') . '</td><td class="b">Utilisateur : ' . html($login) . '</td><td class="b">Mot de passe : ' . html($password) . '</td></tr>' . NL; $fcontenu_pdf_tab[] = $tab_users_base['info'][$id_base] . "\r\n" . $tab_users_base['nom'][$id_base] . ' ' . $tab_users_base['prenom'][$id_base] . "\r\n" . 'Utilisateur : ' . $login . "\r\n" . 'Mot de passe : ' . $password; $tab_users_base['login'][$id_base] = $login; // Prendre en compte cette modif de login dans les comparaisons futures } } } } // On archive les nouveaux identifiants dans un fichier pdf (classe fpdf + script étiquettes) echo '<ul class="puce">' . NL; if (count($fcontenu_pdf_tab)) { $fnom = 'identifiants_' . $_SESSION['BASE'] . '_' . fabriquer_fin_nom_fichier__date_et_alea(); $pdf = new PDF_Label(array('paper-size' => 'A4', 'metric' => 'mm', 'marginLeft' => 5, 'marginTop' => 5, 'NX' => 3, 'NY' => 8, 'SpaceX' => 7, 'SpaceY' => 5, 'width' => 60, 'height' => 30, 'font-size' => 11)); $pdf->AddFont('Arial', '', 'arial.php'); $pdf->SetFont('Arial'); // Permet de mieux distinguer les "l 1" etc. que la police Times ou Courrier $pdf->AddPage(); $pdf->SetFillColor(245, 245, 245); $pdf->SetDrawColor(145, 145, 145); sort($fcontenu_pdf_tab); foreach ($fcontenu_pdf_tab as $text) { $pdf->Add_Label(To::pdf($text)); } FileSystem::ecrire_sortie_PDF(CHEMIN_DOSSIER_LOGINPASS . $fnom . '.pdf', $pdf); echo '<li><a target="_blank" href="' . URL_DIR_LOGINPASS . $fnom . '.pdf"><span class="file file_pdf">Archiver / Imprimer les identifiants modifiés (étiquettes <em>pdf</em>).</span></a></li>' . NL; echo '<li><label class="alerte">Les mots de passe, cryptés, ne seront plus accessibles ultérieurement !</label></li>' . NL; } // On affiche le bilan
} } // end of function GenerateLabels // Main body of PHP file begins here // Standard format $startcol = FilterInput($_GET["startcol"], 'int'); if ($startcol < 1) { $startcol = 1; } $startrow = FilterInput($_GET["startrow"], 'int'); if ($startrow < 1) { $startrow = 1; } $sLabelType = FilterInput($_GET["labeltype"], 'char', 8); setcookie("labeltype", $sLabelType, time() + 60 * 60 * 24 * 90, "/"); $pdf = new PDF_Label($sLabelType, $startcol, $startrow); $pdf->Open(); $sFontInfo = FontFromName($_GET["labelfont"]); setcookie("labelfont", $_GET["labelfont"], time() + 60 * 60 * 24 * 90, "/"); $sFontSize = $_GET["labelfontsize"]; setcookie("labelfontsize", $sFontSize, time() + 60 * 60 * 24 * 90, "/"); $pdf->SetFont($sFontInfo[0], $sFontInfo[1]); if ($sFontSize == "default") { $sFontSize = "10"; } $pdf->Set_Char_Size($sFontSize); // Manually add a new page if we're using offsets if ($startcol > 1 || $startrow > 1) { $pdf->AddPage(); } $mode = $_GET["groupbymode"];
<?php define('FPDF_FONTPATH', 'fpdf_font/'); require_once 'PDF_Label.php'; /*------------------------------------------------ To create the object, 2 possibilities: either pass a custom format via an array or use a built-in AVERY name ------------------------------------------------*/ // Example of custom format /* $pdf = new PDF_Label(array('paper-size'=>'A4', 'metric'=>'mm', 'marginLeft'=>1, 'marginTop'=>1, 'NX'=>2, 'NY'=>7, 'SpaceX'=>0, 'SpaceY'=>0, 'width'=>99, 'height'=>38, 'font-size'=>14)); */ // Standard format $pdf = new PDF_Label('L7163'); $pdf->AddPage(); // Print labels for ($i = 1; $i <= 20; $i++) { $text = sprintf("%s\n%s\n%s\n%s %s, %s", "Laurent {$i}", 'Immeuble Toto', 'av. Fragonard', '06000', 'NICE', 'FRANCE'); $pdf->Add_Label($text, 0, "images/eoalogo250.jpg", 10); } $pdf->Output(); ?>
function update_users_addresses() { $certificates = array(); $query = "select * from mdl_certificates order by userid desc"; $result = $this->db->query($query); while ($row = $result->fetch(PDO::FETCH_ASSOC)) { $certificate = new stdClass(); foreach ($row as $key => $value) { $certificate->{$key} = $value; } $certificates[] = $certificate; } $pdf2 = new PDF_Label('L7163'); /* echo "<pre>"; print_r($certificates); echo "</pre><br>"; */ $i = 0; echo "Total Certificates found: " . count($certificates); $pdf = new mPDF('utf-8', 'A4-P'); foreach ($certificates as $certificate) { $user_address_block = $this->get_user_address_block($certificate->userid); echo "<br>-----------------------------------<br>"; echo "User ID: " . $certificate->userid . "<br>"; echo $user_address_block; $pdf2 = new PDF_Label('L7163'); $pdf2->AddPage(); $user_address = $this->get_user_address_data($certificate->userid); $text = sprintf("%s\n%s\n%s\n%s\n%s", "{$user_address->firstname} {$user_address->lastname}", "Phone: {$user_address->phone1}", "Email: {$user_address->email}", "{$user_address->address}", "{$user_address->city}, {$user_address->state}, {$user_address->zip}"); //$text = sprintf("%s\n%s\n%s\n%s", $user_address_block); $pdf2->Add_Label($text); $dir_path = $this->cert_path . "/{$certificate->userid}"; if (!is_dir($dir_path)) { if (!mkdir($dir_path)) { die('Could not write to disk'); } // end if !mkdir($dir_path) } // end if !is_dir($dir_path) $path = $dir_path . "/label.pdf"; $pdf2->Output($path, 'F'); $i++; /* * $pdf->WriteHTML($user_address_block); $dir_path = $this->cert_path . "/$certificate->userid"; if (!is_dir($dir_path)) { if (!mkdir($dir_path)) { die('Could not write to disk'); } // end if !mkdir($dir_path) } // end if !is_dir($dir_path) $path = $dir_path . "/label.pdf"; echo "Label location: ".$path."<br>"; $pdf->Output($path, 'F'); $pdf->Close(); echo "<br>Address label for User ($certificate->userid) was created"; echo "<br>-----------------------------------<br>"; $i++; } // end foreach * */ } // end foreach echo "<br>Total Labels created: " . $i . "<br>"; }
break; case 'oracle': case 'oci8': // Modificado SGD 18-Septiembre-2007 // Modificado SGD 18-Septiembre-2007 case 'postgres': $tmp_var = "a.RADI_NUME_SAL"; break; } // Modificado SGD 18-Septiembre-2007 $query = "SELECT \r\n\t\ta.SGD_FENV_CODIGO,\r\n\t\t'', " . $db->conn->substr . "({$tmp_var},5,10) AS REGISTRO,\r\n\t\ta.SGD_RENV_NOMBRE AS DESTINATARIO,\r\n\t\ta.SGD_RENV_DESTINO AS DESTINO,\r\n\t\ta.SGD_RENV_PESO AS PESO,\r\n\t\ta.SGD_RENV_VALOR AS VALOR_PORTE,\r\n\t\ta.SGD_RENV_CERTIFICADO AS CERTIFICADO,\r\n\t\t'' AS VALOR_ASEGURADO,\r\n\t\t'' AS TASA_DE_SEGURO,\r\n\t\t'' AS VALOR_REEMBOLSABLE,\r\n\t\t'' AS AVISO_DE_LLEGADA,\r\n\t\t'' AS SERVICIOS_ESPECIALES,\r\n\t\ta.SGD_RENV_VALOR AS VALOR_TOTAL,\r\n\t\ta.SGD_RENV_DIR AS DIRECCION,\r\n\t\ta.SGD_RENV_TEL AS TELEFONO,\r\n\t\ta.SGD_RENV_MAIL AS MAIL,\r\n\t\ta.SGD_RENV_DEPTO AS DEPARTAMENTO,\r\n\t\ta.SGD_RENV_DESTINO AS MUNICIPIO\r\n\t\tFROM SGD_RENV_REGENVIO a\r\n\t\tWHERE SGD_FENV_CODIGO = 105 AND a.SGD_RENV_VALOR != 0 AND {$where_fecha}"; $rs = $db->query($query); unset($tmp_var); $i = 0; //$pdf = new PDF_Label('8600',1,4); $pdf = new PDF_Label(array('name' => 'perso1', 'paper-size' => 'letter', 'marginLeft' => 2, 'marginTop' => 0, 'NX' => 1, 'NY' => 4, 'SpaceX' => 0, 'SpaceY' => 0.6, 'width' => 210, 'height' => 70, 'metric' => 'mm', 'font-size' => 10), 1, 1); $pdf->Open(); //$pdf->AddPage(); // while($result1=ora_fetch_into($cursor,$row, ORA_FETCHINTO_NULLS|ORA_FETCHINTO_ASSOC)) $fecha_adm = date("Y m d"); $oficina_org = "Morato"; $cad = ' '; $nombre_r = str_pad($db->entidad_largo, 63, $cad) . str_pad($db->entidad_tel, 8, ' ', STR_PAD_RIGHT); $direccion_r = str_pad($db->entidad_dir, 63, $cad) . " BOGOTA "; while (!$rs->EOF) { $i++; $radicado_sal = $rs->fields["REGISTRO"]; $nombre_d = $rs->fields["DESTINATARIO"]; $telefono_d = $rs->fields["TELEFONO"]; $direccion_d = $rs->fields["DIRECCION"]; $ciudad_d = $rs->fields["DESTINO"];
function create_label($courseid, $userid) { $user_address = $this->get_user_address_data($userid); $pdf = new PDF_Label('L7163'); $pdf->AddPage(); $text = sprintf("%s\n%s\n%s\n%s", "{$user_address->firstname} {$user_address->lastname}", "{$user_address->address}", "{$user_address->state}/" . $user_address->city . "", "{$user_address->zip}"); $pdf->Add_Label($text); $dir_path = $this->cert_path . "/{$userid}"; if (!is_dir($dir_path)) { if (!mkdir($dir_path)) { die('Could not write to disk'); } // end if !mkdir($dir_path) } // end if !is_dir($dir_path) $path = $dir_path . "/label.pdf"; $pdf->Output($path, 'F'); }
function PDF_NameTags($sLabelFormat) { parent::PDF_Label($sLabelFormat); $this->Open(); }
$login = $tab_users_fichier['login'][$i_fichier]; $password = $tab_users_fichier['mdp'][$i_fichier]; DB_STRUCTURE_ADMINISTRATEUR::DB_modifier_user( $id_base , array(':login'=>$login,':password'=>crypter_mdp($password)) ); $lignes_mod .= '<tr class="new"><td>'.html($tab_users_fichier['nom'][$i_fichier].' '.$tab_users_fichier['prenom'][$i_fichier].' ('.$tab_users_base['info'][$id_base].')').'</td><td class="b">Utilisateur : '.html($login).'</td><td class="b">Mot de passe : '.html($password).'</td></tr>'.NL; $fcontenu_pdf_tab[] = $tab_users_base['info'][$id_base]."\r\n".$tab_users_base['nom'][$id_base].' '.$tab_users_base['prenom'][$id_base]."\r\n".'Utilisateur : '.$login."\r\n".'Mot de passe : '.$password; $tab_users_base['login'][$id_base] = $login; // Prendre en compte cette modif de login dans les comparaisons futures } } } } // On archive les nouveaux identifiants dans un fichier pdf (classe fpdf + script étiquettes) echo'<ul class="puce">'.NL; if(count($fcontenu_pdf_tab)) { $fnom = 'identifiants_'.$_SESSION['BASE'].'_'.fabriquer_fin_nom_fichier__date_et_alea(); $pdf = new PDF_Label(array('paper-size'=>'A4', 'metric'=>'mm', 'marginLeft'=>5, 'marginTop'=>5, 'NX'=>3, 'NY'=>8, 'SpaceX'=>7, 'SpaceY'=>5, 'width'=>60, 'height'=>30, 'font-size'=>11)); $pdf -> AddFont('Arial','' ,'arial.php'); $pdf -> SetFont('Arial'); // Permet de mieux distinguer les "l 1" etc. que la police Times ou Courrier $pdf -> AddPage(); $pdf -> SetFillColor(245,245,245); $pdf -> SetDrawColor(145,145,145); sort($fcontenu_pdf_tab); foreach($fcontenu_pdf_tab as $text) { $pdf -> Add_Label(To::pdf($text)); } FileSystem::ecrire_sortie_PDF( CHEMIN_DOSSIER_LOGINPASS.$fnom.'.pdf' , $pdf ); echo'<li><a target="_blank" href="'.URL_DIR_LOGINPASS.$fnom.'.pdf"><span class="file file_pdf">Archiver / Imprimer les identifiants modifiés (étiquettes <em>pdf</em>).</span></a></li>'.NL; echo'<li><label class="alerte">Les mots de passe, cryptés, ne seront plus accessibles ultérieurement !</label></li>'.NL; } // On affiche le bilan
<?php define('FPDF_FONTPATH', 'font/'); require_once 'PDF_Label.php'; /*------------------------------------------------- To create the object, 2 possibilities: either pass a custom format via an array or use a built-in AVERY name -------------------------------------------------*/ // Example of custom format; we start at the second column //$pdf = new PDF_Label(array('name'=>'perso1', 'paper-size'=>'A4', 'marginLeft'=>1, 'marginTop'=>1, 'NX'=>2, 'NY'=>7, 'SpaceX'=>0, 'SpaceY'=>0, 'width'=>99.1, 'height'=>38.1, 'metric'=>'mm', 'font-size'=>14), 1, 2); // Standard format $pdf = new PDF_Label('L7163', 'mm', 1, 2); $pdf->Open(); $pdf->AddPage(); // Print labels for ($i = 1; $i <= 40; $i++) { $pdf->Add_PDF_Label(sprintf("%s\n%s\n%s\n%s, %s, %s", "Laurent {$i}", 'Immeuble Titi', 'av. fragonard', '06000', 'NICE', 'FRANCE')); } $pdf->Output(); ?>
the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, 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, see <http://www.gnu.org/licenses/>. */ require_once './includes/config.php'; define('FPDF_FONTPATH', './includes/fpdf/font/'); require_once './includes/fpdf/fpdf.php'; require_once './includes/fpdf/label/PDF_Label.php'; $pdf = new PDF_Label('5160'); $pdf->Open(); $pdf->AddPage(); $pdf->Set_Font_Size(10); // Print labels... $labelQ = "SELECT d.cardNo, count(o.cardNo), \n\t\tCASE WHEN SUBSTR(address,-1) = '\n' THEN SUBSTR(address, 1, LENGTH(address)-1) ELSE address END AS address, \n\t\tcity, state, \n\t\tCASE WHEN LENGTH(zip)>5 THEN CONCAT(SUBSTR(zip,1,5), '-', SUBSTR(zip,5,4)) ELSE zip END AS zip \n\tFROM details AS d\n\tINNER JOIN owners AS o\n\tON d.cardNo = o.cardNo\n\tWHERE address IS NOT NULL AND address <> '' AND address <> 'n/a'\n\t\tAND city IS NOT NULL AND city <> ''\n\t\tAND state IS NOT NULL AND state <> ''\n\t\tAND zip IS NOT NULL AND zip <> '' AND zip <> 0\n\t\tAND d.noMail = false\n\t\tAND o.memType IN (1, 2, 7)\n\tGROUP BY cardNo\n\tORDER BY zip ASC"; $labelR = mysqli_query($DBS['comet'], $labelQ); if (!$labelR) { printf('Error: %s, Query: %s', mysqli_error($DBS['comet']), $labelQ); exit; } else { while (list($cardNo, $count, $address, $city, $state, $zip) = mysqli_fetch_row($labelR)) { $detailQ = "SELECT CONCAT(firstName, ' ', lastName) AS name FROM owners WHERE cardNo = {$cardNo} AND personNum = 1"; $detailR = mysqli_query($DBS['comet'], $detailQ); if (!$detailR) { printf('Error: %s, Query: %s', mysqli_error($DBS['comet']), $detailQ);
function PDF_Label_PostNet($format, $unit = null, $posX = null, $posY = null) { parent::PDF_Label($format, $unit, $posX, $posY); }
require_once 'PDF_Label.php'; set_time_limit(15); //create the list of previously selected ids to get info from db $ids = ""; for ($i = 0; $i < count($selitems); $i++) { $ids .= "'" . $selitems[$i] . "'"; if ($i < count($selitems) - 1) { $ids .= ", "; } } //$sql="SELECT items.id,model,sn,sn3,itemtypeid,dnsname,ipv4,ipv6,label, agents.title as agtitle FROM items,agents ". // " WHERE agents.id=items.manufacturerid AND items.id in ($ids) order by itemtypeid, agtitle, model,sn,sn2,sn3"; $sql = "SELECT items.id,model,sn,sn3,itemtypeid,dnsname,ipv4,ipv6,label, agents.title as agtitle FROM items,agents " . " WHERE agents.id=items.manufacturerid AND items.id in ({$ids}) order by items.id"; $sth = db_execute($dbh, $sql); $idx = 0; $pdf = new PDF_Label(array('paper-size' => "{$labelpapersize}", 'metric' => 'mm', 'marginLeft' => $lmargin, 'marginTop' => $tmargin, 'NX' => $cols, 'NY' => $rows, 'SpaceX' => $hpitch - $lwidth, 'SpaceY' => $vpitch - $lheight, 'width' => $lwidth, 'height' => $lheight, 'font-size' => $fontsize)); $pdf->AddPage(); $pdf->SetAuthor('ITDB Asset Management'); $pdf->SetTitle('Items'); $pdf->setFontSubsetting(true); $pdf->setPrintHeader(false); $pdf->setPrintFooter(false); /* skip specified labels, to avoid printing on missing label positions on reused papers*/ for ($skipno = 0; $skipno < $labelskip; $skipno++) { $pdf->Add_Label("", "", 0, 255, "", 0, 0, 6, 6); } $pages = 0; for ($row = 1; $row <= $rows; $row++) { if ($pages > 30) { break; }
function print_certificate_labels($courseid, $students) { $students_arr = explode(',', $students); if (count($students_arr) > 0) { $pdf = new PDF_Label('L7163'); $pdf->AddPage(); if (!is_dir($this->labels_path)) { if (!mkdir($dir_path)) { die('Could not write to disk'); } // end if !mkdir($dir_path) } // end if !is_dir($dir_path) foreach ($students_arr as $userid) { $user_address = $this->get_user_address_data($userid); $text = sprintf("%s\n%s\n%s %s %s", "{$user_address->firstname} {$user_address->lastname}", "{$user_address->address}", "{$user_address->city} ,", "{$user_address->state}", "{$user_address->zip}"); $pdf->Add_Label($text); } // end foreach $now = time(); $path = $this->labels_path . "/" . $now . "_merged.pdf"; $pdf->Output($path, 'F'); } // end if count($students_arr)>0 return $now . "_merged.pdf"; }
function PDF_ConfirmLabels($sLabelFormat) { parent::PDF_Label($sLabelFormat); $this->Open(); }
$label = getOneLable($etikett); if ($_POST["print"]) { $platzhalter = array("ANREDE" => "anrede", "TITEL" => "titel", "TEXT" => "freitext", "NAME" => "name", "NAME1" => "name1", "NAME2" => "name2", "STRASSE" => "strasse", "PLZ" => "plz", "ORT" => "ort", "LAND" => "land", "KONTAKT" => "kontakt", "FIRMA" => "firma", "ID" => "id", "KDNR" => "kdnr", "EMAIL" => "email", "TEL" => "telefon", "FAX" => "fax"); foreach ($data as $key => $val) { $key = strtoupper($key); if (substr($key, 0, 8) == "VC_CVAR_") { $platzhalter[$key] = $key; ${$key} = $val; } } $lableformat = array("paper-size" => $label["papersize"], 'name' => $label["name"], 'metric' => $label["metric"], 'marginLeft' => $label["marginleft"], 'marginTop' => $label["margintop"], 'NX' => $label["nx"], 'NY' => $label["ny"], 'SpaceX' => $label["spacex"], 'SpaceY' => $label["spacey"], 'width' => $label["width"], 'height' => $label["height"], 'font-size' => 6); require_once 'inc/PDF_Label.php'; $tmp = explode(":", $_POST["xy"]); $SX = substr($tmp[0], 1); $SY = substr($tmp[1], 1); $pdf = new PDF_Label($lableformat, $label["metric"], $SX, $SY); $pdf->Open(); unset($tmp); if ($SX != 1 or $SY != 1) { $pdf->AddPage(); } foreach ($label["Text"] as $row) { preg_match_all("/%([A-Z0-9_]+)%/U", $row["zeile"], $ph, PREG_PATTERN_ORDER); if ($ph) { $first = true; $oder = strpos($row["zeile"], "|"); $ph = array_slice($ph, 1); if ($ph[0]) { foreach ($ph as $x) { foreach ($x as $u) { $y = $platzhalter[$u];
$filename .= ".pdf"; include DB . 'output_labels_awards.db.php'; ob_end_clean(); $pdf->Output($filename, 'D'); } } // end if ((isset($_SESSION['loginUsername'])) && ($_SESSION['userLevel'] <= 1)) // -------------------------------------------------------- // The following is the only label output that non-admins // can access. // -------------------------------------------------------- if ($go == "participants" && $action == "judging_labels" && $id != "default") { if ($psort == "3422") { $pdf = new PDF_Label('3422'); } else { $pdf = new PDF_Label('5160'); } $pdf->AddPage(); $pdf->SetFont('Arial', '', 8); $first_name = strtr($row_brewer['brewerFirstName'], $html_remove); $first_name = ucfirst(strtolower($first_name)); $last_name = strtr($row_brewer['brewerLastName'], $html_remove); $last_name = ucfirst(strtolower($last_name)); //echo $query_brewer; $filename .= $first_name . "_" . $last_name . "_Judge_Scoresheet_Labels"; if ($psort == "3422") { $filename .= "_Avery3422"; } else { $filename .= "_Avery5160"; } $filename .= ".pdf";
$sAddress .= "\n" . $sAddress2; } if (!$bOnlyComplete || strlen($sAddress) && strlen($sCity) && strlen($sState) && strlen($sZip)) { $pdf->Add_PDF_Label(sprintf("%s\n%s\n%s, %s %s", $sName, $sAddress, $sCity, $sState, $sZip)); } } } $startcol = FilterInput($_GET["startcol"], 'int'); if ($startcol < 1) { $startcol = 1; } $startrow = FilterInput($_GET["startrow"], 'int'); if ($startrow < 1) { $startrow = 1; } $sLabelType = FilterInput($_GET["labeltype"], 'char', 8); // Standard format $pdf = new PDF_Label($sLabelType, $startcol, $startrow); $pdf->Open(); // Manually add a new page if we're using offsets if ($startcol > 1 || $startrow > 1) { $pdf->AddPage(); } $mode = $_GET["mode"]; $bOnlyComplete = $_GET["onlyfull"] == 1; GenerateLabels($pdf, $mode, $bOnlyComplete); if ($iPDFOutputType == 1) { $pdf->Output("Labels-" . date("Ymd-Gis") . ".pdf", true); } else { $pdf->Output(); }
<?php require 'PDF_Label.php'; /*------------------------------------------------ To create the object, 2 possibilities: either pass a custom format via an array or use a built-in AVERY name ------------------------------------------------*/ // Example of custom format // $pdf = new PDF_Label(array('paper-size'=>'A4', 'metric'=>'mm', 'marginLeft'=>1, 'marginTop'=>1, 'NX'=>2, 'NY'=>7, 'SpaceX'=>0, 'SpaceY'=>0, 'width'=>99, 'height'=>38, 'font-size'=>14)); // Standard format $pdf = new PDF_Label('L7163'); $pdf->AddPage(); // Print labels for ($i = 1; $i <= 20; $i++) { $text = sprintf("%s\n%s\n%s\n%s %s, %s", "Laurent {$i}", 'Immeuble Toto', 'av. Fragonard', '06000', 'NICE', 'FRANCE'); $pdf->Add_Label($text); } $pdf->Output(); ?>
$resultat = ExecRequete($requete, $connexion); Verif_resultat($resultat); define('FPDF_FONTPATH', '../../../archives/apdf/font/'); $ligneimp = (int) $ligneimp; $colimp = (int) $colimp; switch ($formeDe) { case "étiquettes": $pdf = new PDF_Label('5162', $colimp, $ligneimp); $sgLj = 1; break; case "étiquettesSG2": $pdf = new PDF_Label('5162sg2', $colimp, $ligneimp); $sgLj = 0; break; case "étiquettesSG1200": $pdf = new PDF_Label('5162sg1200', $colimp, $ligneimp); $sgLj = 0; break; } $pdf->Open(); $pdf->AddPage(); while ($ligne = LigneSuivante($resultat)) { if ($ligne->date_depart == "0000-00-00") { $eti = ""; $appelabrege = ""; switch ($ligne->appel) { case "Monsieur": $appelabrege = "M."; $invite = "invité"; break; case "Madame":