aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSyndamia <kamen@syndamia.com>2025-02-08 17:50:40 +0200
committerSyndamia <kamen@syndamia.com>2025-02-08 17:50:40 +0200
commit0769feb5cda8c21ea12a30f94f03b5a74f61e804 (patch)
tree846be569f0fa93c2e19051600d067a7ed7ad7933
parent2c1952705148b57b39638436f18a739518308ec6 (diff)
downloadnowayforward_human-0769feb5cda8c21ea12a30f94f03b5a74f61e804.tar
nowayforward_human-0769feb5cda8c21ea12a30f94f03b5a74f61e804.tar.gz
nowayforward_human-0769feb5cda8c21ea12a30f94f03b5a74f61e804.zip
fix(controllers/archive): Remove margins from pdf exports
-rw-r--r--controllers/archive.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/controllers/archive.php b/controllers/archive.php
index 4e4ac77..80c8b1f 100644
--- a/controllers/archive.php
+++ b/controllers/archive.php
@@ -500,8 +500,14 @@ class DownloadPage {
$styleTag = $dom->createElement('link', '');
$styleTag->setAttribute('rel', 'stylesheet');
$styleTag->setAttribute('href', '/archive/topbar.css');
+
+ $printStyleTag = $dom->createElement('style', '
+ @page { margin: 0 !important; padding: 0 !important; }
+ ');
+
$head = $dom->getElementsByTagName('head')->item(0);
$head->appendChild($styleTag);
+ $head->appendChild($printStyleTag);
$this->page_contents = $dom->saveHTML();
$indexFile = fopen($folder_path . '/index.php', "a");