Skip to content

Tagged PDFs? #799

Answered by ntaylor-86
plweil asked this question in Q&A
Dec 8, 2023 · 3 comments · 8 replies
Discussion options

You must be logged in to vote

Give this a try.

Edit this file:

vendor/spatie/browsershot/src/Browsershot.php

Modify the createPdfCommand() method:

and add the line $command['options']['tagged'] = true;

e.g.

  public function createPdfCommand($targetPath = null): array
  {
      $url = $this->getFinalContentsUrl();

      $options = [];

      if ($targetPath) {
          $options['path'] = $targetPath;
      }

      $command = $this->createCommand($url, 'pdf', $options);

      /**
       * @plweil 
       * 
       * Added this line below
       * 
       */
      $command['options']['tagged'] = true;

      if ($this->showBackground) {
          $command['options']['printBackground'] = true;
      }

      if ($this->

Replies: 3 comments 8 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@ntaylor-86
Comment options

Comment options

You must be logged in to vote
7 replies
@plweil
Comment options

@ntaylor-86
Comment options

@plweil
Comment options

@ntaylor-86
Comment options

Answer selected by plweil
@plweil
Comment options

@ntaylor-86
Comment options

@plweil
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants