SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); //set margins $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT); //set auto page breaks $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); //set image scale factor $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); $font_red = hexdec("00"); $font_green = hexdec("00"); $font_blue = hexdec("00"); $pdf->SetTextColor($font_red,$font_green,$font_blue); $pdf->SetFont($document_font,"",$document_font_size); $pdf->addPage(); for ($c = 0; $c < count($labelColumns); $c++) { $col = $labelColumns[$c]; for ($r = 0; $r < count($labelRows); $r++) { $row = $labelRows[$r]; $pdf->SetXY($col,$row); $pdf->Cell($labelWidth,$incr,"Mark Fester",'0',1,'L'); $row += $incr; $pdf->SetXY($col,$row); $pdf->Cell($labelWidth,$incr,"Pepperoni Pizza",'0',1,'L'); $row += $incr; $pdf->SetXY($col,$row); $pdf->Cell($labelWidth,$incr,"Chocolate Milk",'0',1,'L'); $row += $incr; $pdf->SetXY($col,$row); $pdf->Cell($labelWidth,$incr,"Chocolate Milk",'0',1,'L'); $row += $incr; $pdf->SetXY($col,$row); $pdf->Cell($labelWidth,$incr,"Chocolate Milk",'0',1,'L'); } } header('Pragma: public'); header('Expires: 0'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Cache-Control: private',false); header('Content-type: application/pdf'); header("Content-Disposition: attachment; filename=labels.pdf"); header('Content-Transfer-Encoding: binary'); $pdf->Output("labels.pdf","D"); ?>