You are here

function rtf::setPaperSize in Bibliography Module 6

Same name and namespace in other branches
  1. 6.2 modules/rtf/rtf_export.inc \rtf::setPaperSize()
  2. 7 modules/rtf/rtf_export.inc \rtf::setPaperSize()
  3. 7.2 modules/rtf/rtf_export.inc \rtf::setPaperSize()
1 call to rtf::setPaperSize()
rtf::rtf in ./class_rtf.php

File

./class_rtf.php, line 86

Class

rtf

Code

function setPaperSize($size = 0) {

  // 1 => Letter (8.5 x 11 inch)
  // 2 => Legal (8.5 x 14 inch)
  // 3 => Executive (7.25 x 10.5 inch)
  // 4 => A3 (297 x 420 mm)
  // 5 => A4 (210 x 297 mm)
  // 6 => A5 (148 x 210 mm)
  // Orientation considered as Portrait
  switch ($size) {
    case 1:
      $this->page_width = floor(8.5 * $this->inch);
      $this->page_height = floor(11 * $this->inch);
      $this->page_size = 1;
      break;
    case 2:
      $this->page_width = floor(8.5 * $this->inch);
      $this->page_height = floor(14 * $this->inch);
      $this->page_size = 5;
      break;
    case 3:
      $this->page_width = floor(7.25 * $this->inch);
      $this->page_height = floor(10.5 * $this->inch);
      $this->page_size = 7;
      break;
    case 4:
      $this->page_width = floor(297 * $this->mm);
      $this->page_height = floor(420 * $this->mm);
      $this->page_size = 8;
      break;
    case 5:
    default:
      $this->page_width = floor(210 * $this->mm);
      $this->page_height = floor(297 * $this->mm);
      $this->page_size = 9;
      break;
    case 6:
      $this->page_width = floor(148 * $this->mm);
      $this->page_height = floor(210 * $this->mm);
      $this->page_size = 10;
      break;
  }
}