addFile() public method

public addFile ( string | Pdf $name, string | null $handle = null, string | null $password = null ) : Pdf
$name string | Pdf the PDF filename or Pdf instance to add for processing
$handle string | null one or more uppercase letters A..Z to reference this file later. If no handle is provided, an internal handle is autocreated, consuming the range Z..A
$password string | null the owner (or user) password if any
return Pdf the pdf instance for method chaining
Ejemplo n.º 1
0
 public function testCanPerformEmptyOperation()
 {
     $document1 = $this->getDocument1();
     $file = $this->getOutFile();
     $pdf = new Pdf();
     $this->assertInstanceOf('mikehaertl\\pdftk\\Pdf', $pdf->addFile($document1, null, 'complex\'"password'));
     $this->assertTrue($pdf->saveAs($file));
     $this->assertFileExists($file);
     $tmpFile = (string) $pdf->getTmpFile();
     $this->assertEquals("pdftk A='{$document1}' input_pw A='complex'\\''\"password' output '{$tmpFile}'", (string) $pdf->getCommand());
 }