DEV Community

Cover image for How to turn a printed PDF form into one you can type into
Hanako H.
Hanako H.

Posted on

How to turn a printed PDF form into one you can type into

A clinic, a school or a landlord sends a PDF form with the usual instruction: print it, fill it in by pen, scan it and send it back. Open the file and the reason is obvious. The lines and boxes are only printed on the page. Clicking on the line next to "Full name" does nothing, because there is no field there, just a stroke of ink. The form below is a made-up one-page new patient form (example document), and the steps use the PDF Editor in the osFoundry desktop app to give it real fields, fill it in on the keyboard and save it as a PDF that keeps the answers.

Open the form and go to Prepare a form

Open the PDF in the PDF Editor. In the top bar, click All tools, then Prepare a form. The panel on the left changes to the form tools: a Preview button at the top, then Field list, Detect form fields, Clear form and the rest.

The Prepare a form panel next to a printed patient form with no fields on it

At this point the page is still the printed version. Five lines under "About you", three Yes/No pairs of tick boxes under "Health", a line for the reason of the visit, and lines for the signature and the date.

Detect the fields

Click Detect form fields. A short message says "Detected 14 form fields", the bar above the page changes to "This document contains 14 interactive form fields.", and every line and box on the page turns into a highlighted field.

Detected 14 form fields, each printed line and tick box now a blue field with its name on it

The detection reads what is drawn on the page. A long horizontal line becomes a text field sitting on that line, a small square becomes a checkbox of the same size, and each field is named after the printed text next to it. The line after "Full name" becomes a field called Full name; the box before "Yes" becomes Yes. Fourteen is exactly what this form has: eight lines and six boxes.

Click Field list to check the names. The Inspector on the right lists all 14 in reading order. Labels that repeat get a number, so the three pairs of tick boxes are Yes, No, Yes2, No2, Yes3 and No3.

The Field list in the Inspector, with Full name, Date of birth, Phone, Email, Address and the tick boxes

The names are worth a look before anyone fills the form, because they are what a PDF reader shows when it lists the fields, and what an export of the form data uses as keys.

Click Preview and fill it in

Click Preview at the top of the panel. The fields stop being editable shapes and start taking input. Click a line and type, then press Enter. Click a box to tick it. Name, date of birth, phone, email, address, the three questions, the reason for the visit, the signature line and the date all fill from the keyboard. The values in the screenshot are example data.

The filled form with the answers typed into the lines and three boxes ticked, and the values in the Field list

The Field list follows along: Full name shows Jordan Lee, the ticked boxes show Yes and the others Off.

Save and open it again

Click the save icon at the top right. The fields are now part of the PDF itself, not an overlay in the editor. Close the tab and open the saved file: the 14 fields and every answer are still there.

Because these are standard PDF form fields, the saved file is not tied to the app it was made in. Any PDF reader that supports forms can show the answers or fill the form again, and the person who receives it gets a typed form instead of a scan of handwriting.

The PDF Editor comes with the free desktop app on the osFoundry download page, and detecting, filling and saving all run on the computer itself, in line with the app's local-first approach to privacy.

Top comments (0)