Detect Forms Guide

Learn to build your own PDF form detection software and automatically identify form fields in PDF documents.

New to the API? Start with Processing a PDF: every tool guide builds on its task flow.

Basic form detection

The following example demonstrates how to analyze a PDF and detect the form fields it contains.

Create a task with the formsdetect tool, add the PDF, execute the task, and download the result.

Basic form detectionPHP
// Create a new Forms Detect task (use Ilovepdf\FormsDetectTask;)
$myTaskFormsDetect = new FormsDetectTask('PUBLIC_KEY', 'SECRET_KEY');
// Add a PDF file to the task (only one file per task)
$file1 = $myTaskFormsDetect->addFile('path/to/file1_name.pdf');
// Execute the task
$myTaskFormsDetect->execute();
// Download the form detection result
$myTaskFormsDetect->download();
PHP library ilovepdf/ilovepdf-phpcomposer require ilovepdf/ilovepdf-php

Only one PDF file per task is allowed. The API processes the uploaded document and returns the form detection result.

The Forms Detect task does not require tool-specific options.