Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass metadata to gotenberg-chromium processor #66

Merged
Merged
8 changes: 8 additions & 0 deletions src/Processor/Gotenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,14 @@ public function getPdfFromString(string $html, array $params = [], bool $returnF
$chromium->extraHttpHeaders($params['extraHttpHeaders']);
}

if (isset($params['metadata'])) {
if (method_exists($chromium, 'metadata')) {
$chromium->metadata($params['metadata']);
} else {
$chromium->formValue('metadata', json_encode($params['metadata']));
}
muratbinerbay marked this conversation as resolved.
Show resolved Hide resolved
}

$request = $chromium->outputFilename($tempFileName)->html(Stream::string('processor.html', $html));

if ($returnFilePath) {
Expand Down
Loading