$default_height = $height = 1; $cols = 3; $pdf = new AlphaPDF('P', 'in', 'Letter'); $pdf->SetCompression(true); $pdf->SetMargins(0, 0); $pdf->SetAutoPageBreak(false); $x = $y = 0; $light = 96; $basefontsize = 6; $label_width = 2.625; foreach ($items as $item) { $bx = 0.25 + $x * ($label_width + 0.125); $by = 0.5 + $y * $height; $vmargin = 0.125; if ($x == 0 && $y == 0) { $pdf->AddPage(); if ($_REQUEST['debug']) { $pdf->SetDrawColor($light); $pdf->SetLineWidth(1 / 72 / 2); for ($ly = 0; $ly < 11; $ly++) { $pdf->Line(0, 0.5 + $ly, 8.5, 0.5 + $ly); } $pdf->Line(0.1875, 0, 0.1875, 11); $pdf->Line(0.1875 + 2.625, 0, 0.1875 + 2.625, 11); $pdf->Line(0.1875 + 2.625 + 0.125, 0, 0.1875 + 2.625 + 0.125, 11); $pdf->Line(0.1875 + 2.625 + 0.125 + 2.625, 0, 0.1875 + 2.625 + 0.125 + 2.625, 11); $pdf->Line(0.1875 + 2.625 + 0.125 + 2.625 + 0.125, 0, 0.1875 + 2.625 + 0.125 + 2.625 + 0.125, 11); $pdf->Line(0.1875 + 2.625 + 0.125 + 2.625 + 0.125 + 2.625, 0, 0.1875 + 2.625 + 0.125 + 2.625 + 0.125 + 2.625, 11); } } # write the code