mikehaertl\pdftk\Pdf::getTmpFile PHP Method

getTmpFile() public method

public getTmpFile ( ) : mikehaertl\tmp\File
return mikehaertl\tmp\File the temporary output file instance
    public function getTmpFile()
    {
        if ($this->_tmpFile === null) {
            $this->_tmpFile = new File('', '.pdf', self::TMP_PREFIX);
        }
        return $this->_tmpFile;
    }

Usage Example

Ejemplo n.º 1
0
 public function testSet40BitEncryption()
 {
     $document = $this->getDocument1();
     $file = $this->getOutFile();
     $pdf = new Pdf($document);
     $this->assertInstanceOf('mikehaertl\\pdftk\\Pdf', $pdf->passwordEncryption(40));
     $this->assertTrue($pdf->saveAs($file));
     $this->assertFileExists($file);
     $tmpFile = (string) $pdf->getTmpFile();
     $this->assertEquals("pdftk A='{$document}' output '{$tmpFile}' encrypt_40bit", (string) $pdf->getCommand());
 }