0

I am using php-pdftk with laravel nova, filling a form after saving a resource. The problem is that the generated filled pdf is still editable.

Is there any way to close that PDF after filling it?

I've read that setting "flatten" property can do that, but it is incompatible with needAppearances(), which is needed for spanish characters

    $pdf = new Pdf( storage_path() . '/app/contracts/' . $this->contract_type . '.pdf', [
        'command' => 'pdftk',
        'useExec' => true
    ]);
    $pdf->fillForm($pdf_content)
        ->needAppearances();

Thanks!

lopandpe
  • 491
  • 1
  • 5
  • 10
  • What is the output when you are using flatten on your pdf? Does the flatten not works or does it gives out an error? Also if possible share the pdf with spanish characters. – Kuldeep Sep 29 '20 at 03:23

1 Answers1

0

Finally, the only issue was that those form fields had, in the pdf, a font that don't have those characters.

Changing that font solved the problem. By default, Acrobat set a very basic font for custom forms...

lopandpe
  • 491
  • 1
  • 5
  • 10