-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/XLSX-Image-Background-In-Comment…
…s' into XLSX-Image-Background-In-Comments
- Loading branch information
Showing
40 changed files
with
912 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php | ||
|
||
require __DIR__ . '/../Header.php'; | ||
$spreadsheet = require __DIR__ . '/../templates/sampleSpreadsheet2.php'; | ||
|
||
// Save | ||
$helper->write($spreadsheet, __FILE__); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
use PhpOffice\PhpSpreadsheet\Spreadsheet; | ||
use PhpOffice\PhpSpreadsheet\Writer\Pdf\Mpdf; | ||
|
||
require __DIR__ . '/../Header.php'; | ||
|
||
// Issue 2432 - styles were too large to fit in first Mpdf chunk, causing problems. | ||
$spreadsheet = new Spreadsheet(); | ||
$sheet = $spreadsheet->getActiveSheet(); | ||
$counter = 0; | ||
$helper->log('Populate spreadsheet'); | ||
for ($row = 1; $row < 501; ++$row) { | ||
$sheet->getCell("A$row")->setValue(++$counter); | ||
// Add many styles by using slight variations of font color for each. | ||
$sheet->getCell("A$row")->getStyle()->getFont()->getColor()->setRgb(sprintf('%06x', $counter)); | ||
$sheet->getCell("B$row")->setValue(++$counter); | ||
$sheet->getCell("C$row")->setValue(++$counter); | ||
} | ||
|
||
$helper->log('Write to Mpdf'); | ||
$writer = new Mpdf($spreadsheet); | ||
$filename = $helper->getFileName('21c_Pdf_mpdf.xlsx', 'pdf'); | ||
$writer->save($filename); | ||
$helper->log("Saved $filename"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
use PhpOffice\PhpSpreadsheet\IOFactory; | ||
|
||
require __DIR__ . '/../Header.php'; | ||
|
||
$helper->log('Start'); | ||
|
||
$inputFileType = 'Xlsx'; | ||
$inputFileName = __DIR__ . '/sampleData/issue.1767.xlsx'; | ||
|
||
$helper->log('Loading file ' . $inputFileName . ' using IOFactory with a defined reader type of ' . $inputFileType); | ||
$reader = IOFactory::createReader($inputFileType); | ||
$helper->log('Loading all WorkSheets'); | ||
$reader->setLoadAllSheets(); | ||
$spreadsheet = $reader->load($inputFileName); | ||
|
||
// Save | ||
$helper->write($spreadsheet, __FILE__); | ||
|
||
$helper->log('end'); |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.