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

Open
wants to merge 12 commits into
base: 1.x
Choose a base branch
from
Open
6 changes: 6 additions & 0 deletions src/Processor/Gotenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,12 @@ public function getPdfFromString(string $html, array $params = [], bool $returnF
$chromium->extraHttpHeaders($params['extraHttpHeaders']);
}

if (isset($params['metadata']) && method_exists($chromium, 'metadata')) {
$chromium->metadata($params['metadata']);
kingjia90 marked this conversation as resolved.
Show resolved Hide resolved
} elseif (isset($params['metadata'])) {
$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