summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSashi202020-08-25 13:00:52 +0530
committerSashi202020-08-25 13:00:52 +0530
commit9257ff0b522d82752b7af49933c89bd259a728c9 (patch)
treead873a91646b590a9a2452c41d77b5ea735ad21c
parent6cafd6a796c0ff0c985694c482cd16e1a87a776f (diff)
downloadr_textbook_companion-9257ff0b522d82752b7af49933c89bd259a728c9.tar.gz
r_textbook_companion-9257ff0b522d82752b7af49933c89bd259a728c9.tar.bz2
r_textbook_companion-9257ff0b522d82752b7af49933c89bd259a728c9.zip
Update the pi and co-pi sign, background
-rwxr-xr-xpdf/generate_pdf.inc57
-rw-r--r--pdf/images/bg_cert.pngbin0 -> 12198 bytes
-rw-r--r--pdf/images/ftr_line.pngbin0 -> 12198 bytes
-rw-r--r--pdf/images/mhrd.pngbin0 -> 12198 bytes
-rw-r--r--pdf/images/sign1.pngbin0 -> 12198 bytes
-rw-r--r--pdf/images/sign2.pngbin0 -> 12198 bytes
6 files changed, 39 insertions, 18 deletions
diff --git a/pdf/generate_pdf.inc b/pdf/generate_pdf.inc
index 0abd638..15e243a 100755
--- a/pdf/generate_pdf.inc
+++ b/pdf/generate_pdf.inc
@@ -70,7 +70,7 @@ function generate_pdf()
$path = drupal_get_path('module', 'textbook_companion');
$pdf->AddPage();
$image_bg = $path . "/pdf/images/bg_cert.png";
- $pdf->Image($image_bg, 0, 0, $pdf->w, $pdf->h);
+ $pdf->Image($image_bg, 0, 0, $pdf->GetPageWidth(), $pdf->GetPageHeight());
$pdf->SetMargins(18, 1, 18);
$pdf->Ln(25);
$pdf->SetFont('Times', 'I', 16);
@@ -136,36 +136,57 @@ function generate_pdf()
$urlRelativeFilePath = $path . "/pdf/temp_prcode/" . $fileName;
$sign = $path . "/pdf/images/sign.png";
QRcode::png($codeContents, $pngAbsoluteFilePath);
- $pdf->Ln(20);
- $pdf->SetFont('', 'BI');
- $pdf->SetTextColor(30, 100, 182);
- $pdf->Cell(228, 8, $UniqueString, '0', '1', 'R');
- $pdf->SetY(148);
- $pdf->SetX(222);
- $pdf->Image($sign, $pdf->GetX()-130, $pdf->GetY(), 85, 0);
- $pdf->Image($pngAbsoluteFilePath, $pdf->GetX(), $pdf->GetY()-5, 30, 0);
- //$name = $data3->full_name;
- //$certificate_name = str_replace(' ', '_', $name);
- //$pdf->Output($certificate_name . '_R_TBC_Certificate.pdf', 'D');
- $pdf->SetFont('Times', 'I', 8);
+ $pdf->SetY(85);
+ $pdf->SetX(320);
+ $pdf->Ln(10);
+ $sign1 = $path . "/pdf/images/sign1.png";
+ $sign2 = $path . "/pdf/images/sign2.png";
+ $pdf->Image($sign1, $pdf->GetX()+60, $pdf->GetY() + 45, 85, 0);
+ $pdf->Image($sign2, $pdf->GetX()+160, $pdf->GetY() + 45, 85, 0);
+ $pdf->Image($pngAbsoluteFilePath, $pdf->GetX()+15, $pdf->GetY()+70, 30, 0);
+ $fossee = $path . "/pdf/images/fossee.png";
+ $mhrd = $path . "/pdf/images/mhrd.png";
+ $pdf->Image($fossee, $pdf->GetX()+80, $pdf->GetY()+80, 50, 0);
+ $pdf->Image($mhrd, $pdf->GetX()+180, $pdf->GetY()+80, 40, 0);
+ //$pdf->SetX(29);
+ //$pdf->SetY(-50);
+ $pdf->Ln(2);
+ $ftr_line = $path . "/pdf/images/ftr_line.png";
+ $pdf->Image($ftr_line, $pdf->GetX(), $pdf->GetY()+105, 250, 0);
+ $pdf->SetFont('Times', 'I', 15);
+ $pdf->SetLeftMargin(40);
+ $pdf->GetY()+60;
+ $pdf->Ln(62);
+ $pdf->Cell(320, 8, $UniqueString, '0', '1', 'L');
+ //$pdf->Ln(6);
+ $pdf->SetFont('Arial', 'I', 8);
$pdf->SetTextColor(0, 0, 0);
$filename = str_replace(' ', '-', $data3->full_name) . '-R_TBC_Certificate.pdf';
$file = $path . '/pdf/temp_certificate/' . $proposal_id . '_' . $filename;
$pdf->Output($file, 'F');
- header("Content-Type: application/octet-stream");
- header("Content-Disposition: attachment; filename=" . $filename);
- header("Content-Type: application/octet-stream");
- header("Content-Type: application/download");
+ ob_clean();
+ header("Pragma: public");
+ header("Expires: 0");
+ header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
+ header("Cache-Control: public");
header("Content-Description: File Transfer");
+ header("Content-Type: application/pdf");
+ header("Content-Disposition: attachment; filename=" . $filename);
header("Content-Length: " . filesize($file));
+ header("Content-Transfer-Encoding: binary");
+ header("Expires: 0");
+ header("Pragma: no-cache");
flush();
$fp = fopen($file, "r");
while (!feof($fp)) {
- echo fread($fp, 65536);
+ echo fread($fp, filesize($file));
flush();
} //!feof($fp)
+ ob_end_flush();
+ ob_clean();
fclose($fp);
unlink($file);
+ return;
/*}
else
{
diff --git a/pdf/images/bg_cert.png b/pdf/images/bg_cert.png
new file mode 100644
index 0000000..9e255a4
--- /dev/null
+++ b/pdf/images/bg_cert.png
Binary files differ
diff --git a/pdf/images/ftr_line.png b/pdf/images/ftr_line.png
new file mode 100644
index 0000000..9e255a4
--- /dev/null
+++ b/pdf/images/ftr_line.png
Binary files differ
diff --git a/pdf/images/mhrd.png b/pdf/images/mhrd.png
new file mode 100644
index 0000000..9e255a4
--- /dev/null
+++ b/pdf/images/mhrd.png
Binary files differ
diff --git a/pdf/images/sign1.png b/pdf/images/sign1.png
new file mode 100644
index 0000000..9e255a4
--- /dev/null
+++ b/pdf/images/sign1.png
Binary files differ
diff --git a/pdf/images/sign2.png b/pdf/images/sign2.png
new file mode 100644
index 0000000..9e255a4
--- /dev/null
+++ b/pdf/images/sign2.png
Binary files differ