Rename writer `PDF` to `Pdf` for consistency

This commit is contained in:
Adrien Crivelli 2017-01-22 00:58:48 +09:00
parent 035281f04c
commit 1cdc8531b8
No known key found for this signature in database
GPG Key ID: B182FD79DC6DE92E
13 changed files with 23 additions and 23 deletions

View File

@ -1542,7 +1542,7 @@ fast distribution of represented data.
**PDF limitations** Please note that PDF file format has some limits **PDF limitations** Please note that PDF file format has some limits
regarding to styling cells, number formatting, ... regarding to styling cells, number formatting, ...
### \PhpOffice\PhpSpreadsheet\Writer\PDF ### \PhpOffice\PhpSpreadsheet\Writer\Pdf
PhpSpreadsheets PDF Writer is a wrapper for a 3rd-Party PDF Rendering PhpSpreadsheets PDF Writer is a wrapper for a 3rd-Party PDF Rendering
library such as tcPDF, mPDF or DomPDF. You must now install a PDF library such as tcPDF, mPDF or DomPDF. You must now install a PDF
@ -1577,11 +1577,11 @@ Once you have identified the Renderer that you wish to use for PDF
generation, you can write a .pdf file using the following code: generation, you can write a .pdf file using the following code:
``` php ``` php
$writer = new \PhpOffice\PhpSpreadsheet\Writer\PDF($spreadsheet); $writer = new \PhpOffice\PhpSpreadsheet\Writer\Pdf($spreadsheet);
$writer->save("05featuredemo.pdf"); $writer->save("05featuredemo.pdf");
``` ```
Please note that \PhpOffice\PhpSpreadsheet\Writer\PDF only outputs the Please note that \PhpOffice\PhpSpreadsheet\Writer\Pdf only outputs the
first worksheet by default. first worksheet by default.
#### Write all worksheets #### Write all worksheets
@ -1609,7 +1609,7 @@ This can be slow on large spreadsheets, and maybe even unwanted. You can
however disable formula pre-calculation: however disable formula pre-calculation:
``` php ``` php
$writer = new \PhpOffice\PhpSpreadsheet\Writer\PDF($spreadsheet); $writer = new \PhpOffice\PhpSpreadsheet\Writer\Pdf($spreadsheet);
$writer->setPreCalculateFormulas(false); $writer->setPreCalculateFormulas(false);
$writer->save("05featuredemo.pdf"); $writer->save("05featuredemo.pdf");

View File

@ -14,4 +14,4 @@ $helper->log("Write to PDF format using {$rendererName}");
\PhpOffice\PhpSpreadsheet\Settings::setPdfRendererName($rendererName); \PhpOffice\PhpSpreadsheet\Settings::setPdfRendererName($rendererName);
// Save // Save
$helper->write($spreadsheet, __FILE__, ['PDF' => 'pdf']); $helper->write($spreadsheet, __FILE__, ['Pdf' => 'pdf']);

View File

@ -14,4 +14,4 @@ $helper->log("Write to PDF format using {$rendererName}");
\PhpOffice\PhpSpreadsheet\Settings::setPdfRendererName($rendererName); \PhpOffice\PhpSpreadsheet\Settings::setPdfRendererName($rendererName);
// Save // Save
$helper->write($spreadsheet, __FILE__, ['PDF' => 'pdf']); $helper->write($spreadsheet, __FILE__, ['Pdf' => 'pdf']);

View File

@ -14,4 +14,4 @@ $helper->log("Write to PDF format using {$rendererName}");
\PhpOffice\PhpSpreadsheet\Settings::setPdfRendererName($rendererName); \PhpOffice\PhpSpreadsheet\Settings::setPdfRendererName($rendererName);
// Save // Save
$helper->write($spreadsheet, __FILE__, ['PDF' => 'pdf']); $helper->write($spreadsheet, __FILE__, ['Pdf' => 'pdf']);

View File

