-
Notifications
You must be signed in to change notification settings - Fork 437
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
Showing
10 changed files
with
190 additions
and
4 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,10 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace KNPLabs\Snappy\Backend\WkHtmlToPdf; | ||
|
||
interface ExtraOption { | ||
/** @return array<string|int|float> */ | ||
public function compile(): array; | ||
} |
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,17 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption; | ||
|
||
use KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption; | ||
|
||
final class CollateOption implements ExtraOption | ||
{ | ||
public function __construct() {} | ||
|
||
public function compile(): array | ||
{ | ||
return ['--collate']; | ||
} | ||
} |
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,17 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption; | ||
|
||
use KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption; | ||
|
||
final class CookieJarOption implements ExtraOption | ||
{ | ||
public function __construct(public readonly string $path) {} | ||
|
||
public function compile(): array | ||
{ | ||
return ['--no-collate']; | ||
} | ||
} |
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,17 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption; | ||
|
||
use KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption; | ||
|
||
final class CopiesOption implements ExtraOption | ||
{ | ||
public function __construct(private readonly int $number) {} | ||
|
||
public function compile(): array | ||
{ | ||
return ['--copies', $this->number]; | ||
} | ||
} |
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,17 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption; | ||
|
||
use KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption; | ||
|
||
final class DpiOptions implements ExtraOption | ||
{ | ||
public function __construct(private readonly int $dpi) {} | ||
|
||
public function compile(): array | ||
{ | ||
return ['--dpi', $this->dpi]; | ||
} | ||
} |
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,15 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption; | ||
|
||
final class GrayscaleOption | ||
{ | ||
public function __construct() {} | ||
|
||
public function compile(): array | ||
{ | ||
return ['--grayscale']; | ||
} | ||
} |
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,10 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption; | ||
|
||
final class ImageDpiOption | ||
{ | ||
public function __construct(public readonly int $dpi) {} | ||
} |
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,10 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption; | ||
|
||
final class NoCollateOption | ||
{ | ||
public function __construct() {} | ||
} |
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,10 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption; | ||
|
||
final class Orientation | ||
{ | ||
public function __construct() {} | ||
} |
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