diff --git a/src/ZugferdPdfWriter.php b/src/ZugferdPdfWriter.php index 66daaed..7e32097 100644 --- a/src/ZugferdPdfWriter.php +++ b/src/ZugferdPdfWriter.php @@ -393,11 +393,13 @@ protected function _putcatalog(): void } else { $this->_put(sprintf('/AF %s 0 R', $this->filesIndex)); } + } - if (0 != $this->descriptionIndex) { - $this->_put(sprintf('/Metadata %s 0 R', $this->descriptionIndex)); - } + if (0 != $this->descriptionIndex) { + $this->_put(sprintf('/Metadata %s 0 R', $this->descriptionIndex)); + } + if (!empty($this->files)) { $this->_put('/Names <<'); $this->_put('/EmbeddedFiles '); $this->_put(sprintf('%s 0 R', $this->filesIndex));