Skip to main content

Extract fields by area

Read the text of several named areas of a PDF at once, e.g. invoice number, date and total, into a Dictionary.

Command in the PDF toolkit · id ooa.pdf/extract_fields · 5 inputs (2 required), 2 outputs

Inputs​

InputTypeRequiredDefaultWhat it is
PathFileYesPDF file.
FieldsDictionaryYesArea name to {page, x, y, width, height}: points (72 per inch) from the top-left corner of the page; page 1 when left out.
TrimBooleanNotrueRemove spaces and line breaks around each value.
All pagesBooleanNofalseRead each area on every page and give a List of values per name (for a form repeated page after page).
PasswordCredentialNoPassword for protected PDFs.

Outputs​

OutputTypeWhat it is
valuesDictionaryEach area's name and the text found in it (empty when nothing is there).
emptyListNames of the areas where no text was found.