sticks_sheet = new sticks_sheet($id*1); $this->sticks_sheet_stick = null; if(file_exists($class_path."/sticks_sheet/stick/".$display_class.".class.php")) { require_once($class_path."/sticks_sheet/stick/".$display_class.".class.php"); $this->sticks_sheet_stick = new $display_class(); $this->sticks_sheet_stick->set_width($this->sticks_sheet->get_stick_width()); $this->sticks_sheet_stick->set_height($this->sticks_sheet->get_stick_height()); } } /** * * @param string $type Type de sortie * @param unknown $first_row Indice horizontal de la première étiquette * @param unknown $first_col Indice vertical de la première étiquette */ public function output($type, $data=array(), $first_row=1, $first_col=1) { switch ($type) { case 'PDF': $this->output_PDF($data, $first_row, $first_col); break; } } protected function output_PDF($data, $first_row, $first_col) { global $fpdf; global $pmb_pdf_fontfixed; // Démarrage et configuration du pdf $nom_classe = $fpdf . "_Etiquette"; $pdf = new $nom_classe ($this->sticks_sheet->get_nbr_x_sticks(), $this->sticks_sheet->get_nbr_y_sticks(), $this->sticks_sheet->get_page_orientation(), $this->sticks_sheet->get_unit() , $this->sticks_sheet->get_page_format()); $pdf->Open(); $pdf->SetPageMargins($this->sticks_sheet->get_top_margin(), '0', $this->sticks_sheet->get_left_margin(), '0'); $pdf->SetSticksMargins(0, 0, 0, 0); $pdf->SetSticksPadding($this->sticks_sheet->get_x_sticks_spacing(),$this->sticks_sheet->get_y_sticks_spacing()); //Saut Etiquettes $pos = (($first_row-1)*$this->sticks_sheet->get_nbr_x_sticks()) + ($first_col); for ($i=1;$i<$pos;$i++) { $pdf->AddStick(); } //Impression etiquettes for ($i=0; $iAddStick(); $pdf->SetFont($pmb_pdf_fontfixed,'' ,'8'); $pdf->SetXY($pdf->GetStickX(), $pdf->GetStickY()); $this->sticks_sheet_stick->render($pdf, $data[$i]); } $pdf->Output('planche_etiquette.pdf', 'I'); } }