mikehaertl\pdftk\Pdf::flatten PHP Method

flatten() public method

Flatten the PDF form fields values into a single PDF file.
public flatten ( ) : Pdf
return Pdf the pdf instance for method chaining
    public function flatten()
    {
        $this->getCommand()->addOption('flatten');
        return $this;
    }

Usage Example

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