1
0
mirror of https://github.com/themsaid/ibis.git synced 2025-01-16 21:18:35 +01:00

Merge pull request #20 from eberkund/add-html-cover-support

HTML cover support
This commit is contained in:
Mohamed Said 2020-12-23 11:24:57 +02:00 committed by GitHub
commit b4f26abdbe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 3 deletions

View File

@ -24,6 +24,7 @@ class BuildCommand extends Command
* @var string|string[]|null
*/
public $themeName;
/**
* @var OutputInterface
*/
@ -204,9 +205,7 @@ class BuildCommand extends Command
$pdf->SetMargins(400, 100, 12);
if (! $this->disk->isFile($currentPath.'/assets/cover.jpg')) {
$this->output->writeln('<fg=red>==></> No assets/cover.jpg File Found. Skipping ...');
} else {
if ($this->disk->isFile($currentPath . '/assets/cover.jpg')) {
$this->output->writeln('<fg=yellow>==></> Adding Book Cover ...');
$coverPosition = $config['cover']['position'] ?? 'position: absolute; left:0; right: 0; top: -.2; bottom: 0;';
@ -221,6 +220,16 @@ HTML
);
$pdf->AddPage();
} elseif ($this->disk->isFile($currentPath . '/assets/cover.html')) {
$this->output->writeln('<fg=yellow>==></> Adding Book Cover ...');
$cover = $this->disk->get($currentPath . '/assets/cover.html');
$pdf->WriteHTML($cover);
$pdf->AddPage();
} else {
$this->output->writeln('<fg=red>==></> No assets/cover.jpg File Found. Skipping ...');
}
$pdf->SetHTMLFooter('<div id="footer" style="text-align: center">{PAGENO}</div>');

1
stubs/assets/cover.html Normal file
View File

@ -0,0 +1 @@
<h1 style="text-align: center;">Title</h1>