Skip to content

Commit 53a58d0

Browse files
committed
Updates to release v1.3.6
1 parent ca14256 commit 53a58d0

13 files changed

+24
-23
lines changed

CHANGE.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
Change Log: `yii2-export`
22
=========================
33

4+
## version 1.3.6
5+
6+
**Date:** 13-Oct-2018
7+
8+
- Enhance `ExportWriterPdf` to allow custom formatting
9+
410
## version 1.3.5
511

612
**Date:** 13-Oct-2018

src/ExportColumnAsset.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/**
44
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2015 - 2018
55
* @package yii2-export
6-
* @version 1.3.5
6+
* @version 1.3.6
77
*/
88

99
namespace kartik\export;

src/ExportMenu.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* @package yii2-export
55
* @author Kartik Visweswaran <[email protected]>
66
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2015 - 2018
7-
* @version 1.3.5
7+
* @version 1.3.6
88
*/
99

1010
namespace kartik\export;
@@ -272,7 +272,7 @@ class ExportMenu extends GridView
272272
public $noExportColumns = [];
273273

274274
/**
275-
* @var string the view file for rendering the export form. DEPRECATED since v1.3.4 (not parsed or used anymore).
275+
* @var string the view file for rendering the export form. DEPRECATED since v1.3.5 (not parsed or used anymore).
276276
*/
277277
public $exportFormView = '_form';
278278

src/ExportMenuAsset.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/**
44
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2015 - 2018
55
* @package yii2-export
6-
* @version 1.3.5
6+
* @version 1.3.6
77
*/
88

99
namespace kartik\export;

src/ExportWriterPdf.php

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/**
44
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2015 - 2018
55
* @package yii2-export
6-
* @version 1.3.5
6+
* @version 1.3.6
77
*/
88

99
namespace kartik\export;
@@ -48,13 +48,14 @@ protected function createExternalWriterInstance($config = [])
4848
*
4949
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
5050
* @throws PhpSpreadsheetException
51+
* @throws \yii\base\InvalidConfigException
5152
*/
5253
public function save($pFilename)
5354
{
5455
$fileHandle = parent::prepareForSave($pFilename);
5556

5657
// Default PDF paper size
57-
$paperSize = 'LETTER'; // Letter (8.5"x11")
58+
$paperSize = Pdf::FORMAT_A4;
5859

5960
// Check for paper size and page orientation
6061
if (null === $this->getSheetIndex()) {
@@ -89,25 +90,19 @@ public function save($pFilename)
8990

9091
// Create PDF
9192
$pdf = $this->createExternalWriterInstance([
93+
'format' => $paperSize,
9294
'orientation' => $orientation,
9395
'methods' => [
9496
'SetTitle' => $properties->getTitle(),
9597
'SetAuthor' => $properties->getCreator(),
9698
'SetSubject' => $properties->getSubject(),
9799
'SetKeywords' => $properties->getKeywords(),
98-
'SetCreator' => $properties->getCreator(),
100+
'SetCreator' => $properties->getCreator()
99101
],
100102
]);
101-
$ortmp = $orientation;
102-
$lib = $pdf->getApi();
103-
/** @noinspection PhpUndefinedMethodInspection */
104-
$lib->_setPageSize(strtoupper($paperSize), $ortmp);
105-
$lib->DefOrientation = $orientation;
106-
/** @noinspection PhpUndefinedMethodInspection */
107-
$lib->AddPage($orientation);
108103
$content = $this->generateHTMLHeader(false) . $this->generateSheetData() . $this->generateHTMLFooter();
109104
// Write to file
110-
fwrite($fileHandle, $pdf->Output(static::cleanHTML($content), $this->filename, Pdf::DEST_STRING));
105+
fwrite($fileHandle, $pdf->output(static::cleanHTML($content), $this->filename, Pdf::DEST_STRING));
111106
parent::restoreStateAfterSave($fileHandle);
112107
}
113108

src/assets/css/kv-export-columns.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @package yii2-export
33
* @author Kartik Visweswaran <[email protected]>
44
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2015 - 2018
5-
* @version 1.3.5
5+
* @version 1.3.6
66
*
77
* Export Columns Selector Style Sheet
88
*

src/assets/css/kv-export-columns.min.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @package yii2-export
33
* @author Kartik Visweswaran <[email protected]>
44
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2015 - 2018
5-
* @version 1.3.5
5+
* @version 1.3.6
66
*
77
* Export Columns Selector Style Sheet
88
*

src/assets/js/kv-export-columns.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @package yii2-export
33
* @author Kartik Visweswaran <[email protected]>
44
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2015 - 2018
5-
* @version 1.3.5
5+
* @version 1.3.6
66
*
77
* Export Columns Selector Validation Module.
88
*

src/assets/js/kv-export-columns.min.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @package yii2-export
33
* @author Kartik Visweswaran <[email protected]>
44
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2015 - 2018
5-
* @version 1.3.5
5+
* @version 1.3.6
66
*
77
* Export Columns Selector Validation Module.
88
*

src/assets/js/kv-export-data.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @package yii2-export
33
* @author Kartik Visweswaran <[email protected]>
44
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2015 - 2018
5-
* @version 1.3.5
5+
* @version 1.3.6
66
*
77
* Export Data Validation Module.
88
*

src/assets/js/kv-export-data.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/views/_columns.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @package yii2-export
44
* @author Kartik Visweswaran <[email protected]>
55
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2015 - 2018
6-
* @version 1.3.5
6+
* @version 1.3.6
77
*
88
* Column Selector View
99
*

src/views/_view.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @package yii2-export
44
* @author Kartik Visweswaran <[email protected]>
55
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2015 - 2018
6-
* @version 1.3.5
6+
* @version 1.3.6
77
*
88
* Export Submission View
99
*

0 commit comments

Comments
 (0)