@quillmark/quillify
v0.3.0
Published
Turn a published PDF form (AcroForm or XFA) into a Quillmark quill, in the browser.
Readme
quillify
Turn a published PDF form into a Quillmark quill, in the browser.
Published forms rarely come as a clean fillable PDF. Most are encrypted with an empty password, and many are dynamic XFA, which only Acrobat lays out. quillify reads either kind and returns the page as a background with its form layer stripped, and every field with its place.
57 of 59 federal forms and 1,143 of 1,354 Air Force forms convert, with every field read back at its place.
Install
npm install @quillmark/quillify @quillmark/wasmUse
import { init } from '@quillmark/wasm';
import { quillify, sanitize, suggest } from '@quillmark/quillify';
const read = await sanitize(pdf);
if (!read.ok) throw new Error(read.refusal.code);
const built = await quillify(read.form, {
name: 'tdy_request',
description: 'Request and authorization for TDY travel.',
fields: suggest(read.form.fields)
});
if (!built.ok) throw new Error(built.problems.map(({ code }) => code).join(', '));
const { Quill } = await init();
const quill = Quill.fromTree(built.tree);pdf is the file's bytes: new Uint8Array(await file.arrayBuffer()).
sanitizeparses the file and returns aForm, or the reason it does not take the file.suggestnames each field from the form's own tooltips.checklists what is wrong with a naming.quillifybuilds the quill's files.
It runs in a browser and has no interface: the review screen, any model and storage are yours.
The file is treated as hostile. The background comes back without its form layer, scripts, attachments and metadata, and SECURITY.md says what holds and what does not.
Documentation
- API: what goes in, what comes back, every refusal and problem.
- Guide: bundlers, content security policy, the engine, from a quill to a filled PDF.
- Limits: what converts, what is refused, how a redrawn form can differ.
- Architecture: how the code is laid out.
- Security, contributing, changelog.
License
Apache-2.0. NOTICE lists the third-party files the package ships.
