needAppearances() public method

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
return Pdf the pdf instance for method chaining
Beispiel #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());
 }