Skip to content

Commit

Permalink
Add support for enabling PDF forms by default
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianwong committed Oct 26, 2021
1 parent 63b8a06 commit 5112efa
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/Prince.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ class Prince
private $convertColors;
private $fallbackCmykProfile;
private $taggedPdf;
private $pdfForms;
private $cssDpi;

// PDF metadata options.
Expand Down Expand Up @@ -217,6 +218,7 @@ public function __construct($exePath)
$this->convertColors = false;
$this->fallbackCmykProfile = '';
$this->taggedPdf = false;
$this->pdfForms = false;
$this->cssDpi = 0;

// PDF metadata options.
Expand Down Expand Up @@ -1417,6 +1419,18 @@ public function setTaggedPdf($taggedPdf)
$this->taggedPdf = $taggedPdf;
}

/**
* Specify whether to enable PDF forms by default.
*
* @param bool $pdfForms `true` to enable PDF forms by default. Default
* value is `false`.
* @return void
*/
public function setPdfForms($pdfForms)
{
$this->pdfForms = $pdfForms;
}

/**
* Specify the DPI of the "px" units in CSS.
*
Expand Down Expand Up @@ -1903,6 +1917,9 @@ private function getCommandLine($logType = 'normal')
if ($this->taggedPdf) {
$cmdline .= self::cmdArg('--tagged-pdf');
}
if ($this->pdfForms) {
$cmdline .= self::cmdArg('--pdf-forms');
}
if ($this->cssDpi > 0) {
$cmdline .= self::cmdArg('--css-dpi', $this->cssDpi);
}
Expand Down

0 comments on commit 5112efa

Please sign in to comment.