Skip to content

Commit

Permalink
Merge pull request #505 from KnpLabs/v2-unstable-wkhtmltopdf-outline-…
Browse files Browse the repository at this point in the history
…options

feat(outline-options): add outline options classes
  • Loading branch information
alexpozzi authored Oct 16, 2024
2 parents ec52b62 + aeac607 commit bb48f1a
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/Backend/WkHtmlToPdf/ExtraOption/NoOutline.php
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;

use KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption;

class NoOutline implements ExtraOption
{
public function compile(): array
{
return ['--no-outline'];
}
}
15 changes: 15 additions & 0 deletions src/Backend/WkHtmlToPdf/ExtraOption/Outline.php
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;

use KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption;

class Outline implements ExtraOption
{
public function compile(): array
{
return ['--outline'];
}
}
18 changes: 18 additions & 0 deletions src/Backend/WkHtmlToPdf/ExtraOption/OutlineDepth.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

declare(strict_types=1);

namespace KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption;

use KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption;

class OutlineDepth implements ExtraOption
{
public function __construct(private readonly int $depth)
{}

public function compile(): array
{
return ['--outline-depth', $this->depth];
}
}

0 comments on commit bb48f1a

Please sign in to comment.