//if ($settings_pdffont != NULL) { //$format_font = $settings_pdffont; //$format_font_2 = $settings_pdffont.".php"; //} else { $format_font = "Helvetica"; $format_font_2 = "franklingothicbook.php"; //} // Use FDPI to get the template define('FPDF_FONTPATH', 'fpdf/font/'); require 'fpdf/fpdi.php'; $pdf = new fpdi(); $pagecount = $pdf->setSourceFile("pdf/template.pdf"); $tplidx = $pdf->ImportPage(1); $pdf->addPage(); $pdf->useTemplate($tplidx); $pdf->SetAutoPageBreak(0, 1.5); $pdf->AddFont($format_font, '', $format_font_2); // Page headers $project_counter = 1; $page_count = 1; $pdf->SetY(35); $pdf->SetFont('Helvetica', 'b', 24); $pdf->SetTextColor($format_bg_r, $format_bg_g, $format_bg_b); $pdf->Cell(0, 10, "Timesheet Analysis"); $pdf->SetTextColor(0, 0, 0); $pdf->SetY(50); $pdf->SetFont('Helvetica', 'b', 18); $print_title = "Generated " . TimeFormatDetailed(time()); $print_envelope = "Timesheet Datum: " . TimeFormat($settings_timesheetstart); $pdf->SetFillColor(220, 220, 220); $pdf->MultiCell(0, 8, $print_title, 0, L, 0);
//Calc Part 1, Line 3 here. if (isset($lines_arr)) { $lines_arr['total'] = Misc::ArrayAssocSum($lines_arr, NULL, 6); Debug::Arr($lines_arr, 'Lines Array: ', __FILE__, __LINE__, __METHOD__, 10); //Line 8 $p1_line8 = $lines_arr['total']['p1_6'] - 0; } $border = 0; $pdf = new fpdi(); //Import original Gov't supplied PDF. if ($show_background == TRUE) { $pagecount = $pdf->setSourceFile(Environment::getBasePath() . 'interface' . DIRECTORY_SEPARATOR . 'forms' . DIRECTORY_SEPARATOR . 'us' . DIRECTORY_SEPARATOR . 'tax' . DIRECTORY_SEPARATOR . 'f940ez.pdf'); $tplidx = $pdf->ImportPage(1); } $pdf->setMargins(0, 0, 0, 0); $pdf->SetAutoPageBreak(FALSE); $pdf->SetFont('freeserif', '', 10); $pdf->AddPage(); if (isset($tplidx)) { $pdf->useTemplate($tplidx, 0, 0); } $pdf->setXY(40, 39); $pdf->Cell(75, 6, $current_company->getName(), $border, 0, 'L'); $pdf->setXY(157, 39); $pdf->Cell(10, 6, $filter_data['year'], $border, 0, 'R'); $pdf->setXY(122, 47); $pdf->Cell(45, 6, $current_company->getBusinessNumber(), $border, 0, 'R'); $pdf->setXY(40, 56); $pdf->Cell(75, 6, $current_company->getAddress1() . ' ' . $current_company->getAddress2(), $border, 0, 'L'); $pdf->setXY(122, 56); $pdf->Cell(45, 6, $current_company->getCity() . ', ' . $current_company->getProvince() . ' ' . $current_company->getPostalCode(), $border, 0, 'R');
$import_template = NULL; } if ($import_template == "1") { $pdf->setSourceFile("library/background.pdf"); $tplidx = $pdf->ImportPage(1); } // Now add the first page $pdf->addPage(); if ($import_template == "1") { $pdf->useTemplate($tplidx, 0, 0, 210, 297); } $pdf->AddFont('century', '', 'Century.php'); $pdf->AddFont('franklingothicbook', '', 'franklingothicbook.php'); $pdf->AddFont('gillsans', '', 'gillsans.php'); $pdf->SetMargins(0, 0); $pdf->SetAutoPageBreak("no"); // Create the sheet header $pdf->SetFont("arial", '', $label_j); $label_print_date = $label_title . ", created " . date("jS M y", time()); $label_url = "http://labelstudio.redcitrus.com"; $pdf->SetFontSize(8); $pdf->SetTextColor(190, 190, 190); $pdf->Cell(0, 5, $label_print_date, 0, 1, L, 0, $label_url); $pdf->SetFont($font, '', $label_j); $pdf->SetTextColor(0, 0, 0); $pdf->SetFontSize($label_j); if ($_GET[labeltype] != NULL) { $labeltype = $_GET[labeltype]; } else { $labeltype = 1; }