function alku() { global $yhtiorow, $firstpage, $pdf, $rectparam, $norm, $norm_bold, $pieni, $ytunnus, $asiakasid, $kukarow, $kala, $tid, $otsikkotid; static $sivu; $sivu++; if (!isset($pdf)) { //PDF parametrit $pdf = new pdffile(); $pdf->enable('template'); $pdf->set_default('margin-top', 0); $pdf->set_default('margin-bottom', 0); $pdf->set_default('margin-left', 0); $pdf->set_default('margin-right', 0); $rectparam["width"] = 0.3; $norm["height"] = 12; $norm["font"] = "Courier"; $norm_bold["height"] = 12; $norm_bold["font"] = "Courier-Bold"; $pieni["height"] = 8; $pieni["font"] = "Courier"; $query = "SELECT *\n FROM asiakas\n WHERE yhtio = '{$kukarow['yhtio']}'\n and tunnus = '{$asiakasid}'"; $assresult = pupe_query($query); $assrow = mysql_fetch_assoc($assresult); // Tehdään firstpage $firstpage = $pdf->new_page("a4"); // Tehdään headertemplate $tid = $pdf->template->create(); $pdf->template->rectangle($tid, 20, 20, 0, 580, $rectparam); $pdf->template->text($tid, 30, 5, $yhtiorow["nimi"], $pieni); $pdf->template->text($tid, 170, 5, "{$assrow['nimi']} {$assrow['nimitark']} ({$ytunnus}) " . t("alennustaulukko")); $pdf->template->place($tid, $firstpage, 0, 800); // Tehdään otsikkoheader $otsikkotid = $pdf->template->create(); $pdf->template->text($otsikkotid, 30, 20, t("Osasto"), $norm_bold); $pdf->template->text($otsikkotid, 30, 0, t("Tuoteryhmä") . "/" . t("Tuotenumero"), $norm_bold); $pdf->template->text($otsikkotid, 330, 0, t("Aleryhmä"), $norm_bold); $pdf->template->text($otsikkotid, 450, 0, t("Alennus"), $norm_bold); if ($yhtiorow['myynnin_alekentat'] > 1) { $pdf->template->text($otsikkotid, 520, 0, t("Alelaji"), $norm_bold); } $pdf->template->place($otsikkotid, $firstpage, 0, 665, $norm_bold); $kala = 650; // Asiakastiedot //$pdf->draw_rectangle(737, 20, 674, 300, $firstpage, $rectparam); $pdf->draw_text(50, 759, t("Osoite", $kieli), $firstpage, $pieni); $pdf->draw_text(50, 747, $assrow["nimi"], $firstpage, $norm); $pdf->draw_text(50, 737, $assrow["nimitark"], $firstpage, $norm); $pdf->draw_text(50, 727, $assrow["osoite"], $firstpage, $norm); $pdf->draw_text(50, 717, $assrow["postino"] . " " . $assrow["postitp"], $firstpage, $norm); $pdf->draw_text(50, 707, $assrow["maa"], $firstpage, $norm); } else { // Liitetään vaan valmiit templatet uudelle sivulle $firstpage = $pdf->new_page("a4"); $pdf->template->place($tid, $firstpage, 0, 800); $pdf->template->place($otsikkotid, $firstpage, 0, 760); } $pdf->draw_text(520, 805, t("Sivu") . ": {$sivu}", $firstpage, $norm); }
function hae_saldovahvistus_pdf($saldovahvistus, $boss = false) { global $kukarow, $yhtiorow, $pdf, $kala, $sivu, $norm, $pieni, $kieli, $bold, $lask, $rectparam, $sivu_numero_obj_ids; $sivu_numero_obj_ids = array(); //PDF parametrit $pdf = new pdffile(); $pdf->set_default('margin-top', 0); $pdf->set_default('margin-bottom', 0); $pdf->set_default('margin-left', 0); $pdf->set_default('margin-right', 0); $rectparam = array(); $rectparam["width"] = 0.3; $lask = 1; $sivu = 1; $norm["height"] = 10; $norm["font"] = "Times-Roman"; $pieni["height"] = 8; $pieni["font"] = "Times-Roman"; $bold["height"] = 10; $bold["font"] = "Times-Bold"; //Otetaan tässä asiakkaan kieli talteen $kieli = $saldovahvistus['asiakas']['kieli']; $firstpage = alku($saldovahvistus); $firstpage = rivit($firstpage, $saldovahvistus['laskut'], $saldovahvistus, $boss); $kala -= 20; $pdf->draw_text(250, $kala, t('Avoin saldo yhteensä', $kieli), $firstpage, $bold); $pdf->draw_text(452.5, $kala, $saldovahvistus['avoin_saldo_summa'], $firstpage, $bold); $pdf->draw_text(500, $kala, $saldovahvistus['valkoodi'], $firstpage, $bold); loppu($firstpage, $saldovahvistus); if (!empty($sivu_numero_obj_ids)) { foreach ($sivu_numero_obj_ids as $sivu_numero_obj_id) { $pdf->objects[$sivu_numero_obj_id]['text'] .= $pdf->currentPage['number'] + 1; } } //keksitään uudelle failille joku varmasti uniikki nimi: list($usec, $sec) = explode(' ', microtime()); mt_srand((double) $sec + (double) $usec * 100000); $pdffilenimi = "/tmp/saldovahvistus-" . md5(uniqid(mt_rand(), true)) . ".pdf"; //kirjoitetaan pdf faili levylle.. $fh = fopen($pdffilenimi, "w"); if (fwrite($fh, $pdf->generate()) === FALSE) { die("PDF kirjoitus epäonnistui {$pdffilenimi}"); } fclose($fh); return $pdffilenimi; }
} } else { die; } $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;
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: charts.php 221 2005-06-25 01:22:54Z deelight $ */ /* This example illustrates the charting subclass * These features are still experimental */ require '../phppdflib.class.php'; // Starts a new pdffile object $pdf = new pdffile(); $pdf->set_default('margin', 0); $firstpage = $pdf->new_page("letter"); $pdf->enable('chart'); $pdf->chart->setcolor('background', 1, 0.5, 0.33); for ($series = 1; $series < 4; $series++) { unset($points); switch ($series) { case 1: $color = 'black'; break; case 2: $color = 'blue'; break; case 3: $color = 'green';
function generoi_pdf_tiedostot(&$data_array, $params, $kieli) { global $pdf, $asiakasrow, $yhtiorow, $sivu, $norm, $pieni, $pvm, $alkuvv, $alkukk, $alkupp, $loppuvv, $loppukk, $loppupp, $kala, $sivu, $lask, $sumkpled, $sumkplva, $sumed, $sumva, $asiakas_numero; $alkuvv = $params['alkuvv']; $alkukk = $params['alkukk']; $alkupp = $params['alkupp']; $loppuvv = $params['loppuvv']; $loppukk = $params['loppukk']; $loppupp = $params['loppupp']; $pdf_tiedostot = array(); $i = 0; echo '<br/>' . t('Tehdään pdf tiedostot') . '<br/>'; $bar2 = new ProgressBar(); $bar2->initialize(count($data_array) - 1); foreach ($data_array as &$data) { $bar2->increase(); $pdf = new pdffile(); $pdf->set_default('margin-top', 0); $pdf->set_default('margin-bottom', 0); $pdf->set_default('margin-left', 0); $pdf->set_default('margin-right', 0); // defaultteja layouttiin $kala = 575; $lask = 1; $sivu = 1; $asiakasrow = $data['asiakasrow']; // kirjotetaan header $firstpage = alku("osasto"); $firstpage = rivi_kaikki($firstpage, 'osasto', $data['tilaukset_ilman_try'], $params); $sumkpled = $data['summat_ilman_try']['sumkpled']; $sumkplva = $data['summat_ilman_try']['sumkplva']; $sumed = $data['summat_ilman_try']['sumed']; $sumva = $data['summat_ilman_try']['sumva']; // kirjotetaan footer loppu($firstpage, "dontsend"); // defaultteja layouttiin $kala = 575; $lask = 1; $sivu = 1; // uus pdf header $firstpage = alku(); $firstpage = rivi_kaikki($firstpage, '', $data['tilaukset_try']); $sumkpled = $data['summat_try']['sumkpled']; $sumkplva = $data['summat_try']['sumkplva']; $sumed = $data['summat_try']['sumed']; $sumva = $data['summat_try']['sumva']; $asiakas_numero = $data['asiakasrow']['asiakasnro']; // kirjotetaan footer ja palautetaan luodun tiedoston polku $pdf_tiedostot[] = loppu($firstpage); $data['tiedosto'] = $pdf_tiedostot[$i]; $i++; } return $pdf_tiedostot; }
<?php // otetaan sisään voidaan ottaa $myyntirivitunnus tai $ostorivitunnus // ja $from niin tiedetään mistä tullaan ja minne palata if (strpos($_SERVER['SCRIPT_NAME'], "sarjanumeroseuranta.php") !== false) { if ($_REQUEST["tee"] == "NAYTATILAUS") { $_REQUEST['nayta_pdf'] = 1; $nayta_pdf = 1; } require "../inc/parametrit.inc"; } if ($tee == "NAYTATILAUS") { require_once "pdflib/phppdflib.class.php"; $viivakoodityyppi = "viivakoodi"; $malli = "PDF"; $pdf = new pdffile(); $toim = "SARJA"; $pdf->set_default('margin-top', 0); $pdf->set_default('margin-bottom', 0); $pdf->set_default('margin-left', 0); $pdf->set_default('margin-right', 0); $query = "SELECT sarjanumero, tuoteno\n FROM sarjanumeroseuranta\n WHERE yhtio = '{$kukarow["yhtio"]}'\n AND tunnus IN ({$valitut_sarjat})"; $sarja_result = pupe_query($query); while ($sarjarow = mysql_fetch_assoc($sarja_result)) { $tuoteno = $sarjarow["tuoteno"]; require "inc/tulosta_tuotetarrat_pdf.inc"; } $filename = "/tmp/sarjanumerotarra-" . md5(uniqid(mt_rand(), true)) . ".pdf"; $file = fopen($filename, "w"); fwrite($file, $pdf->generate()); fclose($file);
$tkpl = $tulostakappale; if (($tee == 'Z' or $tee == 'H') and $ulos == '') { if ($lets == 'go') { $query = "SELECT komento\n FROM kirjoittimet\n WHERE yhtio = '{$kukarow['yhtio']}'\n and tunnus = '{$kirjoitin}'"; $komres = pupe_query($query); $komrow = mysql_fetch_array($komres); $komento = $komrow['komento']; if (!isset($tuotteet)) { $tuotteet = array(); $tuotteet[$tuoteno] = $tuoteno; } require_once "pdflib/phppdflib.class.php"; if ($malli == 'PDF24' or $malli == 'PDF40' or $malli == 'PDF') { //PDF parametrit if (!isset($pdf)) { $pdf = new pdffile(); $pdf->set_default('margin-top', 0); $pdf->set_default('margin-bottom', 0); $pdf->set_default('margin-left', 0); $pdf->set_default('margin-right', 0); } } foreach ($tuotteet as $key => $tuoteno) { if ($malli != 'Zebra' and $malli != 'Zebra_hylly' and $malli != 'Zebra_tuote') { for ($a = 0; $a < $tkpl; $a++) { if ($malli == 'Tec') { require "inc/tulosta_tuotetarrat_tec.inc"; } elseif ($malli == 'Intermec') { require "inc/tulosta_tuotetarrat_intermec.inc"; } elseif ($malli == 'PDF24' or $malli == 'PDF40' or $malli == 'PDF') { require "inc/tulosta_tuotetarrat_pdf.inc";
function siirtokehoitus_pdf($pdf_data) { //PDF:n luonti ja defaultit require_once "pdflib/phppdflib.class.php"; //PDF parametrit $pdf = new pdffile(); $pdf->set_default('margin-top', 0); $pdf->set_default('margin-bottom', 0); $pdf->set_default('margin-left', 0); $pdf->set_default('margin-right', 0); //fontit $pieni["height"] = 11; $pieni["font"] = "Times-Roman"; $bold["height"] = 11; $bold["font"] = "Times-Bold"; // sitten aletaan piirtämään itse PDF sisältöä $sivu = $pdf->new_page("a4"); $x = 40; $y = 800; $xx = array(20, 580); $pdf->draw_text($x, $y, 'Tyyppi', $sivu, $bold); $pdf->draw_text($x + 100, $y, 'Tuotenumero', $sivu, $bold); $pdf->draw_text($x + 200, $y, 'Tuotepaikka', $sivu, $bold); $pdf->draw_text($x + 300, $y, 'Hyllyssä', $sivu, $bold); $pdf->draw_text($x + 400, $y, 'Hälytysraja', $sivu, $bold); $y -= 20; $yy[0] = $yy[1] = $y; $pdf->draw_line($xx, $yy, $sivu); $y -= 20; foreach ($pdf_data as $row) { $korkeus = 20 + count($row['varapaikat']) * 20; if ($korkeus > $y) { $sivu = $pdf->new_page("a4"); $y = 800; $pdf->draw_text($x, $y, 'Tyyppi', $sivu, $bold); $pdf->draw_text($x + 100, $y, 'Tuotenumero', $sivu, $bold); $pdf->draw_text($x + 210, $y, 'Tuotepaikka', $sivu, $bold); $pdf->draw_text($x + 320, $y, 'Hyllyssä', $sivu, $bold); $pdf->draw_text($x + 420, $y, 'Hälytysraja', $sivu, $bold); $y -= 15; $yy[0] = $yy[1] = $y; $pdf->draw_line($xx, $yy, $sivu); $y -= 20; } $pdf->draw_text($x, $y, 'Oletuspaikka', $sivu, $pieni); $pdf->draw_text($x + 100, $y, $row['tuoteno'], $sivu, $pieni); $pdf->draw_text($x + 210, $y, $row['tuotepaikka'], $sivu, $pieni); $pdf->draw_text($x + 320, $y, $row['myytavissa'], $sivu, $pieni); $pdf->draw_text($x + 420, $y, $row['haly'], $sivu, $pieni); foreach ($row['varapaikat'] as $vararow) { $y -= 20; $pdf->draw_text($x, $y, 'Varapaikka', $sivu, $pieni); $pdf->draw_text($x + 210, $y, $vararow['tuotepaikka'], $sivu, $pieni); $pdf->draw_text($x + 320, $y, $vararow['myytavissa'], $sivu, $pieni); } $y -= 15; $yy[0] = $yy[1] = $y; $pdf->draw_line($xx, $yy, $sivu); $y -= 20; } //keksitään uudelle failille joku varmasti uniikki nimi: $pdffilenimi = "/tmp/kuitti-" . md5(uniqid(rand(), true)) . ".pdf"; //kirjoitetaan pdf faili levylle.. $fh = fopen($pdffilenimi, "w"); if (fwrite($fh, $pdf->generate()) === FALSE) { die("PDF kirjoitus epäonnistui {$pdffilenimi}"); } fclose($fh); return $pdffilenimi; }
along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. $Id: example.php 221 2005-06-25 01:22:54Z deelight $ */ /* This is a demo file to demonstrate the usage * of phppdflib */ /* Simply copy the phppdflib.class.php file to an * accessible location on your web server, and include() * it in any scripts that you want to generate pdf * files from */ require '../phppdflib.class.php'; // Starts a new pdffile object $pdf = new pdffile(); /* Use the defaults system to turn off page * margins */ $pdf->set_default('margin', 0); /* You can create as many pages as you want. * The parameter is the size of the page: * 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:
the Free Software Foundation; either version 2 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, 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);
} else { $lisavarattu = ""; } $liitostunnus_query = "SELECT DISTINCT lasku.liitostunnus FROM tilausrivi\n JOIN lasku ON (lasku.yhtio = tilausrivi.yhtio AND lasku.tunnus = tilausrivi.otunnus AND lasku.yhtio_toimipaikka = {$toimrow['tunnus']})\n WHERE tilausrivi.yhtio = '{$yhtiorow['yhtio']}'\n AND tilausrivi.tyyppi = 'L'\n AND tilausrivi.var = 'J'\n AND tilausrivi.keratty = ''\n AND tilausrivi.uusiotunnus = 0\n AND tilausrivi.kpl = 0\n AND tilausrivi.jt {$lisavarattu} > 0"; $liitostunnus_result = pupe_query($liitostunnus_query); while ($liitostunnus_row = mysql_fetch_array($liitostunnus_result)) { $asiakasquery = "SELECT nimi, osoite, postino, postitp, maa, ytunnus, email, kieli, tunnus FROM asiakas WHERE yhtio='{$yhtiorow['yhtio']}' AND tunnus={$liitostunnus_row['liitostunnus']}"; $asiakasresult = pupe_query($asiakasquery); $asiakasrow = mysql_fetch_array($asiakasresult); if ($asiakasrow["email"] != "") { $jtquery = "SELECT tilausrivi.nimitys, tilausrivi.otunnus, tilausrivi.tuoteno, tilausrivi.laadittu, tilausrivi.tilkpl\n FROM tilausrivi USE INDEX (yhtio_tyyppi_var_keratty_kerattyaika_uusiotunnus)\n JOIN lasku USE INDEX (PRIMARY) ON (lasku.yhtio = tilausrivi.yhtio and lasku.yhtio_toimipaikka = {$toimrow['tunnus']} and lasku.tunnus = tilausrivi.otunnus and lasku.osatoimitus = '' AND lasku.liitostunnus = '{$asiakasrow['tunnus']}')\n WHERE tilausrivi.yhtio = '{$yhtiorow['yhtio']}'\n AND tilausrivi.tyyppi = 'L'\n AND tilausrivi.var = 'J'\n AND tilausrivi.keratty = ''\n AND tilausrivi.uusiotunnus = 0\n AND tilausrivi.kpl = 0\n AND tilausrivi.jt {$lisavarattu} > 0\n ORDER BY tilausrivi.otunnus"; $jtresult = pupe_query($jtquery); if (mysql_num_rows($jtresult) > 0) { require_once '../pdflib/phppdflib.class.php'; require "jt-raportti_pdf.inc"; $pdf = new pdffile(); $pdf->set_default('margin-top', 0); $pdf->set_default('margin-bottom', 0); $pdf->set_default('margin-left', 0); $pdf->set_default('margin-right', 0); list($page[$sivu], $kalakorkeus) = alku($pdf); while ($jtrow = mysql_fetch_array($jtresult)) { list($page[$sivu], $kalakorkeus) = rivi($pdf, $page[$sivu], $kalakorkeus, $jtrow); } // echo "$laskuri "; print_pdf($pdf, 1); // $laskuri++; } } } }
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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. $Id: example-wrap.php 221 2005-06-25 01:22:54Z deelight $ */ set_time_limit(600); require "../phppdflib.class.php"; // Starts a new pdffile object $pdf = new pdffile(); $pdf->set_default('margin', 0); $pdf->set_default('font', 'Courier'); $pdf->set_default('height', 10); $fname = "../phppdflib.class.php"; $fh = fopen($fname, "r"); $data = fread($fh, filesize($fname)); fclose($fh); $start = gettimeofday(); $p = explode("\n", $data); $top = 720; $page = $firstpage = $pdf->new_page("letter"); foreach ($p as $one) { while (is_string($one)) { $one = $pdf->draw_one_paragraph($top, 72, 72, 540, $one, $page); if (is_string($one)) {
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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. $Id: showoff.php 221 2005-06-25 01:22:54Z deelight $ */ /* The intent of this file is to show off just what * can be done with phppdflib */ require '../phppdflib.class.php'; $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');
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: template.php 221 2005-06-25 01:22:54Z deelight $ */ /* This example illustrates the template subclass * These features are still experimental */ require '../phppdflib.class.php'; // Starts a new pdffile object $pdf = new pdffile(); $page = $pdf->new_page("letter"); $pdf->enable('template'); $t1 = $pdf->template->create(); /* Set the overall size of this template. * This will be important once auto-placement * is working */ $pdf->template->size($t1, 500, 80); /* Put a rectangle at the lower left of the template */ $pdf->template->rectangle($t1, 0, 0, 20, 20); // These next two will look like a lolipop // A circle on the template $pdf->template->circle($t1, 200, 5, 12, array('mode' => 'fill')); // Add a line
php pdf generation library Copyright (C) Potential Technologies 2002 http://www.potentialtech.com This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. $Id: example-import.php 221 2005-06-25 01:22:54Z deelight $ */ require '../phppdflib.class.php'; // Starts a new pdffile object $pdf = new pdffile(); $pdf->enable('import'); // Change this to grab a pre-existing PDF file from somewhere $d = file_get_contents('example.pdf'); if ($pdf->import->append($d)) { echo "No errors\n"; } else { echo "Error!\n"; }
foreach ($sarakkeet as $sarake) { if (strpos($sarake, "::") !== FALSE) { list($muuarray, $arvo) = explode("::", $sarake); $sarakenimi = ${$muuarray}[$arvo] . "\n"; } else { $sarakenimi = ""; } $worksheet->writeString(0, $pi, $sarakenimi . $kaudet[$i], $format_bold); $pi++; } } } // PDF-koodia if (isset($teepdf) and $teepdf == "OK") { require_once 'pdflib/phppdflib.class.php'; $pdf = new pdffile(); $pdf->set_default('margin', 0); $pdf->set_default('margin-left', 5); $rectparam["width"] = 0.3; $p["height"] = 10; $p["font"] = "Times-Roman"; $b["height"] = 8; $b["font"] = "Times-Bold"; if (count($kaudet) > 10 and $kaikkikaudet != "") { $p["height"]--; $b["height"]--; $saraklev = 49; $yhteensasaraklev = 66; $rivikork = 13; } else { $saraklev = 60;