-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Rafał Pośpiech
committed
Apr 25, 2019
1 parent
b35e4dd
commit 23de27b
Showing
7 changed files
with
196 additions
and
95 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<style> | ||
.table { | ||
border: 1px solid blue; | ||
border-collapse: collapse; | ||
} | ||
.thead { | ||
background: black; | ||
color: yellowgreen; | ||
font-family: 'DejaVu Sans'; | ||
font-weight: bold; | ||
} | ||
.theadcol { | ||
background: yellow; | ||
color: black; | ||
border: 1px solid black; | ||
} | ||
.red { | ||
background: red; | ||
} | ||
.tbodyrow { | ||
background: olive; | ||
color: white; | ||
font-family: 'DejaVu Sans'; | ||
font-size: 12px; | ||
} | ||
.green { | ||
background: green; | ||
color: yellow; | ||
font-family: 'DejaVu Sans'; | ||
font-size: 18px; | ||
} | ||
</style> | ||
DIV<br /> | ||
<div class="table"> | ||
<div class="thead"> | ||
<div class="theadrow"> | ||
<div class="theadcol">.theadcol</div> | ||
<div class="theadcol red">.theadcol .red</div> | ||
<div class="theadcol red" style="font-weight:normal;">.theadcol .red inline-normal</div> | ||
</div> | ||
</div> | ||
<div class="tbody"> | ||
<div class="tbodyrow"> | ||
<div class="tbodycol">.tbodycol</div> | ||
<div class="tbodycol green">.tbodycol .green</div> | ||
<div class="tbodycol green" style="font-weight:bold;">.tbodycol .green inline-bold</div> | ||
</div> | ||
</div> | ||
</div> | ||
<br /> | ||
TABLE<br /> | ||
<table class="table"> | ||
<thead class="thead"> | ||
<tr class="theadrow"> | ||
<th class="theadcol">.theadcol</th> | ||
<th class="theadcol red">.theadcol .red</th> | ||
<th class="theadcol red" style="font-weight:400;">.theadcol .red inline-normal</th> | ||
</tr> | ||
</thead> | ||
<tbody class="tbody"> | ||
<tr class="tbodyrow"> | ||
<td class="tbodycol">.tbodycol</td> | ||
<td class="tbodycol green">.tbodycol .green</td> | ||
<td class="tbodycol green" style="font-weight: bold;">.tbodycol .green inline-bold</td> | ||
</tr> | ||
</tbody> | ||
</table> |
Binary file not shown.
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,9 @@ | ||
<?php | ||
|
||
$loader = require '../vendor/autoload.php'; | ||
$document = (new YetiForcePDF\Document())->init(); | ||
$document->loadHtml(file_get_contents('TableClassNames.html')); | ||
$time = microtime(true); | ||
$pdfFile = $document->render(); | ||
echo microtime(true) - $time; | ||
file_put_contents('TableClassNames.pdf', $pdfFile); |
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,30 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
/** | ||
* Background class. | ||
* | ||
* @package YetiForcePDF\Style\Normalizer | ||
* | ||
* @copyright YetiForce Sp. z o.o | ||
* @license YetiForce Public License v3 | ||
* @author Rafal Pospiech <r.pospiech@yetiforce.com> | ||
*/ | ||
|
||
namespace YetiForcePDF\Style\Normalizer; | ||
|
||
/** | ||
* Class Background. | ||
*/ | ||
class Background extends Normalizer | ||
{ | ||
public function normalize($ruleValue, string $ruleName = ''): array | ||
{ | ||
$normalizerName = \YetiForcePDF\Style\Normalizer\Normalizer::getNormalizerClassName('background-color'); | ||
return (new $normalizerName()) | ||
->setDocument($this->document) | ||
->setStyle($this->style) | ||
->init() | ||
->normalize($ruleValue, $ruleName); | ||
} | ||
} |
Oops, something went wrong.