public setUserPassword ( string $password ) : |
||
$password | string | the user password to set on the output PDF |
return | the pdf instance for method chaining |
public function testCanSetPasswords() { $document = $this->getDocument1(); $file = $this->getOutFile(); $pdf = new Pdf($document); $this->assertInstanceOf('mikehaertl\\pdftk\\Pdf', $pdf->setPassword('"\'**')); $this->assertInstanceOf('mikehaertl\\pdftk\\Pdf', $pdf->setUserPassword('**"\'')); $this->assertTrue($pdf->saveAs($file)); $this->assertFileExists($file); $tmpFile = (string) $pdf->getTmpFile(); $this->assertEquals("pdftk A='{$document}' output '{$tmpFile}' owner_pw '\"'\\''**' user_pw '**\"'\\'''", (string) $pdf->getCommand()); }