diff --git a/src/Processor/Gotenberg.php b/src/Processor/Gotenberg.php index 78f4251..fb3de0c 100644 --- a/src/Processor/Gotenberg.php +++ b/src/Processor/Gotenberg.php @@ -159,8 +159,10 @@ public function getPdfFromString(string $html, array $params = [], bool $returnF $chromium->extraHttpHeaders($params['extraHttpHeaders']); } - if (isset($params['metadata'])) { + if (isset($params['metadata']) && method_exists($chromium, 'metadata')) { $chromium->metadata($params['metadata']); + } elseif (isset($params['metadata'])) { + $chromium->formValue('metadata', json_encode($params['metadata'])); } $request = $chromium->outputFilename($tempFileName)->html(Stream::string('processor.html', $html));