Exemplo n.º 1
0
 /**
  * Create a new page for drawing characters on; already contains title, selection circles, fold line and credits
  *
  * @return \SimplePdf\Page new page, with static info on it, but without characters
  */
 protected function createPage()
 {
     $page = new \SimplePdf\Page(\SimplePdf\Page::SIZE_A4, \SimplePdf\Page::UNITS_CENTIMETER);
     $page->setFont($this->getFont());
     $page->setMargins(0.8, 0.8, 2.0, 4.2);
     // Draw the title
     $page->setFontSize(12);
     $page->drawTextBlock($this->getTitle(), 0, \SimplePdf\Page::TEXT_ALIGN_RIGHT);
     // Draw the 2 selection circles
     $page->setLineWidth(1.0);
     for ($circleIndex = 0; $circleIndex < 2; $circleIndex++) {
         $page->drawCircle(0.6, $circleIndex * 2.5 + 1.8, 0.15, \SimplePdf\Page::SHAPE_DRAW_STROKE);
     }
     // Draw the fold line, together with the fold instruction and credits
     $page->setLineWidth(0.5);
     $page->setLineDashingPattern(array(10, 4));
     $page->drawLine(0, $page->getInnerHeight(), $page->getInnerWidth(), $page->getInnerHeight());
     $page->setLineDashingPattern(\SimplePdf\Page::LINE_DASHING_SOLID);
     $page->setFontSize(8);
     $page->drawTextBlock(' ' . $this->getFoldInstruction(), $page->getInnerHeight() + 0.1);
     $page->drawTextBlock($this->getCredits() . ' ', $page->getInnerHeight() + 0.1, \SimplePdf\Page::TEXT_ALIGN_RIGHT);
     return $page;
 }