mikehaertl\pdftk\Pdf::needAppearances PHP 메소드

needAppearances() 공개 메소드

This flag makes sure, that a PDF reader takes care of rendering form field content, even if it contains non ASCII characters. You should always use this option if you fill in forms e.g. with Unicode characters. You can't combine this option with flatten() though!
public needAppearances ( ) : Pdf
리턴 Pdf the pdf instance for method chaining
    public function needAppearances()
    {
        $this->getCommand()->addOption('need_appearances');
        return $this;
    }

Usage Example

예제 #1
0
 public function testCanFillFormFromFile()
 {
     $form = $this->getForm();
     $fdf = $this->getFdf();
     $file = $this->getOutFile();
     $pdf = new Pdf($form);
     $this->assertInstanceOf('mikehaertl\\pdftk\\Pdf', $pdf->fillForm($fdf));
     $this->assertInstanceOf('mikehaertl\\pdftk\\Pdf', $pdf->needAppearances());
     $this->assertTrue($pdf->saveAs($file));
     $this->assertFileExists($file);
     $tmpFile = (string) $pdf->getTmpFile();
     $this->assertRegExp("#pdftk A='{$form}' fill_form '{$fdf}' output '{$tmpFile}' drop_xfa need_appearances#", (string) $pdf->getCommand());
 }