diff --git a/docs/index.md b/docs/index.md index ac8963b7..0e3d6806 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1542,7 +1542,7 @@ fast distribution of represented data. **PDF limitations** Please note that PDF file format has some limits regarding to styling cells, number formatting, ... -### \PhpOffice\PhpSpreadsheet\Writer\PDF +### \PhpOffice\PhpSpreadsheet\Writer\Pdf PhpSpreadsheet’s PDF Writer is a wrapper for a 3rd-Party PDF Rendering 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: ``` php -$writer = new \PhpOffice\PhpSpreadsheet\Writer\PDF($spreadsheet); +$writer = new \PhpOffice\PhpSpreadsheet\Writer\Pdf($spreadsheet); $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. #### 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: ``` php -$writer = new \PhpOffice\PhpSpreadsheet\Writer\PDF($spreadsheet); +$writer = new \PhpOffice\PhpSpreadsheet\Writer\Pdf($spreadsheet); $writer->setPreCalculateFormulas(false); $writer->save("05featuredemo.pdf"); diff --git a/samples/21_Pdf_Domdf.php b/samples/21_Pdf_Domdf.php index 638cb2cc..44d6e972 100644 --- a/samples/21_Pdf_Domdf.php +++ b/samples/21_Pdf_Domdf.php @@ -14,4 +14,4 @@ $helper->log("Write to PDF format using {$rendererName}"); \PhpOffice\PhpSpreadsheet\Settings::setPdfRendererName($rendererName); // Save -$helper->write($spreadsheet, __FILE__, ['PDF' => 'pdf']); +$helper->write($spreadsheet, __FILE__, ['Pdf' => 'pdf']); diff --git a/samples/21_Pdf_TCPDF.php b/samples/21_Pdf_TCPDF.php index 5c25fe72..53eda62a 100644 --- a/samples/21_Pdf_TCPDF.php +++ b/samples/21_Pdf_TCPDF.php @@ -14,4 +14,4 @@ $helper->log("Write to PDF format using {$rendererName}"); \PhpOffice\PhpSpreadsheet\Settings::setPdfRendererName($rendererName); // Save -$helper->write($spreadsheet, __FILE__, ['PDF' => 'pdf']); +$helper->write($spreadsheet, __FILE__, ['Pdf' => 'pdf']); diff --git a/samples/21_Pdf_mPDF.php b/samples/21_Pdf_mPDF.php index 5c7cc1b0..f2734966 100644 --- a/samples/21_Pdf_mPDF.php +++ b/samples/21_Pdf_mPDF.php @@ -14,4 +14,4 @@ $helper->log("Write to PDF format using {$rendererName}"); \PhpOffice\PhpSpreadsheet\Settings::setPdfRendererName($rendererName); // Save -$helper->write($spreadsheet, __FILE__, ['PDF' => 'pdf']); +$helper->write($spreadsheet, __FILE__, ['Pdf' => 'pdf']); diff --git a/samples/26_Utf8.php b/samples/26_Utf8.php index caf2a6e6..6925f567 100644 --- a/samples/26_Utf8.php +++ b/samples/26_Utf8.php @@ -19,7 +19,7 @@ $helper->write($spreadsheet, __FILE__, ['Xlsx' => 'xlsx', 'Xls' => 'xls', 'HTML' // Export to PDF (.pdf) $helper->log('Write to PDF format'); \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 $helper->log('Removing first two heading rows for CSV export'); diff --git a/src/PhpSpreadsheet/Helper/Migrator.php b/src/PhpSpreadsheet/Helper/Migrator.php index 0b56d903..3912e48f 100644 --- a/src/PhpSpreadsheet/Helper/Migrator.php +++ b/src/PhpSpreadsheet/Helper/Migrator.php @@ -60,10 +60,10 @@ class Migrator 'PHPExcel_Writer_OpenDocument_Styles' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Ods\\Styles', 'PHPExcel_Writer_OpenDocument_Thumbnails' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Ods\\Thumbnails', 'PHPExcel_Writer_OpenDocument_WriterPart' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Ods\\WriterPart', - 'PHPExcel_Writer_PDF_Core' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\PDF\\Core', - 'PHPExcel_Writer_PDF_DomPDF' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\PDF\\DomPDF', - 'PHPExcel_Writer_PDF_mPDF' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\PDF\\MPDF', - 'PHPExcel_Writer_PDF_tcPDF' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\PDF\\TcPDF', + 'PHPExcel_Writer_PDF_Core' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Pdf\\Core', + 'PHPExcel_Writer_PDF_DomPDF' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Pdf\\DomPDF', + 'PHPExcel_Writer_PDF_mPDF' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Pdf\\MPDF', + 'PHPExcel_Writer_PDF_tcPDF' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Pdf\\TcPDF', 'PHPExcel_Writer_Excel5_BIFFwriter' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Xls\\BIFFwriter', 'PHPExcel_Writer_Excel5_Escher' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Xls\\Escher', 'PHPExcel_Writer_Excel5_Font' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Xls\\Font', @@ -201,7 +201,7 @@ class Migrator 'PHPExcel_Writer_HTML' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\HTML', 'PHPExcel_Writer_IWriter' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\IWriter', '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_Excel2007' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Xlsx', 'PHPExcel_CachedObjectStorageFactory' => '\\PhpOffice\\PhpSpreadsheet\\CachedObjectStorageFactory', diff --git a/src/PhpSpreadsheet/Shared/StringHelper.php b/src/PhpSpreadsheet/Shared/StringHelper.php index 0307ab5f..f73b28fd 100644 --- a/src/PhpSpreadsheet/Shared/StringHelper.php +++ b/src/PhpSpreadsheet/Shared/StringHelper.php @@ -745,7 +745,7 @@ class StringHelper /** * 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 */ @@ -778,7 +778,7 @@ class StringHelper /** * 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 */ @@ -816,7 +816,7 @@ class StringHelper /** * 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 */ diff --git a/src/PhpSpreadsheet/Writer/HTML.php b/src/PhpSpreadsheet/Writer/HTML.php index d8469cbd..c95d5ecc 100644 --- a/src/PhpSpreadsheet/Writer/HTML.php +++ b/src/PhpSpreadsheet/Writer/HTML.php @@ -1354,7 +1354,7 @@ class HTML extends BaseWriter implements IWriter if (!$this->useInlineCss) { $html .= ' class="' . $cssClass . '"'; } 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 element because TCPDF // does not recognize e.g. $width = 0; diff --git a/src/PhpSpreadsheet/Writer/PDF.php b/src/PhpSpreadsheet/Writer/Pdf.php similarity index 95% rename from src/PhpSpreadsheet/Writer/PDF.php rename to src/PhpSpreadsheet/Writer/Pdf.php index 2661a143..cb16dc6b 100644 --- a/src/PhpSpreadsheet/Writer/PDF.php +++ b/src/PhpSpreadsheet/Writer/Pdf.php @@ -26,7 +26,7 @@ use PhpOffice\PhpSpreadsheet\Spreadsheet; * @copyright Copyright (c) 2006 - 2015 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet) * @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. @@ -49,7 +49,7 @@ class PDF implements IWriter 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); } diff --git a/src/PhpSpreadsheet/Writer/PDF/Core.php b/src/PhpSpreadsheet/Writer/Pdf/Core.php similarity index 99% rename from src/PhpSpreadsheet/Writer/PDF/Core.php rename to src/PhpSpreadsheet/Writer/Pdf/Core.php index 3481697d..91fd7aa1 100644 --- a/src/PhpSpreadsheet/Writer/PDF/Core.php +++ b/src/PhpSpreadsheet/Writer/Pdf/Core.php @@ -1,6 +1,6 @@