Skip to content

Commit

Permalink
Fix Viewer Preferences.
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolaasuni committed Aug 24, 2024
1 parent 2c63d67 commit 4cd2891
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions examples/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
$pdf->setKeywords('TCPDF tc-lib-pdf example');
$pdf->setPDFFilename('test_index.pdf');

$pdf->setViewerPreferences(['DisplayDocTitle' => true]);

// ----------
// Insert fonts

Expand Down
2 changes: 1 addition & 1 deletion src/MetaInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ protected function getDuplexMode(): string
protected function getBooleanMode(string $name): string
{
if (isset($this->viewerpref[$name])) {
return ' /' . $name . ' ' . var_export((bool) $this->viewerpref[$name], true);
return ' /' . $name . ' ' . ($this->viewerpref[$name] === true ? 'true' : 'false');
}

return '';
Expand Down

0 comments on commit 4cd2891

Please sign in to comment.