feat(form-fill): FormFill tool with context and UI components for PDF form filling (#5711)

This commit is contained in:
Balázs Szücs
2026-02-13 15:10:48 +00:00
committed by GitHub
parent 5a1ed50e2b
commit 27bd34c29b
35 changed files with 4481 additions and 92 deletions
@@ -0,0 +1,32 @@
/**
* PdfBoxFormProvider — Backend API form data provider using PDFBox.
*
* Delegates form field extraction and filling to the server-side Java
* implementation via REST endpoints. This provides full-fidelity form
* handling including complex field types, appearance generation, and
* proper CJK font support.
*
* Used in the dedicated formFill tool mode.
*/
import type { FormField } from '@proprietary/tools/formFill/types';
import type { IFormDataProvider } from '@proprietary/tools/formFill/providers/types';
import {
fetchFormFieldsWithCoordinates,
fillFormFields,
} from '@proprietary/tools/formFill/formApi';
export class PdfBoxFormProvider implements IFormDataProvider {
readonly name = 'pdfbox';
async fetchFields(file: File | Blob): Promise<FormField[]> {
return fetchFormFieldsWithCoordinates(file);
}
async fillForm(
file: File | Blob,
values: Record<string, string>,
flatten: boolean,
): Promise<Blob> {
return fillFormFields(file, values, flatten);
}
}