From 53a58d01fb3d56347493f64c738ae61a99f6d507 Mon Sep 17 00:00:00 2001 From: Kartik Visweswaran Date: Sat, 13 Oct 2018 13:06:38 +0530 Subject: [PATCH] Updates to release v1.3.6 --- CHANGE.md | 6 ++++++ src/ExportColumnAsset.php | 2 +- src/ExportMenu.php | 4 ++-- src/ExportMenuAsset.php | 2 +- src/ExportWriterPdf.php | 17 ++++++----------- src/assets/css/kv-export-columns.css | 2 +- src/assets/css/kv-export-columns.min.css | 2 +- src/assets/js/kv-export-columns.js | 2 +- src/assets/js/kv-export-columns.min.js | 2 +- src/assets/js/kv-export-data.js | 2 +- src/assets/js/kv-export-data.min.js | 2 +- src/views/_columns.php | 2 +- src/views/_view.php | 2 +- 13 files changed, 24 insertions(+), 23 deletions(-) diff --git a/CHANGE.md b/CHANGE.md index 9cc13b7..dd623e0 100755 --- a/CHANGE.md +++ b/CHANGE.md @@ -1,6 +1,12 @@ Change Log: `yii2-export` ========================= +## version 1.3.6 + +**Date:** 13-Oct-2018 + +- Enhance `ExportWriterPdf` to allow custom formatting + ## version 1.3.5 **Date:** 13-Oct-2018 diff --git a/src/ExportColumnAsset.php b/src/ExportColumnAsset.php index 6a2be17..ab2b04d 100644 --- a/src/ExportColumnAsset.php +++ b/src/ExportColumnAsset.php @@ -3,7 +3,7 @@ /** * @copyright Copyright © Kartik Visweswaran, Krajee.com, 2015 - 2018 * @package yii2-export - * @version 1.3.5 + * @version 1.3.6 */ namespace kartik\export; diff --git a/src/ExportMenu.php b/src/ExportMenu.php index 189dc8c..9764df1 100644 --- a/src/ExportMenu.php +++ b/src/ExportMenu.php @@ -4,7 +4,7 @@ * @package yii2-export * @author Kartik Visweswaran * @copyright Copyright © Kartik Visweswaran, Krajee.com, 2015 - 2018 - * @version 1.3.5 + * @version 1.3.6 */ namespace kartik\export; @@ -272,7 +272,7 @@ class ExportMenu extends GridView public $noExportColumns = []; /** - * @var string the view file for rendering the export form. DEPRECATED since v1.3.4 (not parsed or used anymore). + * @var string the view file for rendering the export form. DEPRECATED since v1.3.5 (not parsed or used anymore). */ public $exportFormView = '_form'; diff --git a/src/ExportMenuAsset.php b/src/ExportMenuAsset.php index 5d54635..4d50a3a 100644 --- a/src/ExportMenuAsset.php +++ b/src/ExportMenuAsset.php @@ -3,7 +3,7 @@ /** * @copyright Copyright © Kartik Visweswaran, Krajee.com, 2015 - 2018 * @package yii2-export - * @version 1.3.5 + * @version 1.3.6 */ namespace kartik\export; diff --git a/src/ExportWriterPdf.php b/src/ExportWriterPdf.php index 33711f0..bf53420 100644 --- a/src/ExportWriterPdf.php +++ b/src/ExportWriterPdf.php @@ -3,7 +3,7 @@ /** * @copyright Copyright © Kartik Visweswaran, Krajee.com, 2015 - 2018 * @package yii2-export - * @version 1.3.5 + * @version 1.3.6 */ namespace kartik\export; @@ -48,13 +48,14 @@ protected function createExternalWriterInstance($config = []) * * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception * @throws PhpSpreadsheetException + * @throws \yii\base\InvalidConfigException */ public function save($pFilename) { $fileHandle = parent::prepareForSave($pFilename); // Default PDF paper size - $paperSize = 'LETTER'; // Letter (8.5"x11") + $paperSize = Pdf::FORMAT_A4; // Check for paper size and page orientation if (null === $this->getSheetIndex()) { @@ -89,25 +90,19 @@ public function save($pFilename) // Create PDF $pdf = $this->createExternalWriterInstance([ + 'format' => $paperSize, 'orientation' => $orientation, 'methods' => [ 'SetTitle' => $properties->getTitle(), 'SetAuthor' => $properties->getCreator(), 'SetSubject' => $properties->getSubject(), 'SetKeywords' => $properties->getKeywords(), - 'SetCreator' => $properties->getCreator(), + 'SetCreator' => $properties->getCreator() ], ]); - $ortmp = $orientation; - $lib = $pdf->getApi(); - /** @noinspection PhpUndefinedMethodInspection */ - $lib->_setPageSize(strtoupper($paperSize), $ortmp); - $lib->DefOrientation = $orientation; - /** @noinspection PhpUndefinedMethodInspection */ - $lib->AddPage($orientation); $content = $this->generateHTMLHeader(false) . $this->generateSheetData() . $this->generateHTMLFooter(); // Write to file - fwrite($fileHandle, $pdf->Output(static::cleanHTML($content), $this->filename, Pdf::DEST_STRING)); + fwrite($fileHandle, $pdf->output(static::cleanHTML($content), $this->filename, Pdf::DEST_STRING)); parent::restoreStateAfterSave($fileHandle); } diff --git a/src/assets/css/kv-export-columns.css b/src/assets/css/kv-export-columns.css index 3215f42..67599a3 100644 --- a/src/assets/css/kv-export-columns.css +++ b/src/assets/css/kv-export-columns.css @@ -2,7 +2,7 @@ * @package yii2-export * @author Kartik Visweswaran * @copyright Copyright © Kartik Visweswaran, Krajee.com, 2015 - 2018 - * @version 1.3.5 + * @version 1.3.6 * * Export Columns Selector Style Sheet * diff --git a/src/assets/css/kv-export-columns.min.css b/src/assets/css/kv-export-columns.min.css index 9be7b0f..eaec09b 100644 --- a/src/assets/css/kv-export-columns.min.css +++ b/src/assets/css/kv-export-columns.min.css @@ -2,7 +2,7 @@ * @package yii2-export * @author Kartik Visweswaran * @copyright Copyright © Kartik Visweswaran, Krajee.com, 2015 - 2018 - * @version 1.3.5 + * @version 1.3.6 * * Export Columns Selector Style Sheet * diff --git a/src/assets/js/kv-export-columns.js b/src/assets/js/kv-export-columns.js index 023d582..e75ceba 100644 --- a/src/assets/js/kv-export-columns.js +++ b/src/assets/js/kv-export-columns.js @@ -2,7 +2,7 @@ * @package yii2-export * @author Kartik Visweswaran * @copyright Copyright © Kartik Visweswaran, Krajee.com, 2015 - 2018 - * @version 1.3.5 + * @version 1.3.6 * * Export Columns Selector Validation Module. * diff --git a/src/assets/js/kv-export-columns.min.js b/src/assets/js/kv-export-columns.min.js index 3c8eac9..fd9dec4 100644 --- a/src/assets/js/kv-export-columns.min.js +++ b/src/assets/js/kv-export-columns.min.js @@ -2,7 +2,7 @@ * @package yii2-export * @author Kartik Visweswaran * @copyright Copyright © Kartik Visweswaran, Krajee.com, 2015 - 2018 - * @version 1.3.5 + * @version 1.3.6 * * Export Columns Selector Validation Module. * diff --git a/src/assets/js/kv-export-data.js b/src/assets/js/kv-export-data.js index 9827307..1c56584 100644 --- a/src/assets/js/kv-export-data.js +++ b/src/assets/js/kv-export-data.js @@ -2,7 +2,7 @@ * @package yii2-export * @author Kartik Visweswaran * @copyright Copyright © Kartik Visweswaran, Krajee.com, 2015 - 2018 - * @version 1.3.5 + * @version 1.3.6 * * Export Data Validation Module. * diff --git a/src/assets/js/kv-export-data.min.js b/src/assets/js/kv-export-data.min.js index 7bb0b09..a25b3c4 100644 --- a/src/assets/js/kv-export-data.min.js +++ b/src/assets/js/kv-export-data.min.js @@ -2,7 +2,7 @@ * @package yii2-export * @author Kartik Visweswaran * @copyright Copyright © Kartik Visweswaran, Krajee.com, 2015 - 2018 - * @version 1.3.5 + * @version 1.3.6 * * Export Data Validation Module. * diff --git a/src/views/_columns.php b/src/views/_columns.php index be15160..49916b4 100644 --- a/src/views/_columns.php +++ b/src/views/_columns.php @@ -3,7 +3,7 @@ * @package yii2-export * @author Kartik Visweswaran * @copyright Copyright © Kartik Visweswaran, Krajee.com, 2015 - 2018 - * @version 1.3.5 + * @version 1.3.6 * * Column Selector View * diff --git a/src/views/_view.php b/src/views/_view.php index d698c6a..6578c66 100644 --- a/src/views/_view.php +++ b/src/views/_view.php @@ -3,7 +3,7 @@ * @package yii2-export * @author Kartik Visweswaran * @copyright Copyright © Kartik Visweswaran, Krajee.com, 2015 - 2018 - * @version 1.3.5 + * @version 1.3.6 * * Export Submission View *