示例#1
0
<?php

error_reporting(E_ALL);
define('FPDF_FONTPATH', 'font/');
require 'fpdi.php';
$pdf = new fpdi();
$pagecount = $pdf->setSourceFile("pdfdoc.pdf");
$tplidx = $pdf->ImportPage(1);
$pdf->addPage();
$pdf->useTemplate($tplidx, 10, 10, 90);
$pdf->Output("newpdf.pdf", "F");
$pdf->closeParsers();
     $timestart = time();
 } else {
     $timestart = $_GET[timestart];
 }
 $current_time = BeginMonth($timestart, 1, 2);
 $capture_start = $current_time;
 $format_bg_r = "0";
 $format_bg_g = "0";
 $format_bg_b = "0";
 //  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(L);
 //$pdf->useTemplate($tplidx);
 // Functions
 function Colors($ratio, $factor)
 {
     $output = round(255 * $ratio);
     $diff = 255 - $output;
     $add = $factor * $diff;
     $output = 255 - $add;
     return $output;
 }
 function DrawGrid()
 {
     global $current_time;
     global $pdf;
     global $colwidth;