Help language development. Donate to The Perl Foundation
[Raku PDF Project] / [FDF Module]
A Raku module for the creation and manipulation of FDF (Form Data Format) files, including PDF export and import.
use PDF::Class; use FDF; my PDF::Class $from .= open: "MyDoc.pdf"; my FDF $fdf .= new; # fill the email field, overriding PDF value my %fill = :email<[email protected]>; # Combined import and filling $fdf.import: :$from, :%fill; # -OR- import then fill $fdf.import: :$from; $fdf.import: :%fill; note "saving fields :-" for $fdf.field-hash.sort { note " - {.key}: {.value.perl}"; } $fdf.save-as: "MyDoc.fdf";
use FDF; use FDF::Field; my FDF $fdf .= open: "MyDoc.fdf"; my FDF::Fields @fields = $fdf.fields; for @fields { say .key ~ ': ' ~ .value.raku; }
use PDF::Class; use FDF; my PDF::Class $to .= open: "MyDoc.pdf"; my FDF $fdf .= open: "MyDoc.fdf"; # populate form data from the PDF $fdf.export: :$to; # save updated fields $to.update;
FDF (Form Data Format) is a format for storing form data and formatting or annotations seperately from PDF files.
Not yet handled:
/Encoding
entry in the FDF dictionary)