-
Notifications
You must be signed in to change notification settings - Fork 439
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement wkhtmltopdf backend headers and footers options
- Loading branch information
Showing
49 changed files
with
505 additions
and
140 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
22 changes: 22 additions & 0 deletions
22
src/Backend/WkHtmlToPdf/ExtraOption/FooterCenterOption.php
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,22 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption; | ||
|
||
use KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption; | ||
|
||
final class FooterCenterOption implements ExtraOption | ||
{ | ||
public function __construct(public readonly string $text) {} | ||
|
||
public function isRepeatable(): bool | ||
{ | ||
return false; | ||
} | ||
|
||
public function compile(): array | ||
{ | ||
return ['--footer-center', $this->text]; | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
src/Backend/WkHtmlToPdf/ExtraOption/FooterFontNameOption.php
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,22 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption; | ||
|
||
use KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption; | ||
|
||
final class FooterFontNameOption implements ExtraOption | ||
{ | ||
public function __construct(public readonly string $fontName) {} | ||
|
||
public function isRepeatable(): bool | ||
{ | ||
return false; | ||
} | ||
|
||
public function compile(): array | ||
{ | ||
return ['--footer-font-name', $this->fontName]; | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
src/Backend/WkHtmlToPdf/ExtraOption/FooterFontSizeOption.php
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 | ||
|
||
declare(strict_types=1); | ||
|
||
namespace KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption; | ||
|
||
use KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption; | ||
|
||
final class FooterFontSizeOption implements ExtraOption | ||
{ | ||
/** | ||
* @param positive-int $size | ||
*/ | ||
public function __construct(public readonly int $size) {} | ||
|
||
public function isRepeatable(): bool | ||
{ | ||
return false; | ||
} | ||
|
||
public function compile(): array | ||
{ | ||
return ['--footer-font-size', $this->size]; | ||
} | ||
} |
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,22 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption; | ||
|
||
use KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption; | ||
|
||
final class FooterHtmlOption implements ExtraOption | ||
{ | ||
public function __construct(public readonly string $uri) {} | ||
|
||
public function isRepeatable(): bool | ||
{ | ||
return false; | ||
} | ||
|
||
public function compile(): array | ||
{ | ||
return ['--footer-html', $this->uri]; | ||
} | ||
} |
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,22 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption; | ||
|
||
use KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption; | ||
|
||
final class FooterLeftOption implements ExtraOption | ||
{ | ||
public function __construct(public readonly string $text) {} | ||
|
||
public function isRepeatable(): bool | ||
{ | ||
return false; | ||
} | ||
|
||
public function compile(): array | ||
{ | ||
return ['--footer-left', $this->text]; | ||
} | ||
} |
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,22 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption; | ||
|
||
use KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption; | ||
|
||
final class FooterRightOption implements ExtraOption | ||
{ | ||
public function __construct(public readonly string $text) {} | ||
|
||
public function isRepeatable(): bool | ||
{ | ||
return false; | ||
} | ||
|
||
public function compile(): array | ||
{ | ||
return ['--footer-right', $this->text]; | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
src/Backend/WkHtmlToPdf/ExtraOption/FooterSpacingOption.php
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,22 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption; | ||
|
||
use KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption; | ||
|
||
final class FooterSpacingOption implements ExtraOption | ||
{ | ||
public function __construct(public readonly int $spacing) {} | ||
|
||
public function isRepeatable(): bool | ||
{ | ||
return false; | ||
} | ||
|
||
public function compile(): array | ||
{ | ||
return ['--footer-spacing', $this->spacing]; | ||
} | ||
} |
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
22 changes: 22 additions & 0 deletions
22
src/Backend/WkHtmlToPdf/ExtraOption/HeaderCenterOption.php
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,22 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption; | ||
|
||
use KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption; | ||
|
||
final class HeaderCenterOption implements ExtraOption | ||
{ | ||
public function __construct(public readonly string $text) {} | ||
|
||
public function isRepeatable(): bool | ||
{ | ||
return false; | ||
} | ||
|
||
public function compile(): array | ||
{ | ||
return ['--header-center', $this->text]; | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
src/Backend/WkHtmlToPdf/ExtraOption/HeaderFontNameOption.php
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,22 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption; | ||
|
||
use KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption; | ||
|
||
final class HeaderFontNameOption implements ExtraOption | ||
{ | ||
public function __construct(public readonly string $fontName) {} | ||
|
||
public function isRepeatable(): bool | ||
{ | ||
return false; | ||
} | ||
|
||
public function compile(): array | ||
{ | ||
return ['--header-font-name', $this->fontName]; | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
src/Backend/WkHtmlToPdf/ExtraOption/HeaderFontSizeOption.php
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 | ||
|
||
declare(strict_types=1); | ||
|
||
namespace KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption; | ||
|
||
use KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption; | ||
|
||
final class HeaderFontSizeOption implements ExtraOption | ||
{ | ||
/** | ||
* @param positive-int $size | ||
*/ | ||
public function __construct(public readonly int $size) {} | ||
|
||
public function isRepeatable(): bool | ||
{ | ||
return false; | ||
} | ||
|
||
public function compile(): array | ||
{ | ||
return ['--header-font-size', $this->size]; | ||
} | ||
} |
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,22 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption; | ||
|
||
use KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption; | ||
|
||
final class HeaderHtmlOption implements ExtraOption | ||
{ | ||
public function __construct(public readonly string $uri) {} | ||
|
||
public function isRepeatable(): bool | ||
{ | ||
return false; | ||
} | ||
|
||
public function compile(): array | ||
{ | ||
return ['--header-html', $this->uri]; | ||
} | ||
} |
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,22 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption; | ||
|
||
use KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption; | ||
|
||
final class HeaderLeftOption implements ExtraOption | ||
{ | ||
public function __construct(public readonly string $text) {} | ||
|
||
public function isRepeatable(): bool | ||
{ | ||
return false; | ||
} | ||
|
||
public function compile(): array | ||
{ | ||
return ['--header-left', $this->text]; | ||
} | ||
} |
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
Oops, something went wrong.