If we have access to a Mac or Windows machine, we can open the form in Adobe Acrobat Pro and see the fields’ properties.Īlternatively, we can use PDFtk’s dump_data_fields command to extract the fields information from the file: pdftk path/to/the/form.pdf dump_data_fields > field_names.txtĪs a result, PDFtk will save the result in the field_names.txt file. To create an FDF file, we will need to know the field names in the PDF form. The second part is the element’s value prefixed with /V indicating the value: > They begin with the form element’s name prefixed with /T, which indicates the title. Each line represents one field in the form. ![]() The content section contains the form data entries, each following a standard pattern. This section is also the same for all of our FDF files. The content section may seem confusing at first, but don’t worry, we’ll get to that shortly. The structure of an FDF file is composed of three parts: the header, the content and the footer: Header % FDF - 1.2 1 0 obj > Simply put, we need to generate an FDF file from user submitted data, and merge it with the original PDF file using PDFtk’s commands. ![]() PDFtk uses FDF files for manipulating PDF forms, but what is an FDF file?įDF or Form Data File is a plain-text file, which can store form data in a much simpler structure than PDF files. ![]() This article focuses on using PDFtk to fill out a standard PDF form using PHP. PDFtk provides a wide variety of features for manipulating PDF documents, from merging and splitting pages to filling out PDF forms, or even applying watermarks.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |