abstract class PHPExcel_Writer_PDF_Core in Loft Data Grids 7.2
Same name and namespace in other branches
- 6.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Writer/PDF/Core.php \PHPExcel_Writer_PDF_Core
PHPExcel_Writer_PDF_Core
@category PHPExcel @package PHPExcel_Writer_PDF @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
Hierarchy
- class \PHPExcel_Writer_Abstract implements PHPExcel_Writer_IWriter
- class \PHPExcel_Writer_HTML implements PHPExcel_Writer_IWriter
- class \PHPExcel_Writer_PDF_Core
- class \PHPExcel_Writer_HTML implements PHPExcel_Writer_IWriter
Expanded class hierarchy of PHPExcel_Writer_PDF_Core
File
- vendor/
phpoffice/ phpexcel/ Classes/ PHPExcel/ Writer/ PDF/ Core.php, line 36
View source
abstract class PHPExcel_Writer_PDF_Core extends PHPExcel_Writer_HTML {
/**
* Temporary storage directory
*
* @var string
*/
protected $_tempDir = '';
/**
* Font
*
* @var string
*/
protected $_font = 'freesans';
/**
* Orientation (Over-ride)
*
* @var string
*/
protected $_orientation = NULL;
/**
* Paper size (Over-ride)
*
* @var int
*/
protected $_paperSize = NULL;
/**
* Temporary storage for Save Array Return type
*
* @var string
*/
private $_saveArrayReturnType;
/**
* Paper Sizes xRef List
*
* @var array
*/
protected static $_paperSizes = array(
PHPExcel_Worksheet_PageSetup::PAPERSIZE_LETTER => 'LETTER',
// (8.5 in. by 11 in.)
PHPExcel_Worksheet_PageSetup::PAPERSIZE_LETTER_SMALL => 'LETTER',
// (8.5 in. by 11 in.)
PHPExcel_Worksheet_PageSetup::PAPERSIZE_TABLOID => array(
792.0,
1224.0,
),
// (11 in. by 17 in.)
PHPExcel_Worksheet_PageSetup::PAPERSIZE_LEDGER => array(
1224.0,
792.0,
),
// (17 in. by 11 in.)
PHPExcel_Worksheet_PageSetup::PAPERSIZE_LEGAL => 'LEGAL',
// (8.5 in. by 14 in.)
PHPExcel_Worksheet_PageSetup::PAPERSIZE_STATEMENT => array(
396.0,
612.0,
),
// (5.5 in. by 8.5 in.)
PHPExcel_Worksheet_PageSetup::PAPERSIZE_EXECUTIVE => 'EXECUTIVE',
// (7.25 in. by 10.5 in.)
PHPExcel_Worksheet_PageSetup::PAPERSIZE_A3 => 'A3',
// (297 mm by 420 mm)
PHPExcel_Worksheet_PageSetup::PAPERSIZE_A4 => 'A4',
// (210 mm by 297 mm)
PHPExcel_Worksheet_PageSetup::PAPERSIZE_A4_SMALL => 'A4',
// (210 mm by 297 mm)
PHPExcel_Worksheet_PageSetup::PAPERSIZE_A5 => 'A5',
// (148 mm by 210 mm)
PHPExcel_Worksheet_PageSetup::PAPERSIZE_B4 => 'B4',
// (250 mm by 353 mm)
PHPExcel_Worksheet_PageSetup::PAPERSIZE_B5 => 'B5',
// (176 mm by 250 mm)
PHPExcel_Worksheet_PageSetup::PAPERSIZE_FOLIO => 'FOLIO',
// (8.5 in. by 13 in.)
PHPExcel_Worksheet_PageSetup::PAPERSIZE_QUARTO => array(
609.45,
779.53,
),
// (215 mm by 275 mm)
PHPExcel_Worksheet_PageSetup::PAPERSIZE_STANDARD_1 => array(
720.0,
1008.0,
),
// (10 in. by 14 in.)
PHPExcel_Worksheet_PageSetup::PAPERSIZE_STANDARD_2 => array(
792.0,
1224.0,
),
// (11 in. by 17 in.)
PHPExcel_Worksheet_PageSetup::PAPERSIZE_NOTE => 'LETTER',
// (8.5 in. by 11 in.)
PHPExcel_Worksheet_PageSetup::PAPERSIZE_NO9_ENVELOPE => array(
279.0,
639.0,
),
// (3.875 in. by 8.875 in.)
PHPExcel_Worksheet_PageSetup::PAPERSIZE_NO10_ENVELOPE => array(
297.0,
684.0,
),
// (4.125 in. by 9.5 in.)
PHPExcel_Worksheet_PageSetup::PAPERSIZE_NO11_ENVELOPE => array(
324.0,
747.0,
),
// (4.5 in. by 10.375 in.)
PHPExcel_Worksheet_PageSetup::PAPERSIZE_NO12_ENVELOPE => array(
342.0,
792.0,
),
// (4.75 in. by 11 in.)
PHPExcel_Worksheet_PageSetup::PAPERSIZE_NO14_ENVELOPE => array(
360.0,
828.0,
),
// (5 in. by 11.5 in.)
PHPExcel_Worksheet_PageSetup::PAPERSIZE_C => array(
1224.0,
1584.0,
),
// (17 in. by 22 in.)
PHPExcel_Worksheet_PageSetup::PAPERSIZE_D => array(
1584.0,
2448.0,
),
// (22 in. by 34 in.)
PHPExcel_Worksheet_PageSetup::PAPERSIZE_E => array(
2448.0,
3168.0,
),
// (34 in. by 44 in.)
PHPExcel_Worksheet_PageSetup::PAPERSIZE_DL_ENVELOPE => array(
311.81,
623.62,
),
// (110 mm by 220 mm)
PHPExcel_Worksheet_PageSetup::PAPERSIZE_C5_ENVELOPE => 'C5',
// (162 mm by 229 mm)
PHPExcel_Worksheet_PageSetup::PAPERSIZE_C3_ENVELOPE => 'C3',
// (324 mm by 458 mm)
PHPExcel_Worksheet_PageSetup::PAPERSIZE_C4_ENVELOPE => 'C4',
// (229 mm by 324 mm)
PHPExcel_Worksheet_PageSetup::PAPERSIZE_C6_ENVELOPE => 'C6',
// (114 mm by 162 mm)
PHPExcel_Worksheet_PageSetup::PAPERSIZE_C65_ENVELOPE => array(
323.15,
649.13,
),
// (114 mm by 229 mm)
PHPExcel_Worksheet_PageSetup::PAPERSIZE_B4_ENVELOPE => 'B4',
// (250 mm by 353 mm)
PHPExcel_Worksheet_PageSetup::PAPERSIZE_B5_ENVELOPE => 'B5',
// (176 mm by 250 mm)
PHPExcel_Worksheet_PageSetup::PAPERSIZE_B6_ENVELOPE => array(
498.9,
354.33,
),
// (176 mm by 125 mm)
PHPExcel_Worksheet_PageSetup::PAPERSIZE_ITALY_ENVELOPE => array(
311.81,
651.97,
),
// (110 mm by 230 mm)
PHPExcel_Worksheet_PageSetup::PAPERSIZE_MONARCH_ENVELOPE => array(
279.0,
540.0,
),
// (3.875 in. by 7.5 in.)
PHPExcel_Worksheet_PageSetup::PAPERSIZE_6_3_4_ENVELOPE => array(
261.0,
468.0,
),
// (3.625 in. by 6.5 in.)
PHPExcel_Worksheet_PageSetup::PAPERSIZE_US_STANDARD_FANFOLD => array(
1071.0,
792.0,
),
// (14.875 in. by 11 in.)
PHPExcel_Worksheet_PageSetup::PAPERSIZE_GERMAN_STANDARD_FANFOLD => array(
612.0,
864.0,
),
// (8.5 in. by 12 in.)
PHPExcel_Worksheet_PageSetup::PAPERSIZE_GERMAN_LEGAL_FANFOLD => 'FOLIO',
// (8.5 in. by 13 in.)
PHPExcel_Worksheet_PageSetup::PAPERSIZE_ISO_B4 => 'B4',
// (250 mm by 353 mm)
PHPExcel_Worksheet_PageSetup::PAPERSIZE_JAPANESE_DOUBLE_POSTCARD => array(
566.9299999999999,
419.53,
),
// (200 mm by 148 mm)
PHPExcel_Worksheet_PageSetup::PAPERSIZE_STANDARD_PAPER_1 => array(
648.0,
792.0,
),
// (9 in. by 11 in.)
PHPExcel_Worksheet_PageSetup::PAPERSIZE_STANDARD_PAPER_2 => array(
720.0,
792.0,
),
// (10 in. by 11 in.)
PHPExcel_Worksheet_PageSetup::PAPERSIZE_STANDARD_PAPER_3 => array(
1080.0,
792.0,
),
// (15 in. by 11 in.)
PHPExcel_Worksheet_PageSetup::PAPERSIZE_INVITE_ENVELOPE => array(
623.62,
623.62,
),
// (220 mm by 220 mm)
PHPExcel_Worksheet_PageSetup::PAPERSIZE_LETTER_EXTRA_PAPER => array(
667.8,
864.0,
),
// (9.275 in. by 12 in.)
PHPExcel_Worksheet_PageSetup::PAPERSIZE_LEGAL_EXTRA_PAPER => array(
667.8,
1080.0,
),
// (9.275 in. by 15 in.)
PHPExcel_Worksheet_PageSetup::PAPERSIZE_TABLOID_EXTRA_PAPER => array(
841.6799999999999,
1296.0,
),
// (11.69 in. by 18 in.)
PHPExcel_Worksheet_PageSetup::PAPERSIZE_A4_EXTRA_PAPER => array(
668.98,
912.76,
),
// (236 mm by 322 mm)
PHPExcel_Worksheet_PageSetup::PAPERSIZE_LETTER_TRANSVERSE_PAPER => array(
595.8,
792.0,
),
// (8.275 in. by 11 in.)
PHPExcel_Worksheet_PageSetup::PAPERSIZE_A4_TRANSVERSE_PAPER => 'A4',
// (210 mm by 297 mm)
PHPExcel_Worksheet_PageSetup::PAPERSIZE_LETTER_EXTRA_TRANSVERSE_PAPER => array(
667.8,
864.0,
),
// (9.275 in. by 12 in.)
PHPExcel_Worksheet_PageSetup::PAPERSIZE_SUPERA_SUPERA_A4_PAPER => array(
643.46,
1009.13,
),
// (227 mm by 356 mm)
PHPExcel_Worksheet_PageSetup::PAPERSIZE_SUPERB_SUPERB_A3_PAPER => array(
864.5700000000001,
1380.47,
),
// (305 mm by 487 mm)
PHPExcel_Worksheet_PageSetup::PAPERSIZE_LETTER_PLUS_PAPER => array(
612.0,
913.6799999999999,
),
// (8.5 in. by 12.69 in.)
PHPExcel_Worksheet_PageSetup::PAPERSIZE_A4_PLUS_PAPER => array(
595.28,
935.4299999999999,
),
// (210 mm by 330 mm)
PHPExcel_Worksheet_PageSetup::PAPERSIZE_A5_TRANSVERSE_PAPER => 'A5',
// (148 mm by 210 mm)
PHPExcel_Worksheet_PageSetup::PAPERSIZE_JIS_B5_TRANSVERSE_PAPER => array(
515.91,
728.5,
),
// (182 mm by 257 mm)
PHPExcel_Worksheet_PageSetup::PAPERSIZE_A3_EXTRA_PAPER => array(
912.76,
1261.42,
),
// (322 mm by 445 mm)
PHPExcel_Worksheet_PageSetup::PAPERSIZE_A5_EXTRA_PAPER => array(
493.23,
666.14,
),
// (174 mm by 235 mm)
PHPExcel_Worksheet_PageSetup::PAPERSIZE_ISO_B5_EXTRA_PAPER => array(
569.76,
782.36,
),
// (201 mm by 276 mm)
PHPExcel_Worksheet_PageSetup::PAPERSIZE_A2_PAPER => 'A2',
// (420 mm by 594 mm)
PHPExcel_Worksheet_PageSetup::PAPERSIZE_A3_TRANSVERSE_PAPER => 'A3',
// (297 mm by 420 mm)
PHPExcel_Worksheet_PageSetup::PAPERSIZE_A3_EXTRA_TRANSVERSE_PAPER => array(
912.76,
1261.42,
),
);
/**
* Create a new PHPExcel_Writer_PDF
*
* @param PHPExcel $phpExcel PHPExcel object
*/
public function __construct(PHPExcel $phpExcel) {
parent::__construct($phpExcel);
$this
->setUseInlineCss(TRUE);
$this->_tempDir = PHPExcel_Shared_File::sys_get_temp_dir();
}
/**
* Get Font
*
* @return string
*/
public function getFont() {
return $this->_font;
}
/**
* Set font. Examples:
* 'arialunicid0-chinese-simplified'
* 'arialunicid0-chinese-traditional'
* 'arialunicid0-korean'
* 'arialunicid0-japanese'
*
* @param string $fontName
*/
public function setFont($fontName) {
$this->_font = $fontName;
return $this;
}
/**
* Get Paper Size
*
* @return int
*/
public function getPaperSize() {
return $this->_paperSize;
}
/**
* Set Paper Size
*
* @param string $pValue Paper size
* @return PHPExcel_Writer_PDF
*/
public function setPaperSize($pValue = PHPExcel_Worksheet_PageSetup::PAPERSIZE_LETTER) {
$this->_paperSize = $pValue;
return $this;
}
/**
* Get Orientation
*
* @return string
*/
public function getOrientation() {
return $this->_orientation;
}
/**
* Set Orientation
*
* @param string $pValue Page orientation
* @return PHPExcel_Writer_PDF
*/
public function setOrientation($pValue = PHPExcel_Worksheet_PageSetup::ORIENTATION_DEFAULT) {
$this->_orientation = $pValue;
return $this;
}
/**
* Get temporary storage directory
*
* @return string
*/
public function getTempDir() {
return $this->_tempDir;
}
/**
* Set temporary storage directory
*
* @param string $pValue Temporary storage directory
* @throws PHPExcel_Writer_Exception when directory does not exist
* @return PHPExcel_Writer_PDF
*/
public function setTempDir($pValue = '') {
if (is_dir($pValue)) {
$this->_tempDir = $pValue;
}
else {
throw new PHPExcel_Writer_Exception("Directory does not exist: {$pValue}");
}
return $this;
}
/**
* Save PHPExcel to PDF file, pre-save
*
* @param string $pFilename Name of the file to save as
* @throws PHPExcel_Writer_Exception
*/
protected function prepareForSave($pFilename = NULL) {
// garbage collect
$this->_phpExcel
->garbageCollect();
$this->_saveArrayReturnType = PHPExcel_Calculation::getArrayReturnType();
PHPExcel_Calculation::setArrayReturnType(PHPExcel_Calculation::RETURN_ARRAY_AS_VALUE);
// Open file
$fileHandle = fopen($pFilename, 'w');
if ($fileHandle === FALSE) {
throw new PHPExcel_Writer_Exception("Could not open file {$pFilename} for writing.");
}
// Set PDF
$this->_isPdf = TRUE;
// Build CSS
$this
->buildCSS(TRUE);
return $fileHandle;
}
/**
* Save PHPExcel to PDF file, post-save
*
* @param resource $fileHandle
* @throws PHPExcel_Writer_Exception
*/
protected function restoreStateAfterSave($fileHandle) {
// Close file
fclose($fileHandle);
PHPExcel_Calculation::setArrayReturnType($this->_saveArrayReturnType);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
PHPExcel_Writer_Abstract:: |
protected | property | * Disk caching directory * * | |
PHPExcel_Writer_Abstract:: |
protected | property | * Write charts that are defined in the workbook? * Identifies whether the Writer should write definitions for any charts that exist in the PHPExcel object; * * | |
PHPExcel_Writer_Abstract:: |
protected | property | * Pre-calculate formulas * Forces PHPExcel to recalculate all formulae in a workbook when saving, so that the pre-calculated values are * immediately available to MS Excel or other office spreadsheet viewer when opening the file * * | 1 |
PHPExcel_Writer_Abstract:: |
protected | property | * Use disk caching where possible? * * | |
PHPExcel_Writer_Abstract:: |
public | function | * Get disk caching directory * * | |
PHPExcel_Writer_Abstract:: |
public | function | * Write charts in workbook? * If this is true, then the Writer will write definitions for any charts that exist in the PHPExcel object. * If false (the default) it will ignore any charts defined in the PHPExcel object. * * | |
PHPExcel_Writer_Abstract:: |
public | function | Get Pre-Calculate Formulas flag * If this is true (the default), then the writer will recalculate all formulae in a workbook when saving, * so that the pre-calculated values are immediately available to MS Excel or other office… | |
PHPExcel_Writer_Abstract:: |
public | function | * Get use disk caching where possible? * * | |
PHPExcel_Writer_Abstract:: |
public | function | * Set write charts in workbook * Set to true, to advise the Writer to include any charts that exist in the PHPExcel object. * Set to false (the default) to ignore charts. * * | |
PHPExcel_Writer_Abstract:: |
public | function | Set Pre-Calculate Formulas * Set to true (the default) to advise the Writer to calculate all formulae on save * Set to false to prevent precalculation of formulae on save. | |
PHPExcel_Writer_Abstract:: |
public | function | * Set use disk caching where possible? * * | |
PHPExcel_Writer_HTML:: |
private | property | * Array of column widths in points * * | |
PHPExcel_Writer_HTML:: |
private | property | * Array of CSS styles * * | |
PHPExcel_Writer_HTML:: |
private | property | * Default font * * | |
PHPExcel_Writer_HTML:: |
private | property | * embed images, or link to images * * | |
PHPExcel_Writer_HTML:: |
private | property | * Generate the Navigation block * * | |
PHPExcel_Writer_HTML:: |
private | property | * Images root * * | |
PHPExcel_Writer_HTML:: |
private | property | * Excel cells that are upper-left corner in a cell merge * * | |
PHPExcel_Writer_HTML:: |
protected | property | * Is the current writer creating PDF? * * | |
PHPExcel_Writer_HTML:: |
private | property | * Excel cells that should not be written as HTML cells * * | |
PHPExcel_Writer_HTML:: |
private | property | * Excel rows that should not be written as HTML rows * * | |
PHPExcel_Writer_HTML:: |
protected | property | * PHPExcel object * * | |
PHPExcel_Writer_HTML:: |
private | property | * Sheet index to write * * | |
PHPExcel_Writer_HTML:: |
private | property | * Flag whether spans have been calculated * * | |
PHPExcel_Writer_HTML:: |
private | property | * Use inline CSS? * * | |
PHPExcel_Writer_HTML:: |
public | function | * Build CSS styles * * | |
PHPExcel_Writer_HTML:: |
public | function | * Add color to formatted string as inline style * * | |
PHPExcel_Writer_HTML:: |
public | function | * Generate HTML footer | |
PHPExcel_Writer_HTML:: |
public | function | * Generate HTML header * * | |
PHPExcel_Writer_HTML:: |
public | function | * Generate sheet tabs * * | |
PHPExcel_Writer_HTML:: |
public | function | * Generate sheet data * * | |
PHPExcel_Writer_HTML:: |
public | function | * Generate CSS styles * * | |
PHPExcel_Writer_HTML:: |
public | function | * Get embed images * * | |
PHPExcel_Writer_HTML:: |
public | function | * Get sheet index * * | |
PHPExcel_Writer_HTML:: |
public | function | * Get images root * * | |
PHPExcel_Writer_HTML:: |
public | function | * Get sheet index * * | |
PHPExcel_Writer_HTML:: |
public | function | * Get use inline CSS? * * | |
PHPExcel_Writer_HTML:: |
public | function |
* Save PHPExcel to file
*
* Overrides PHPExcel_Writer_IWriter:: |
3 |
PHPExcel_Writer_HTML:: |
public | function | * Set embed images * * | |
PHPExcel_Writer_HTML:: |
public | function | * Set sheet index * * | |
PHPExcel_Writer_HTML:: |
public | function | * Set images root * * | |
PHPExcel_Writer_HTML:: |
public | function | * Set sheet index * * | |
PHPExcel_Writer_HTML:: |
public | function | * Set use inline CSS? * * | |
PHPExcel_Writer_HTML:: |
public | function | * Write all sheets (resets sheetIndex to NULL) | |
PHPExcel_Writer_HTML:: |
private | function | * Takes array where of CSS properties / values and converts to CSS string * * | |
PHPExcel_Writer_HTML:: |
private | function | * Calculate information about HTML colspan and rowspan which is not always the same as Excel's | |
PHPExcel_Writer_HTML:: |
private | function | * Create CSS style * * | |
PHPExcel_Writer_HTML:: |
private | function | * Create CSS style (PHPExcel_Style_Alignment) * * | |
PHPExcel_Writer_HTML:: |
private | function | * Create CSS style (PHPExcel_Style_Border) * * | |
PHPExcel_Writer_HTML:: |
private | function | * Create CSS style (PHPExcel_Style_Borders) * * | |
PHPExcel_Writer_HTML:: |
private | function | * Create CSS style (PHPExcel_Style_Fill) * * | |
PHPExcel_Writer_HTML:: |
private | function | * Create CSS style (PHPExcel_Style_Font) * * | |
PHPExcel_Writer_HTML:: |
private | function | ||
PHPExcel_Writer_HTML:: |
private | function | * Generate row * * | |
PHPExcel_Writer_HTML:: |
private | function | * Generate table footer * * | |
PHPExcel_Writer_HTML:: |
private | function | * Generate table header * * | |
PHPExcel_Writer_HTML:: |
private | function | * Map border style * * | |
PHPExcel_Writer_HTML:: |
private | function | * Map HAlign * * | |
PHPExcel_Writer_HTML:: |
private | function | * Map VAlign * * | |
PHPExcel_Writer_HTML:: |
private | function | ||
PHPExcel_Writer_HTML:: |
private | function | * Generate chart tag in cell * * | |
PHPExcel_Writer_HTML:: |
private | function | * Generate image tag in cell * * | |
PHPExcel_Writer_PDF_Core:: |
protected | property | Font | |
PHPExcel_Writer_PDF_Core:: |
protected | property | Orientation (Over-ride) | |
PHPExcel_Writer_PDF_Core:: |
protected | property | Paper size (Over-ride) | |
PHPExcel_Writer_PDF_Core:: |
protected static | property | Paper Sizes xRef List | |
PHPExcel_Writer_PDF_Core:: |
private | property | Temporary storage for Save Array Return type | |
PHPExcel_Writer_PDF_Core:: |
protected | property | Temporary storage directory | |
PHPExcel_Writer_PDF_Core:: |
public | function | Get Font | |
PHPExcel_Writer_PDF_Core:: |
public | function | Get Orientation | |
PHPExcel_Writer_PDF_Core:: |
public | function | Get Paper Size | |
PHPExcel_Writer_PDF_Core:: |
public | function | Get temporary storage directory | |
PHPExcel_Writer_PDF_Core:: |
protected | function | Save PHPExcel to PDF file, pre-save | |
PHPExcel_Writer_PDF_Core:: |
protected | function | Save PHPExcel to PDF file, post-save | |
PHPExcel_Writer_PDF_Core:: |
public | function | Set font. Examples: 'arialunicid0-chinese-simplified' 'arialunicid0-chinese-traditional' 'arialunicid0-korean' 'arialunicid0-japanese' | |
PHPExcel_Writer_PDF_Core:: |
public | function | Set Orientation | |
PHPExcel_Writer_PDF_Core:: |
public | function | Set Paper Size | |
PHPExcel_Writer_PDF_Core:: |
public | function | Set temporary storage directory | |
PHPExcel_Writer_PDF_Core:: |
public | function |
Create a new PHPExcel_Writer_PDF Overrides PHPExcel_Writer_HTML:: |
3 |