예제 #1
0
 /**
  * @param Session $session
  * @return ProgramPdf
  */
 public function __invoke(Session $session)
 {
     $pdf = new ProgramPdf();
     $pdf->setTemplate($this->getModuleOptions()->getBlankTemplate());
     $pdf->addPage();
     $pdf->SetFontSize(8);
     $pdf->SetTopMargin(30);
     $pdf->writeHTMLCell(0, 0, '', '', '<h1 style="color: #00a651">' . $session->getSession() . '</h1>', 0, 1, 0, true, '', true);
     $pdf->writeHTMLCell(0, 0, '', '', $session->getDate()->format("d-m-Y"), 0, 1, 0, true, '', true);
     $pdf->Ln();
     $pdf->Line(10, 42, 200, 42, ['color' => [0, 166, 81]]);
     $pdf->Ln();
     //Funding information
     $header = [$this->translate("txt-time"), $this->translate("txt-no"), $this->translate("txt-idea"), $this->translate("txt-title"), $this->translate("txt-presenter")];
     $pitches = [];
     foreach ($session->getIdeaSession() as $ideaSession) {
         $pitches[] = [$ideaSession->getSchedule(), $ideaSession->getIdea()->getNumber(), $ideaSession->getIdea()->getIdea(), $ideaSession->getIdea()->getTitle(), $ideaSession->getIdea()->getContact()->getDisplayName()];
     }
     $pdf->coloredTable($header, $pitches, [15, 10, 25, 110, 30]);
     return $pdf;
 }
예제 #2
0
 /**
  * @param Doa $doa
  *
  * @return ProgramPdf
  */
 public function renderForDoa(Doa $doa)
 {
     $pdf = new ProgramPdf();
     $pdf->setTemplate($this->getModuleOptions()->getDoaTemplate());
     $pdf->addPage();
     $pdf->SetFontSize(9);
     $twig = $this->getServiceLocator()->get('ZfcTwigRenderer');
     /*
      * Write the contact details
      */
     $contactService = $this->getContactService()->setContact($doa->getContact());
     $pdf->SetXY(14, 55);
     $pdf->Write(0, $contactService->parseFullName());
     $pdf->SetXY(14, 60);
     $pdf->Write(0, $contactService->parseOrganisation());
     /*
      * Write the current date
      */
     $pdf->SetXY(77, 55);
     $pdf->Write(0, date("Y-m-d"));
     /*
      * Write the Reference
      */
     $pdf->SetXY(118, 55);
     /*
      * Use the NDA object to render the filename
      */
     $pdf->Write(0, $doa->parseFileName());
     $ndaContent = $twig->render('program/pdf/doa-program', ['contact' => $doa->getContact(), 'program' => $doa->getProgram()]);
     $pdf->writeHTMLCell(0, 0, 14, 70, $ndaContent);
     /*
      * Signage block
      */
     $pdf->SetXY(14, 250);
     $pdf->Write(0, 'Undersigned');
     $pdf->SetXY(14, 260);
     $pdf->Write(0, 'Name:');
     $pdf->SetXY(100, 260);
     $pdf->Write(0, 'Date of Signature:');
     $pdf->SetXY(14, 270);
     $pdf->Write(0, 'Function:');
     $pdf->SetXY(100, 270);
     $pdf->Write(0, 'Signature:');
     $pdf->Line(130, 275, 190, 275);
     $pdf->Line(30, 265, 90, 265);
     $pdf->Line(130, 265, 190, 265);
     $pdf->Line(30, 275, 90, 275);
     return $pdf;
 }