public function allow($permissions = null) { $this->getCommand()->addOption('allow', $permissions, false); return $this; }
public function testCanSetPermissions() { $document = $this->getDocument1(); $file = $this->getOutFile(); $pdf = new Pdf($document); $this->assertInstanceOf('mikehaertl\\pdftk\\Pdf', $pdf->allow('Assembly CopyContents')); $this->assertTrue($pdf->saveAs($file)); $this->assertFileExists($file); $tmpFile = (string) $pdf->getTmpFile(); $this->assertEquals("pdftk A='{$document}' output '{$tmpFile}' allow Assembly CopyContents", (string) $pdf->getCommand()); }