@ -19,7 +19,7 @@ $helper->write($spreadsheet, __FILE__, ['Xlsx' => 'xlsx', 'Xls' => 'xls', 'HTML'
// Export to PDF (.pdf) // Export to PDF (.pdf)
$helper->log('Write to PDF format'); $helper->log('Write to PDF format');
\PhpOffice\PhpSpreadsheet\Settings::setPdfRendererName($rendererName); \PhpOffice\PhpSpreadsheet\Settings::setPdfRendererName($rendererName);
$helper->write($spreadsheet, __FILE__, ['PDF' => 'pdf']); $helper->write($spreadsheet, __FILE__, ['Pdf' => 'pdf']);
// Remove first two rows with field headers before exporting to CSV // Remove first two rows with field headers before exporting to CSV
$helper->log('Removing first two heading rows for CSV export'); $helper->log('Removing first two heading rows for CSV export');

View File

@ -60,10 +60,10 @@ class Migrator
'PHPExcel_Writer_OpenDocument_Styles' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Ods\\Styles', 'PHPExcel_Writer_OpenDocument_Styles' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Ods\\Styles',
'PHPExcel_Writer_OpenDocument_Thumbnails' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Ods\\Thumbnails', 'PHPExcel_Writer_OpenDocument_Thumbnails' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Ods\\Thumbnails',
'PHPExcel_Writer_OpenDocument_WriterPart' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Ods\\WriterPart', 'PHPExcel_Writer_OpenDocument_WriterPart' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Ods\\WriterPart',
'PHPExcel_Writer_PDF_Core' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\PDF\\Core', 'PHPExcel_Writer_PDF_Core' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Pdf\\Core',
'PHPExcel_Writer_PDF_DomPDF' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\PDF\\DomPDF', 'PHPExcel_Writer_PDF_DomPDF' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Pdf\\DomPDF',
'PHPExcel_Writer_PDF_mPDF' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\PDF\\MPDF', 'PHPExcel_Writer_PDF_mPDF' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Pdf\\MPDF',
'PHPExcel_Writer_PDF_tcPDF' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\PDF\\TcPDF', 'PHPExcel_Writer_PDF_tcPDF' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Pdf\\TcPDF',
'PHPExcel_Writer_Excel5_BIFFwriter' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Xls\\BIFFwriter', 'PHPExcel_Writer_Excel5_BIFFwriter' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Xls\\BIFFwriter',
'PHPExcel_Writer_Excel5_Escher' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Xls\\Escher', 'PHPExcel_Writer_Excel5_Escher' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Xls\\Escher',
'PHPExcel_Writer_Excel5_Font' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Xls\\Font', 'PHPExcel_Writer_Excel5_Font' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Xls\\Font',
@ -201,7 +201,7 @@ class Migrator
'PHPExcel_Writer_HTML' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\HTML', 'PHPExcel_Writer_HTML' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\HTML',
'PHPExcel_Writer_IWriter' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\IWriter', 'PHPExcel_Writer_IWriter' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\IWriter',
'PHPExcel_Writer_OpenDocument' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Ods', 'PHPExcel_Writer_OpenDocument' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Ods',
'PHPExcel_Writer_PDF' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\PDF', 'PHPExcel_Writer_PDF' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Pdf',
'PHPExcel_Writer_Excel5' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Xls', 'PHPExcel_Writer_Excel5' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Xls',
'PHPExcel_Writer_Excel2007' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Xlsx', 'PHPExcel_Writer_Excel2007' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Xlsx',
'PHPExcel_CachedObjectStorageFactory' => '\\PhpOffice\\PhpSpreadsheet\\CachedObjectStorageFactory', 'PHPExcel_CachedObjectStorageFactory' => '\\PhpOffice\\PhpSpreadsheet\\CachedObjectStorageFactory',

View File

@ -745,7 +745,7 @@ class StringHelper
/** /**
* Set the decimal separator. Only used by \PhpOffice\PhpSpreadsheet\Style\NumberFormat::toFormattedString() * Set the decimal separator. Only used by \PhpOffice\PhpSpreadsheet\Style\NumberFormat::toFormattedString()
* to format output by \PhpOffice\PhpSpreadsheet\Writer\HTML and \PhpOffice\PhpSpreadsheet\Writer\PDF. * to format output by \PhpOffice\PhpSpreadsheet\Writer\HTML and \PhpOffice\PhpSpreadsheet\Writer\Pdf.
* *
* @param string $pValue Character for decimal separator * @param string $pValue Character for decimal separator
*/ */
@ -778,7 +778,7 @@ class StringHelper
/** /**
* Set the thousands separator. Only used by \PhpOffice\PhpSpreadsheet\Style\NumberFormat::toFormattedString() * Set the thousands separator. Only used by \PhpOffice\PhpSpreadsheet\Style\NumberFormat::toFormattedString()
* to format output by \PhpOffice\PhpSpreadsheet\Writer\HTML and \PhpOffice\PhpSpreadsheet\Writer\PDF. * to format output by \PhpOffice\PhpSpreadsheet\Writer\HTML and \PhpOffice\PhpSpreadsheet\Writer\Pdf.
* *
* @param string $pValue Character for thousands separator * @param string $pValue Character for thousands separator
*/ */
@ -816,7 +816,7 @@ class StringHelper
/** /**
* Set the currency code. Only used by \PhpOffice\PhpSpreadsheet\Style\NumberFormat::toFormattedString() * Set the currency code. Only used by \PhpOffice\PhpSpreadsheet\Style\NumberFormat::toFormattedString()
* to format output by \PhpOffice\PhpSpreadsheet\Writer\HTML and \PhpOffice\PhpSpreadsheet\Writer\PDF. * to format output by \PhpOffice\PhpSpreadsheet\Writer\HTML and \PhpOffice\PhpSpreadsheet\Writer\Pdf.
* *
* @param string $pValue Character for currency code * @param string $pValue Character for currency code
*/ */

View File

@ -1354,7 +1354,7 @@ class HTML extends BaseWriter implements IWriter
if (!$this->useInlineCss) { if (!$this->useInlineCss) {
$html .= ' class="' . $cssClass . '"'; $html .= ' class="' . $cssClass . '"';
} else { } else {
//** Necessary redundant code for the sake of \PhpOffice\PhpSpreadsheet\Writer\PDF ** //** Necessary redundant code for the sake of \PhpOffice\PhpSpreadsheet\Writer\Pdf **
// We must explicitly write the width of the <td> element because TCPDF // We must explicitly write the width of the <td> element because TCPDF
// does not recognize e.g. <col style="width:42pt"> // does not recognize e.g. <col style="width:42pt">
$width = 0; $width = 0;

View File

@ -26,7 +26,7 @@ use PhpOffice\PhpSpreadsheet\Spreadsheet;
* @copyright Copyright (c) 2006 - 2015 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet) * @copyright Copyright (c) 2006 - 2015 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/ */
class PDF implements IWriter class Pdf implements IWriter
{ {
/** /**
* The wrapper for the requested PDF rendering engine. * The wrapper for the requested PDF rendering engine.
@ -49,7 +49,7 @@ class PDF implements IWriter
throw new Exception('PDF Rendering library has not been defined.'); throw new Exception('PDF Rendering library has not been defined.');
} }
$rendererName = '\\PhpOffice\\PhpSpreadsheet\\Writer\\PDF\\' . $pdfLibraryName; $rendererName = '\\PhpOffice\\PhpSpreadsheet\\Writer\\Pdf\\' . $pdfLibraryName;
$this->renderer = new $rendererName($spreadsheet); $this->renderer = new $rendererName($spreadsheet);
} }

View File

@ -1,6 +1,6 @@
<?php <?php
namespace PhpOffice\PhpSpreadsheet\Writer\PDF; namespace PhpOffice\PhpSpreadsheet\Writer\Pdf;
/** /**
* Copyright (c) 2006 - 2015 PhpSpreadsheet. * Copyright (c) 2006 - 2015 PhpSpreadsheet.

View File

@ -1,6 +1,6 @@
<?php <?php
namespace PhpOffice\PhpSpreadsheet\Writer\PDF; namespace PhpOffice\PhpSpreadsheet\Writer\Pdf;
/** /**
* Copyright (c) 2006 - 2015 PhpSpreadsheet. * Copyright (c) 2006 - 2015 PhpSpreadsheet.

View File

@ -1,6 +1,6 @@
<?php <?php
namespace PhpOffice\PhpSpreadsheet\Writer\PDF; namespace PhpOffice\PhpSpreadsheet\Writer\Pdf;
/** /**
* Copyright (c) 2006 - 2015 PhpSpreadsheet. * Copyright (c) 2006 - 2015 PhpSpreadsheet.

View File

@ -1,6 +1,6 @@
<?php <?php
namespace PhpOffice\PhpSpreadsheet\Writer\PDF; namespace PhpOffice\PhpSpreadsheet\Writer\Pdf;
/** /**
* Copyright (c) 2006 - 2015 PhpSpreadsheet. * Copyright (c) 2006 - 2015 PhpSpreadsheet.