diff --git a/crates/engine/src/tests.rs b/crates/engine/src/tests.rs
index 35aba81d51..13696f531b 100644
--- a/crates/engine/src/tests.rs
+++ b/crates/engine/src/tests.rs
@@ -8590,6 +8590,8 @@ fn an_xfa_form_without_a_template_opens_with_its_placeholder_and_a_warning() {
assert!(doc.info.warnings.iter().any(|w| w.contains("could not be laid out") && w.contains("no template")), "{:?}", doc.info.warnings);
}
+/// A dynamic form opens laid out with the values its datasets hold, and with the rows its data
+/// adds to a repeating table row.
#[test]
fn dynamic_xfa_forms_open_with_the_values_and_rows_of_their_data() {
let data = "
";
@@ -8605,6 +8607,29 @@ fn dynamic_xfa_forms_open_with_the_values_and_rows_of_their_data() {
assert!(!doc.dirty);
}
+/// A dynamic form a viewer saved with its pages drawn holds only its signature box, so it opened as
+/// a picture with nothing to fill in. When its configuration says it must be rendered dynamically
+/// it is laid out from its template on opening, and its text field can be filled; once signed, it
+/// opens as saved, its pages and signature untouched.
+#[test]
+fn a_form_saved_with_its_pages_that_requires_dynamic_rendering_is_laid_out_unless_signed() {
+ let mut s = Session::new().with_clock(|| 1_700_000_000);
+ let unsigned = Arc::new(pdfcraft_xfa::fixtures::saved_with_pages_shell("required", false));
+ let id = s.open("saved.pdf", None, unsigned, None).expect("opens");
+ let doc = s.get(id).unwrap();
+ assert_eq!(doc.info.xfa, Some(pdfcraft_render::Xfa::Dynamic));
+ assert!(doc.xfa.is_some(), "laid out from the template");
+ let name = doc.form.iter().find(|f| f.name.contains("name")).map(|f| f.name.clone()).expect("the template's text field");
+ s.apply(id, Edit::SetFieldValue { name: name.clone(), value: FieldValue::Text("Ada".into()) }).expect("fills");
+ assert_eq!(s.get(id).unwrap().form.iter().find(|f| f.name == name).map(|f| f.value.clone()), Some(vec!["Ada".to_string()]));
+ let signed = Arc::new(pdfcraft_xfa::fixtures::saved_with_pages_shell("required", true));
+ let id = s.open("signed.pdf", None, signed.clone(), None).expect("opens");
+ let doc = s.get(id).unwrap();
+ assert_eq!(doc.info.xfa, Some(pdfcraft_render::Xfa::Static), "signed: as saved");
+ assert!(doc.xfa.is_none(), "nothing was laid out");
+ assert_eq!(doc.bytes[..], signed[..], "no revision was appended on open");
+}
+
/// #3180: an XFA form with no fields whose configuration says `dynamicRender` is `forbidden` is a
/// static form: its pages are the form. Opening it used to lay the template out into new pages
/// and write them as a revision, so even a save with no change replaced the pages.
@@ -14128,6 +14153,44 @@ fn repeated_backdrop_artwork_survives_background_undo_redo_and_both_save_modes()
black(&s, rewritten);
}
+/// A form saved with its pages whose signature box sits deeper than the 32 nested fields looked
+/// through counts as signed, as the xfa crate counts it, so it is left as saved rather than laid
+/// out again over a signature that may be there; nested less deep, unsigned, it is laid out.
+#[test]
+fn a_saved_form_too_deep_to_read_through_is_left_as_saved() {
+ let xfa = |depth: usize| {
+ let mut s = Session::new();
+ let id = s.open("deep.pdf", None, Arc::new(pdfcraft_xfa::fixtures::deep_saved_with_pages_shell(depth)), None).expect("opens");
+ s.get(id).unwrap().info.xfa
+ };
+ assert_eq!(xfa(5), Some(pdfcraft_render::Xfa::Dynamic), "nested, unsigned: laid out");
+ assert_eq!(xfa(40), Some(pdfcraft_render::Xfa::Static), "too deep to tell: left as saved");
+}
+
+/// The renderer's inspection and the xfa crate each decide whether a form saved with its pages
+/// is laid out again from its template, each walking the field tree for a signature in its own
+/// way (the renderer reads the file through lopdf, the xfa crate through cos). They agree on every
+/// such form: required or not, signed or not, and a signature box nested from shallow to past
+/// the depth either looks through.
+#[test]
+fn the_renderer_and_the_xfa_crate_agree_on_which_saved_forms_are_laid_out() {
+ let mut forms: Vec<(String, Vec)> = Vec::new();
+ for render in ["required", "forbidden", ""] {
+ for signed in [false, true] {
+ forms.push((format!("{render:?}, signed {signed}"), pdfcraft_xfa::fixtures::saved_with_pages_shell(render, signed)));
+ }
+ }
+ for depth in [1, 5, 30, 31, 32, 33, 34, 40] {
+ forms.push((format!("nested {depth} deep"), pdfcraft_xfa::fixtures::deep_saved_with_pages_shell(depth)));
+ }
+ for (what, bytes) in forms {
+ let bytes = Arc::new(bytes);
+ let info = pdfcraft_render::inspect(bytes.clone(), None).expect("inspects");
+ let cos = pdfcraft_cos::Document::open(bytes).expect("opens");
+ assert_eq!(info.xfa == Some(pdfcraft_render::Xfa::Dynamic), pdfcraft_xfa::is_dynamic(&cos), "{what}");
+ }
+}
+
/// A page still exists after its only master widget is hidden: its master nodes stay in the
/// script model, so a later script can address them again (test from wireless89's review of
/// #5368).
diff --git a/crates/render/src/inspect/core.rs b/crates/render/src/inspect/core.rs
index 73ecd89de6..10633f57ef 100644
--- a/crates/render/src/inspect/core.rs
+++ b/crates/render/src/inspect/core.rs
@@ -171,8 +171,9 @@ impl<'a> Inspector<'a> {
}
/// Reads what `info` holds beyond the page list: encryption, document information, tagging,
- /// page labels, bookmarks, annotations, transitions, form fields, layers, fonts, attachments
- /// (and, for a PDF portfolio, how it presents them), JavaScript and the opening destination.
+ /// page labels, bookmarks, annotations, transitions, form fields, XFA kind (dynamic when it
+ /// must be laid out from its template, else static), layers, fonts, attachments (and, for a
+ /// PDF portfolio, how it presents them), JavaScript and the opening destination.
pub(super) fn fill(&self, info: &mut DocInfo) {
// lopdf drops /Encrypt from the trailer once it has decrypted the file.
info.encrypted = self.doc.encrypted();
@@ -260,8 +261,24 @@ impl<'a> Inspector<'a> {
// A form with no fields is taken to be laid out from its template, unless its
// configuration says it is a static form (#3180): Designer writes
// `forbidden ` for one, whose pages are the form.
- let static_form = self.xfa_dynamic_render(xfa).as_deref() == Some("forbidden");
- info.xfa = Some(if needs_rendering || (info.fields.is_empty() && !static_form) { Xfa::Dynamic } else { Xfa::Static });
+ let render = self.xfa_dynamic_render(xfa);
+ let static_form = render.as_deref() == Some("forbidden");
+ // A form a viewer saved with its pages drawn, whose configuration says it must be
+ // rendered dynamically, is laid out from its template too: its fields live there.
+ // Not once it is signed: the signature covers the pages as saved (the xfa crate's
+ // `is_dynamic` keeps the same rule).
+ let signed = self.signed_form(catalog);
+ let required = render.as_deref() == Some("required") && !signed;
+ // Whether the AcroForm lists any field, as the xfa crate's `has_fields` reads it, so
+ // both call the same forms dynamic: fields nested too deep to read through count.
+ let listed = catalog
+ .get(b"AcroForm")
+ .ok()
+ .and_then(|o| self.dict(o))
+ .and_then(|f| f.get(b"Fields").ok())
+ .and_then(|f| self.resolve(f).as_array().ok())
+ .is_some_and(|a| !a.is_empty());
+ info.xfa = Some(if needs_rendering || required || (!listed && !static_form) { Xfa::Dynamic } else { Xfa::Static });
}
self.layers(catalog, &mut info.layers);
info.layer_groups = self.layer_groups(catalog);
@@ -288,6 +305,40 @@ impl<'a> Inspector<'a> {
info.open_dest = catalog.get(b"OpenAction").ok().and_then(|o| self.open_dest(o));
}
+ /// Whether the form holds a signature field with a value, read as the xfa crate's
+ /// `has_signature` reads it so that both say the same of a form: down the field tree from the
+ /// AcroForm's `/Fields`, the field type inherited from the parent, and a tree deeper than 32
+ /// fields or larger than 10,000 taken as signed. A form too big to read through is then left
+ /// as saved rather than laid out again over a signature.
+ pub(super) fn signed_form(&self, catalog: &'a Dictionary) -> bool {
+ let Some(acro) = catalog.get(b"AcroForm").ok().and_then(|o| self.dict(o)) else { return false };
+ let Some(fields) = acro.get(b"Fields").ok().and_then(|f| self.resolve(f).as_array().ok()) else { return false };
+ // (field, signature type inherited, depth)
+ let mut todo: Vec<(&Object, bool, usize)> = fields.iter().map(|f| (f, false, 0)).collect();
+ let mut seen = HashSet::new();
+ let mut budget = 10_000usize;
+ while let Some((f, sig_above, depth)) = todo.pop() {
+ if budget == 0 || depth > 32 {
+ return true;
+ }
+ if let Some(id) = self.resolved_id(f)
+ && !seen.insert(id)
+ {
+ continue;
+ }
+ budget -= 1;
+ let Some(d) = self.dict(f) else { continue };
+ let sig = d.get(b"FT").ok().and_then(|t| self.resolve(t).as_name().ok()).map_or(sig_above, |t| t == b"Sig");
+ if sig && d.get(b"V").ok().is_some_and(|v| !matches!(self.resolve(v), Object::Null)) {
+ return true;
+ }
+ if let Some(kids) = d.get(b"Kids").ok().and_then(|k| self.resolve(k).as_array().ok()) {
+ todo.extend(kids.iter().map(|k| (k, sig, depth + 1)));
+ }
+ }
+ false
+ }
+
/// A portfolio's collection dictionary (Table 153). `/D` names the initial document's key in
/// the `/EmbeddedFiles` name tree, decoded as the keys are.
fn portfolio(&self, collection: &Dictionary, attachments: &[Attachment]) -> Portfolio {
diff --git a/crates/xfa/README.md b/crates/xfa/README.md
index 019211235e..f8c92f2348 100644
--- a/crates/xfa/README.md
+++ b/crates/xfa/README.md
@@ -184,6 +184,10 @@ let form = pdfcraft_xfa::layout_xml(template_xml)?; // pages of items, for
only their data is read and written. A form with no fields is also static when its `config`
packet says `forbidden ` (Designer's static PDF form): its pages
are the form and are not laid out again (#3180). Without that, no fields means dynamic.
+ The other way round, a form with fields is dynamic when its `config` packet says
+ `required `: a viewer saved it with its pages drawn and only its
+ signature boxes as fields, so its other fields live in the template. Once one of those boxes
+ is signed it stays as saved, since laying it out would change the pages the signature covers.
- **Flattening and converting.** `strip` takes the XFA out of a document: the packets,
`/NeedsRendering`, the layout mark, the overrides and the private keys on the fields. The
engine calls it after flattening an XFA form's fields (so Adobe's viewers show the baked
diff --git a/crates/xfa/src/fixtures.rs b/crates/xfa/src/fixtures.rs
index fd80d9ce3c..fb7d2228b8 100644
--- a/crates/xfa/src/fixtures.rs
+++ b/crates/xfa/src/fixtures.rs
@@ -1041,6 +1041,79 @@ pub fn signed_shell() -> Vec {
assemble(objs)
}
+/// A dynamic form as a viewer saves it with its pages drawn: no `/NeedsRendering`, a page with
+/// the form's picture, and only its signature box `sign` among the AcroForm's fields (the text
+/// field `name` lives in the template), signed when `signed`. Its configuration packet says
+/// `{render} ` (none when `render` is empty).
+pub fn saved_with_pages_shell(render: &str, signed: bool) -> Vec {
+ assemble(saved_with_pages_objects(render, signed))
+}
+
+/// [`saved_with_pages_shell`]`("required", false)` whose signature box sits under `depth` nested
+/// fields of its own (none of them a signature, none with a value).
+pub fn deep_saved_with_pages_shell(depth: usize) -> Vec {
+ let mut objs = saved_with_pages_objects("required", false);
+ // Object 6, the box, becomes the outermost of the nested fields, each the parent of the next;
+ // the box goes last, under the innermost, and the page lists it under its new number.
+ let first = objs.len() + 1;
+ let depth = depth.max(1);
+ let widget = first + depth - 1;
+ let parent_of = |n: usize| if n == first { 6 } else { n - 1 };
+ let field = |name: usize, kid: usize, parent: Option| {
+ let parent = parent.map(|p| format!(" /Parent {p} 0 R")).unwrap_or_default();
+ format!("<< /T (n{name}) /Kids [{kid} 0 R]{parent} >>").into_bytes()
+ };
+ let kid_of_six = if depth == 1 { widget } else { first };
+ let Some(sig) = objs.get_mut(5).map(|o| std::mem::replace(o, field(0, kid_of_six, None))) else { return assemble(objs) };
+ for d in 1..depth {
+ let n = first + d - 1;
+ objs.push(field(d, n + 1, Some(parent_of(n))));
+ }
+ let innermost = if depth == 1 { 6 } else { widget - 1 };
+ let sig = String::from_utf8_lossy(&sig).replacen("/T (form[0].sign[0])", &format!("/T (sign[0]) /Parent {innermost} 0 R"), 1);
+ objs.push(sig.into_bytes());
+ if let Some(page) = objs.get_mut(2) {
+ *page = String::from_utf8_lossy(page).replacen("/Annots [6 0 R]", &format!("/Annots [{widget} 0 R]"), 1).into_bytes();
+ }
+ assemble(objs)
+}
+
+/// The objects of [`saved_with_pages_shell`], in order (the signature box is object 6).
+fn saved_with_pages_objects(render: &str, signed: bool) -> Vec> {
+ let config = if render.is_empty() {
+ String::new()
+ } else {
+ format!(
+ r#"1.7 {render} "#
+ )
+ };
+ let xdp = format!(
+ r##"
+
+{config}
+
+
+
+
+
+
+
+
+"##
+ );
+ let value = if signed { " /V 7 0 R" } else { "" };
+ let picture = "BT /F1 12 Tf 72 700 Td (Name: ______) Tj ET";
+ vec![
+ b"<< /Type /Catalog /Pages 2 0 R /AcroForm << /XFA 5 0 R /Fields [6 0 R] /SigFlags 3 >> >>".to_vec(),
+ b"<< /Type /Pages /Kids [3 0 R] /Count 1 >>".to_vec(),
+ b"<< /Type /Page /Parent 2 0 R /MediaBox [0 0 612 792] /Contents 4 0 R /Annots [6 0 R] >>".to_vec(),
+ format!("<< /Length {} >>\nstream\n{picture}\nendstream", picture.len()).into_bytes(),
+ format!("<< /Length {} >>\nstream\n{xdp}\nendstream", xdp.len()).into_bytes(),
+ format!("<< /T (form[0].sign[0]) /FT /Sig{value} /Type /Annot /Subtype /Widget /Rect [72 500 288 572] /P 3 0 R >>").into_bytes(),
+ b"<< /Type /Sig /Name (A Signer) >>".to_vec(),
+ ]
+}
+
/// A check box `kind` whose change script, once it is checked, opens the protected check box
/// `leave` and shows the invisible field `details`, then fails on an object the form doesn't
/// have (as scripts written for an earlier version of a form do).
diff --git a/crates/xfa/src/lib.rs b/crates/xfa/src/lib.rs
index 9fad61fae7..68e94474da 100644
--- a/crates/xfa/src/lib.rs
+++ b/crates/xfa/src/lib.rs
@@ -136,9 +136,16 @@ pub struct Report {
}
/// Is this a dynamic XFA form still showing its placeholder pages (one PdfCraft has not laid
-/// out yet)?
+/// out yet)? That is a form that asks to be laid out (`/NeedsRendering`), one with no fields of
+/// its own, or one a viewer saved with its pages drawn whose configuration says it must be
+/// rendered dynamically (`required `): its fields live in the
+/// template. A signature on such a form covers the pages as saved, so a signed one is left as it
+/// is: laying it out would change what was signed.
pub fn is_dynamic(doc: &Document) -> bool {
- existing_layout(doc).is_none() && matches!(read_packets(doc), Ok(Some(p)) if p.needs_rendering || !p.has_fields)
+ existing_layout(doc).is_none()
+ && matches!(read_packets(doc), Ok(Some(p)) if p.needs_rendering
+ || !p.has_fields
+ || (packets::requires_dynamic_render(&p.xdp) && !packets::has_signature(doc)))
}
/// Lay a template packet (or whole XDP, whose datasets then fill the fields) out.
diff --git a/crates/xfa/src/packets.rs b/crates/xfa/src/packets.rs
index 00caabe589..faebfd7d44 100644
--- a/crates/xfa/src/packets.rs
+++ b/crates/xfa/src/packets.rs
@@ -28,6 +28,10 @@ fn check_text(len: usize) -> Result<(), XfaError> {
Ok(())
}
+/// Most XML nodes read when the XDP is parsed for its configuration, as many as the template
+/// parser allows.
+const MAX_XDP_NODES: u32 = 2_000_000;
+
/// What was found in the XFA entry.
#[derive(Clone, Debug, Default, PartialEq)]
pub struct Packets {
@@ -117,6 +121,70 @@ fn to_text(bytes: &[u8]) -> String {
}
}
+/// Whether the XDP's configuration packet asks for dynamic rendering: `required` at
+/// `config/acrobat/acrobat7/dynamicRender` (Designer writes it for a dynamic form). The packet is
+/// the `config` child of the `xdp` root (a whole-XDP stream, or an array's packets read in order
+/// between its preamble and postamble), or the document itself when it is a bare `config` packet.
+/// An element of that name anywhere else (a data node, inside the template) is not it. XML that
+/// doesn't parse, or has a DTD, asks for nothing.
+pub(crate) fn requires_dynamic_render(xdp: &str) -> bool {
+ let opts = crate::xml::ParsingOptions { allow_dtd: false, nodes_limit: MAX_XDP_NODES };
+ let Ok(doc) = crate::xml::Document::parse_with_options(xdp, opts) else { return false };
+ let root = doc.root_element();
+ /// `n`'s first child element named `name` (any namespace).
+ fn child<'a>(n: crate::xml::Node<'a>, name: &str) -> Option> {
+ n.children().find(|c| c.is_element() && c.tag_name().name() == name)
+ }
+ let config = match root.tag_name().name() {
+ "config" => Some(root),
+ "xdp" => child(root, "config"),
+ _ => None,
+ };
+ config
+ .and_then(|c| child(c, "acrobat"))
+ .and_then(|a| child(a, "acrobat7"))
+ .and_then(|a| child(a, "dynamicRender"))
+ .and_then(|d| d.text())
+ .is_some_and(|t| t.trim() == "required")
+}
+
+/// Whether the AcroForm holds a signed signature field (`/FT /Sig` with a value), looked for at
+/// most 32 levels deep and among at most 10 000 fields. A form whose fields go past either limit
+/// counts as signed: what wasn't looked at may be, and laying a signed form out would change
+/// what was signed.
+pub(crate) fn has_signature(doc: &Document) -> bool {
+ let Some(root) = doc.root() else { return false };
+ let catalog = doc.get(root);
+ let Some(acro) = catalog.as_dict().and_then(|c| c.get(b"AcroForm")).map(|a| doc.resolve(a)) else { return false };
+ let Some(fields) = acro.as_dict().and_then(|a| a.get(b"Fields")).map(|f| doc.resolve(f)) else { return false };
+ let Some(fields) = fields.as_array() else { return false };
+ // (field, inherited field type, depth)
+ let mut todo: Vec<(Object, bool, usize)> = fields.iter().map(|f| (f.clone(), false, 0)).collect();
+ let mut seen = std::collections::HashSet::new();
+ let mut budget = 10_000usize;
+ while let Some((f, sig_above, depth)) = todo.pop() {
+ if budget == 0 || depth > 32 {
+ return true;
+ }
+ if f.as_ref().is_some_and(|r| !seen.insert(r)) {
+ continue;
+ }
+ budget -= 1;
+ let f = doc.resolve(&f);
+ let Some(d) = f.as_dict() else { continue };
+ let sig = d.name(b"FT").map_or(sig_above, |t| t == b"Sig");
+ if sig && d.get(b"V").is_some_and(|v| !matches!(&*doc.resolve(v), Object::Null)) {
+ return true;
+ }
+ if let Some(kids) = d.get(b"Kids").map(|k| doc.resolve(k))
+ && let Some(kids) = kids.as_array()
+ {
+ todo.extend(kids.iter().map(|k| (k.clone(), sig, depth + 1)));
+ }
+ }
+ false
+}
+
/// Read the XFA packets, if the document has any.
pub fn read_packets(doc: &Document) -> Result, XfaError> {
let Some(root) = doc.root() else { return Ok(None) };
diff --git a/crates/xfa/src/tests.rs b/crates/xfa/src/tests.rs
index 6cd0745403..aa9893dadf 100644
--- a/crates/xfa/src/tests.rs
+++ b/crates/xfa/src/tests.rs
@@ -597,6 +597,58 @@ fn tables_break_across_pages_and_repeat_their_header_row() {
assert_eq!(all.len(), all.iter().collect::>().len(), "field names are unique");
}
+/// A form a viewer saved with its pages drawn, holding only its signature box, is laid out from
+/// its template when its configuration says it must be rendered dynamically: its other fields
+/// live there. Signed, it is left as saved (laying it out would change what was signed), as it is
+/// without that configuration or with `forbidden`.
+#[test]
+fn a_form_saved_with_its_pages_is_laid_out_when_it_requires_dynamic_rendering() {
+ let open = |render: &str, signed: bool| Document::open(Arc::new(crate::fixtures::saved_with_pages_shell(render, signed))).unwrap();
+ let mut doc = open("required", false);
+ assert!(is_dynamic(&doc));
+ let report = render_into(&mut doc).unwrap();
+ assert_eq!(report.fields, 2, "the text field from the template, and the signature box");
+ assert!(!is_dynamic(&open("required", true)), "signed: left as saved");
+ assert!(!is_dynamic(&open("", false)), "no configuration: the fields it has are the form's");
+ assert!(!is_dynamic(&open("forbidden", false)));
+ // A box under nested fields is found; past the 32 levels looked at, the form counts as signed.
+ let deep = |depth: usize| Document::open(Arc::new(crate::fixtures::deep_saved_with_pages_shell(depth))).unwrap();
+ assert!(is_dynamic(&deep(5)), "nested, unsigned");
+ assert!(!is_dynamic(&deep(40)), "too deep to tell: as if signed");
+ // The page lists the box under its new number, and the box knows its parent.
+ let doc = deep(5);
+ let page = doc.get(pdfcraft_cos::ObjRef::new(3, 0));
+ let annot = page.as_dict().and_then(|d| d.get(b"Annots")).and_then(|a| a.as_array().and_then(|a| a.first().cloned())).and_then(|a| a.as_ref());
+ let widget = annot.map(|r| doc.get(r));
+ assert_eq!(widget.as_ref().and_then(|w| w.as_dict().and_then(|d| d.name(b"FT")).map(<[u8]>::to_vec)), Some(b"Sig".to_vec()));
+ assert!(widget.as_ref().and_then(|w| w.as_dict().map(|d| d.contains(b"Parent"))).unwrap_or(false));
+}
+
+/// Only the configuration packet's `acrobat/acrobat7/dynamicRender` asks for dynamic rendering:
+/// not the same element elsewhere, another element that starts with `config`, or another value.
+#[test]
+fn dynamic_rendering_is_read_from_the_configuration_only() {
+ let required = crate::packets::requires_dynamic_render;
+ let config = |inner: &str| {
+ format!(
+ r#"{inner} "#
+ )
+ };
+ assert!(required(&config(" required ")));
+ assert!(!required(&config("forbidden ")));
+ assert!(!required(&config("required ")), "not under acrobat7");
+ assert!(!required(&config("")));
+ assert!(!required("required "));
+ assert!(!required("required "));
+ assert!(!required("required"), "no end tag");
+ // A data node named `config` before the configuration packet is not the configuration.
+ let data_first = r#"required "#;
+ assert!(required(data_first), "the configuration packet after a data node named config");
+ let only_data = r#"required "#;
+ assert!(!required(only_data), "a data node shaped like a configuration");
+ assert!(required("required "), "a bare config packet");
+}
+
/// Laying a dynamic form out into its PDF replaces the placeholder page with the template's pages
/// and adds its fields (a radio group once), keeps the XFA packets and `/NeedsRendering` for Adobe's
/// viewers, writes each `/DR` font as an object of its own, and marks the form so it isn't laid out
diff --git a/parity/acrobat-features.toml b/parity/acrobat-features.toml
index b35970cd68..6cbab8f6c8 100644
--- a/parity/acrobat-features.toml
+++ b/parity/acrobat-features.toml
@@ -5453,8 +5453,8 @@ milestone = "M12"
status = "partial"
commands = ["file.open"]
tools = ["doc_open", "doc_info", "form_fields", "form_fill", "js_run", "form_focus"]
-evidence = ["crates/xfa/src/tests.rs::a_draw_turns_counter_clockwise_about_its_anchor", "crates/xfa/src/tests.rs::layout_places_captions_fields_and_sizes_containers_to_their_content", "crates/xfa/src/tests.rs::tables_break_across_pages_and_repeat_their_header_row", "crates/xfa/src/tests.rs::rendering_into_the_pdf_replaces_the_placeholder_page_and_adds_fields", "crates/engine/src/tests.rs::dynamic_xfa_forms_are_laid_out_on_open_filled_and_saved_incrementally", "crates/automation/tests/it/automation.rs::dynamic_xfa_forms_open_render_fill_and_save_through_tools", "crates/ui-egui/tests/it/xfa.rs::a_dynamic_xfa_form_is_laid_out_and_filled", "crates/xfa/src/tests.rs::nested_width_less_subforms_lay_out_in_polynomial_time", "crates/js/src/tests.rs::instance_managers_add_remove_and_count", "crates/xfa/src/tests.rs::the_form_tree_carries_values_presence_instances_and_the_events", "crates/engine/src/tests.rs::xfa_scripts_initialize_calculate_validate_toggle_and_add_rows", "crates/engine/src/tests.rs::xfa_date_arithmetic_reads_the_date_as_its_display_picture_shows_it", "crates/automation/tests/it/automation.rs::xfa_scripts_run_for_buttons_and_field_changes_through_tools", "crates/ui-egui/tests/it/xfa.rs::xfa_buttons_run_their_scripts_in_the_app", "crates/engine/src/tests.rs::hostile_xfa_open_scripts_are_merged_capped_kept_from_printing_and_noted", "crates/engine/src/tests.rs::runaway_xfa_calculations_at_open_end_quickly_with_a_report", "crates/ui-egui/tests/it/xfa.rs::a_form_whose_scripts_were_turned_off_at_open_says_so", "crates/ui-egui/tests/it/xfa.rs::scripts_turned_off_by_a_click_bring_a_closed_notice_bar_back", "crates/automation/tests/it/automation.rs::doc_info_says_when_a_runaway_script_turned_the_forms_scripts_off", "crates/xfa/src/tests.rs::the_live_form_of_nested_repeating_subforms_stops_at_its_node_budget", "crates/xfa/src/tests.rs::data_ops_of_one_event_are_one_datasets_rewrite", "crates/xfa/src/tests.rs::choice_lists_signatures_passwords_and_pictures_become_fields_and_images", "crates/xfa/src/tests.rs::choice_values_come_from_the_data_as_saved_values_and_several_for_lists", "crates/xfa/src/tests.rs::pictures_are_sized_from_their_headers_and_hostile_ones_are_refused_unallocated", "crates/engine/src/tests.rs::xfa_choice_lists_signature_and_picture_fields_open_fill_script_and_save", "crates/xfa/src/tests.rs::repeating_subforms_inside_positioned_content_get_their_instances", "crates/engine/src/tests.rs::xfa_rows_in_areas_are_laid_out_read_calculated_and_written_where_adobe_binds_them", "crates/xfa/src/tests.rs::page_area_without_occur_serves_every_body_page", "apps/pdfcraft-cli/tests/it/xfa.rs::info_reports_the_laid_out_pages_and_fields", "apps/pdfcraft-cli/tests/it/xfa.rs::text_reads_the_layout_including_a_page_absent_from_the_placeholder", "apps/pdfcraft-cli/tests/it/xfa.rs::render_matches_the_engine_layout_on_the_second_page", "apps/pdfcraft-cli/tests/it/xfa.rs::a_laid_out_form_keeps_the_original_copy_permissions", "crates/engine/src/tests.rs::filling_growable_xfa_text_reflows_and_undo_restores_the_layout", "crates/engine/src/tests.rs::xfa_text_growth_refreshes_widget_geometry_but_fixed_height_fields_keep_their_widgets", "crates/automation/tests/it/automation.rs::growable_xfa_text_paginates_after_fill_save_and_print", "crates/engine/src/tests.rs::an_xfa_script_that_fails_partway_keeps_what_it_changed_before_the_error", "crates/engine/src/tests.rs::repeated_xfa_print_buttons_run_their_click_script", "crates/automation/tests/it/automation.rs::repeated_xfa_print_buttons_work_through_tools_and_after_reopen", "crates/xfa/src/tests.rs::rich_text_max_length_reaches_the_field_and_layout", "crates/automation/tests/it/automation.rs::xfa_rich_text_max_length_is_reported_and_enforced_through_tools", "crates/xfa/src/tests.rs::bmp_and_tiff_pictures_are_decoded_and_drawn", "crates/engine/src/tests.rs::active_xfa_does_not_run_pdf_container_scripts_but_keeps_requested_alerts", "crates/engine/src/tests.rs::active_xfa_without_template_scripts_does_not_initialize_pdf_fallback_scripts", "crates/engine/src/tests.rs::inactive_xfa_and_ordinary_pdfs_keep_document_helpers_and_alerts", "crates/automation/tests/it/automation.rs::active_xfa_skips_container_fallback_scripts_after_save_and_reopen", "crates/xfa/src/tests.rs::laying_a_form_out_takes_off_the_usage_rights_it_voids", "crates/engine/src/tests.rs::a_dynamic_xfa_form_is_saved_without_the_usage_rights_its_layout_voided", "crates/xfa/src/tests.rs::faces_measure_text_at_their_standard_14_widths", "crates/xfa/src/tests.rs::rich_text_links_keep_their_address", "crates/xfa/src/tests.rs::links_in_rich_text_become_link_annotations_one_per_line", "crates/xfa/src/tests.rs::a_links_pieces_share_one_address", "crates/xfa/src/tests.rs::a_rule_between_two_pieces_of_a_link_keeps_them_apart", "crates/xfa/src/tests.rs::links_to_anything_but_web_and_email_addresses_stay_plain_text", "crates/automation/tests/it/automation.rs::links_in_xfa_rich_text_are_listed_through_tools", "crates/xfa/src/tests.rs::rounded_corners_make_a_border_one_rounded_shape", "crates/xfa/src/tests.rs::a_rounded_box_cut_by_a_page_break_keeps_its_corners_on_each_page", "crates/xfa/src/tests.rs::rounded_boxes_are_written_as_curved_paths", "crates/xfa/src/tests.rs::a_flowed_subform_is_drawn_with_its_border_under_its_content", "crates/xfa/src/tests.rs::a_check_box_sits_where_its_margins_caption_and_alignment_put_it", "crates/xfa/src/tests.rs::a_check_box_caption_without_a_reserve_takes_the_rest_of_the_field", "crates/xfa/src/tests.rs::a_radio_button_sits_where_a_check_box_would", "crates/xfa/src/tests.rs::a_check_box_caption_without_a_reserve_is_measured_as_it_is_drawn", "crates/js/src/tests.rs::message_box_keeps_its_title_icon_and_buttons", "crates/js/src/tests.rs::app_alert_in_an_xfa_script_reads_app_alerts_arguments", "crates/engine/src/tests.rs::xfa_message_boxes_keep_their_title_icon_and_buttons", "crates/xfa/src/tests.rs::signature_fields_are_named_by_their_som_path", "crates/xfa/src/tests.rs::a_signature_on_a_laid_out_box_survives_a_new_layout", "crates/xfa/src/tests.rs::the_template_knows_its_floating_fields_and_sheet_roles", "crates/engine/src/tests.rs::text_shows_the_values_scripts_give_its_floating_fields", "crates/js/src/tests.rs::the_sheet_is_the_page_on_screen", "crates/xfa/src/tests.rs::embedded_text_shows_each_instances_data", "crates/xfa/src/tests.rs::an_embedded_sheet_number_counts_the_pages", "crates/engine/src/tests.rs::floating_fields_follow_their_data_whoever_writes_it", "crates/forms/src/af/tests.rs::xfa_date_fields_keep_and_show_what_their_pattern_does_not_read", "crates/automation/tests/it/automation.rs::xfa_date_fields_keep_typed_dates_as_another_viewer_does", "crates/xfa/src/tests.rs::relevant_and_presence_say_where_fields_and_draws_show", "crates/xfa/src/tests.rs::screen_only_and_print_only_objects_are_written_with_flags_and_layers", "crates/xfa/src/tests.rs::a_master_page_started_by_a_screen_only_subform_keeps_its_own_objects_everywhere", "crates/engine/src/tests.rs::xfa_screen_only_and_print_only_objects_show_and_print_where_the_form_says", "crates/xfa/src/tests.rs::links_in_screen_only_and_print_only_text_work_where_their_text_shows", "crates/engine/src/tests.rs::xfa_enter_and_exit_scripts_run_on_every_focus_change", "crates/engine/src/tests.rs::an_exit_the_fields_change_ran_does_not_run_twice", "crates/engine/src/tests.rs::a_radio_buttons_own_focus_scripts_run", "crates/automation/tests/it/automation.rs::xfa_focus_scripts_run_through_form_focus", "crates/ui-egui/tests/it/xfa.rs::xfa_enter_and_exit_scripts_run_whenever_the_focus_moves", "crates/engine/src/tests.rs::xfa_signing_scripts_run_before_and_after_signing", "crates/automation/tests/it/automation.rs::signing_an_xfa_box_runs_its_signing_scripts_through_tools", "crates/xfa/src/tests.rs::fields_that_must_be_filled_in_are_required", "crates/xfa/src/proto/tests.rs::fields_and_draws_take_size_border_fill_caption_and_font_from_a_style_sheet", "crates/xfa/src/proto/tests.rs::what_an_element_declares_overrides_what_it_inherits", "crates/xfa/src/proto/tests.rs::prototypes_inherit_from_prototypes", "crates/xfa/src/proto/tests.rs::prototype_loops_end_with_a_warning", "crates/xfa/src/proto/tests.rs::a_reference_to_nothing_or_another_document_is_left_as_it_is", "crates/xfa/src/proto/tests.rs::an_expansion_past_its_budget_leaves_the_template_unresolved_with_a_warning", "crates/xfa/src/proto/tests.rs::hostile_references_neither_panic_nor_run_away", "crates/xfa/src/tests.rs::a_caption_without_a_font_of_its_own_takes_its_fields", "crates/engine/src/tests.rs::xfa_initialize_scripts_that_hide_subforms_lay_the_form_out_once", "crates/engine/src/tests.rs::xfa_resets_in_a_row_reset_every_named_subform_and_nothing_else", "crates/js/src/tests.rs::hosts_given_the_same_form_reuse_its_flattened_copy_and_change_only_their_own", "crates/js/src/tests.rs::a_form_sent_again_does_not_carry_the_last_scripts_changes", "crates/xfa/src/tests.rs::corners_not_listed_follow_the_edge_pattern", "crates/js/src/xfa/props_tests.rs::unspecified_properties_read_as_the_spec_defaults", "crates/js/src/xfa/props_tests.rs::widget_border_and_validate_reads_throw_no_type_error", "crates/js/src/xfa/props_tests.rs::writes_are_read_back_in_the_run_and_have_no_effect", "crates/js/src/xfa/props_tests.rs::a_calculation_reads_its_override_script_and_message", "crates/js/src/xfa/props_tests.rs::a_fill_type_the_fill_does_not_have_throws_and_leaves_the_fill_as_it_was", "crates/xfa/src/props_tests.rs::a_calculation_is_kept_with_its_override_message_and_script", "crates/xfa/src/props_tests.rs::hostile_property_trees_are_cut_to_the_limits", "crates/engine/src/xfa.rs::a_click_script_reads_field_properties", "crates/engine/src/xfa.rs::snapshots_share_property_trees_across_runs_and_events", "crates/engine/src/tests.rs::xfa_check_box_and_radio_button_clicks_run_their_click_scripts", "crates/automation/tests/it/automation.rs::xfa_check_box_and_radio_clicks_run_through_form_fill", "crates/ui-egui/tests/it/xfa.rs::xfa_check_box_and_radio_clicks_run_their_click_scripts_in_the_app", "crates/engine/src/tests.rs::an_xfa_script_that_shows_a_section_adds_its_page_and_undo_takes_it_away", "crates/engine/src/tests.rs::an_xfa_script_relayout_that_keeps_the_page_count_moves_fields_in_the_view", "crates/engine/src/tests.rs::an_xfa_reset_whose_calculations_hide_a_section_takes_its_page_away", "crates/automation/tests/it/automation.rs::an_xfa_script_that_adds_a_page_is_seen_and_saved_through_tools", "crates/engine/src/tests.rs::ready_events_run_in_order_and_layout_ready_runs_again_after_a_new_layout", "crates/engine/src/tests.rs::calculations_run_before_form_ready_which_runs_in_reverse", "crates/xfa/src/tests.rs::date_fields_are_shown_through_their_display_picture", "crates/automation/tests/it/automation.rs::xfa_date_fields_show_typed_dates_through_their_display_picture"]
-notes = "A draw placed by position turns about its anchor (rotate); fields, subforms and draws in a flow don't. Active XFA layout skips PDF-container document-script initialization for the Acrobat console/field context, so fallback-viewer scripts do not run there. Scripts remain in the file/listing; explicit console/field and XFA alerts still run. Ordinary PDF, static XFA and unlaid-out shells keep document scripts; static-conversion undo restores the XFA policy. Changed growable multiline text (no fixed h) reflows from final datasets after edits, with or without scripts; pages/widgets refresh and undo/redo, save/reopen and print retain all text. A field change, reset or picture whose scripts or data lay the form out again (a section shown that needs another page, or hidden again) rebuilds the pages and fields the same way, whether or not the page count changed, so the view, undo/redo and save see the new pages. Oversized text still uses the existing read-only page-text fallback with a warning; fixed-height fields do not reflow. Repeated page-master buttons resolve their own PDF field to the shared XFA click script; the numPages-based print script requests printing from every copy, including after save/reopen (#2572). Rich-text exData/maxLength is carried into AcroForm MaxLen, reported by form_fields and enforced by form_fill (Unicode characters); limits and accepted values survive save/reopen (#2570). laid out from the template on open by the xfa crate (prototypes first: use/usehref references to #id or #som(...) in the same template, as Designer style sheets write them, are merged in by the XFA 3.3 chapter 6 rules, the element's own attributes and children winning, with loops cut and chain length, nesting, look-up and merge work and growth capped, each with a warning; prototypes in other documents are not followed, and SOM references cover names, #class and [n] only; positioned, tb, lr-tb, table/row, page masters (a page area with no occur repeats without limit, one with occur max=1 is used once, one with occur min=1 the body never reached gets a page after the body, as Acrobat Pro does on a synthetic form), breaks, repeated header rows, borders and fills of flowed subforms (a page break between their children gives each page's part a closed border, the margins repeated at the cut, as measured on a synthetic form in another viewer, and a child's own page break breaks them the same way; one holding an item that doesn't fit on its page, cut across pages or placed past the content area's bottom, is drawn without its border, with a layout warning), captions (in their field's font unless they name their own), objects shown only on screen or only in print (relevant -print and +print, inside containers too: fields by their annotation flags, draws in optional content groups whose view and print usage say so; PdfCraft's own printing doesn't yet apply a layer's print usage, so a screen-only or print-only draw prints as it shows on screen, and a hidden object relevant prints isn't laid out), rounded and inverted border corners (XFA 3.3 p. 38 gives the order of edges and corners and says the last one listed is reused for the sides not listed; readers draw an unlisted edge or corner from the one on the same side instead, one serving all four, two alternating, three reusing the second for the bottom-left; edges already followed the readers, and corners now do too), rich text (its http, https and mailto links clickable), JPEG/PNG/GIF/BMP/TIFF images) into real pages and AcroForm fields (text, password, date with AFDate formats (a date one of the edit picture's patterns reads is kept in its first, and in the data as an ISO date; text none of them reads, ISO text included, is kept and shown as typed rather than refused, as another viewer keeps it on a synthetic form; shown through the field's display picture (weekday and month names included) and typed in its edit picture's pattern, as another viewer shows a date on a synthetic form, a two-digit year in that pattern read with XFA's century split of 30 (00 to 29 are 2000 to 2029); the field holds its date in the edit pattern whether it came from the data, the template's default or typing, so it never reads two ways; a field with no picture at all shows yyyy-mm-dd, where that viewer uses its locale's default), check boxes and radio groups (each box placed by its field's margins, caption and paragraph alignment as measured on two synthetic forms in another viewer: with no caption at the right of the content area, beside a reserved caption where the alignment puts it, and a caption without a reserve taking the rest of the field; a check box's own margin larger than the box draws a bigger box there, which isn't copied), drop-downs and list boxes with shown/saved item pairs and multi-select, signature fields (each named by its SOM path, under a generated field for each step above it, so that another viewer, which lays the form out again, finds a signature made here, as seen on a synthetic form, and a box signed here keeps its signature, and that name, when a script lays the form out again; a box whose path, or a part of it, the file already gives another field keeps its own name, and its signature isn't found there yet), image fields showing their picture (pictures decoded once per document, at most 20 million pixels, and reused across re-layouts), buttons with reset/print/save/URL; a field or exclusion group that must be filled in, validate nullTest=\"error\", is Required, so field highlighting outlines it as another viewer does on a real form; a push button, which keeps no value, is not), filled from the datasets packet (including rows another viewer added), saved as an incremental revision with the values merged into the datasets so Adobe's viewers show them; usage rights the form carried (/Perms /UR3) are taken off with a note, as the layout voids them and a form with void usage rights opens with every field locked; doc_info reports xfa_layout. CLI info reports the laid-out page/field counts and dimensions while retaining the input file size and raw counts as pdf_pages/acroform_fields; text and render use those pages too, preserving copy permissions and leaving the source file unchanged (#1645). XFA JavaScript and FormCalc (form.xfa-formcalc) run in the js crate's XFA object model (xfa.form, SOM resolution, rawValue, formattedValue in a date display picture's pattern (number and text display pictures still give the raw value), presence, access, instance managers, xfa.host, xfa.layout, xfa.event, and property objects (XFA 3.3 ch. 3 p. 78, ch. 17), every property path the 367 inventoried forms read (the one known gap is value.text and value.exData, read by about 15 of them: a node's value stays its raw value, and changing what value returns is left to a follow-up with a full-corpus regression check): read as the template writes them, with the spec's defaults for what those forms read where it leaves them out (presence of border (hidden when the object has no border element, as readers read it), edge, corner and fill; an edge or corner past those the template lists, up to four (a border's fifth and later are out of reach, as the layout draws four), as the one drawn on that side (XFA 3.3 p. 38 says the last one listed is reused for the sides not listed; readers draw such a side from the edge or corner on the same side instead, two listed alternating, three reusing the second for the fourth, one serving every side, and reads follow the readers; with none listed, the defaults: thickness 0.5pt, solid, square cap, black, a corner's radius 0in, square join, not inverted, pp. 663, 687), made as a copy of it when a script reaches it so that a write changes only that side (copies have their own budget, apart from the script's writes); colours (a border fill white, a font fill, edges and corners black); font typeface, size and weight; para hAlign and vAlign; validate nullTest, scriptTest and formatTest; occur min, max and initial; a fill's type solid and a field's widget textEdit; margin insets; break before and after; bind ref; a comb's numberOfCells; a calculation's override, disabled where the template has no calculate element and error where it has one, pp. 641-642), other unspecified attributes reading as an empty value that compares as \"\" and never throws (further defaults are added as forms need them): border with its edges, corners and fill (colour, linear/radial/pattern/stipple/solid), font, para, margin, ui and its widget as oneOfChild (with the widget's own border and margin), validate with its message texts and picture, occur, break/breakBefore/breakAfter, assist with toolTip and speak, format with its picture, the value element's content type, caption, items, bind, desc, the object's extras, calculate with its script and message, and keep (intact, next, previous; intact defaults by container, pp. 762-763), with className, oneOfChild, children by name (desc.vMandatory, message.scriptTest) and by class (ui[\"#textEdit\"]), getElement(name, index), isPropertySpecified, getAttribute, setAttribute, rawValue (a desc's first text), a validate's script text, resolveNode(s), somExpression and nodes (length/item/namedItem) on them, SOM expressions from a node that run into its properties (resolveNode(\"ui.#textEdit\"), \"border.edge[1]\", \"extras.arrayGroup[*].groupName\", \"ui.*\"), getAttribute, getElement and isPropertySpecified on nodes, and a node's mandatory, validationMessage, formatMessage and mandatoryMessage read from its validate (a single unnamed message text serves every test, p. 782, and setting one overwrites it, as readers do; reading validate.message. where no such text exists raises a script error, as in readers), and fillColor, fontColor and borderColor from its border fill, font fill and edge colours (borderColor set colours all four edges); what a script writes to them is read back later in the same script but has no effect on the form yet. The caption (its value as text or rich text, read as its words, by name, class, resolveNode or oneOfChild, XFA 3.3 p. 643) and a field's items (each entry as the list or check button shows it, p. 758) are property objects too; a value content the element doesn't hold reads as null, and a fill type the fill doesn't have (its pattern when it is solid) raises an error the script can catch and leaves the fill as it was, as readers do; exData.loadXML and saveXML do nothing yet. PdfCraft's choice-list methods are not on main yet (addItem, clearItems and boundItem are missing, and selectedIndex reads give an object that takes anything); until they land, items reads follow the template. FormCalc reads none of these properties yet): on open initialize (children before their parent), calculate, form:ready (in the reverse of initialize's order), layout:ready and docReady, in the order another viewer runs them on a synthetic form, and calculate once more when a ready script wrote a value (all calculations: which read it isn't recorded); validate scripts don't run on open; layout:ready again, once each, after a script or typing into a growable field lays the form out again (with the new page count); exit, validate and calculate after a field changes, click for buttons (through js_run and the app) and for check boxes and radio buttons each time a click changes them, after their change scripts, a radio group's change and click scripts running before those of the button now on, in the order another viewer runs them on a synthetic form (in the app and through form_fill), enter and exit each time a field gains or loses focus, changed or not (through form_focus and the app; a radio button runs its own; an exit its change already ran is not run again, and scripts that change nothing leave no edit; exit as measured on a synthetic form in another viewer, enter from the spec and not measured), preSign as signing a box begins, so what it changes (a date, a lock) and says shows before the signer confirms and is signed too, taken back if signing ends without a signature, and postSign once signed (in the app; through sign_document when run_form_scripts asks, with every field preSign changed listed), with rows added and removed, subforms shown and hidden, and the form laid out again, all as one undo step and kept in the file. All the scripts of one event run on one thread, each in a fresh context on the form as the engine holds it then (nothing shared between scripts; the live form kept up to date in place for values, rebuilt only when the structure changed, and each script starting from a copy of one flattened form, shared until the form changes; resets in a row applied together), so hundreds of calculations, and a 1,300-script form's initialize scripts, run within the open budget. Hostile scripts are bounded per event (merged and capped effects, messages and console lines, lower loop limits and a time budget on open and calculate, one datasets rewrite per event, print/save/links/focus from clicks only, a runaway script abandoned and the form's scripts turned off, which the app says in a toast and on the notice bar, with a button to the JavaScript console, and doc_info reports as xfa_scripts_off) and what open-time scripts changed is noted. Opening lays the form out once, after its initialize and calculate scripts (which read the live form, not the pages), so a form whose initialize scripts hide many sections is initialized within the open budget and opens again as it was saved; a large form can still run out of that budget, and what it skips is reported. A script that fails partway keeps what it changed before the error, as JavaScript does (forms often trip over an object an earlier version had after their first lines did the work). Missing: the extra layout:ready another viewer runs on opening after scripts change only field text; value.text and value.exData (a node's value is still its raw value, and value.#text on a draw resolves to null); property writes (border, colours, validate.nullTest, occur, toolTip) taking effect and being saved; node setAttribute, clone, createNode and nodes.append/insert/remove; property reads from FormCalc; a page area's relevant=\"-print\" (on a synthetic form Acrobat still prints the page but leaves it blank; PdfCraft prints its content, #2574); a page break before the first section (Acrobat opens an empty body page first when the first section has breakBefore targetType=pageArea, with or without startNew, as seen on synthetic forms; PdfCraft skips a break on an empty page and lays out one page fewer, #2574); loops inside nested calls are only stopped by abandoning their thread, and script memory is not capped; a radio group's own enter and exit scripts; the change event per keystroke; a postSign script that checks its signature through event.target.getField(...).signatureValidate() fails, as event.target isn't the document yet, and a preSign script's message is a notice, where another viewer asks for an answer before it goes on; a check box's or radio button's exit scripts run after each click, where another viewer runs them once, when it loses the focus; xfa.template, connections and data descriptions; a hidden instance of a repeating subform hides them all; barcodes are drawn as their text, not bars; keep rules; text is measured at the exact standard-14 widths of the face it is drawn in (bold, italic and Times included), not in the template's own typefaces, and Acrobat fidelity is eyeballed on real forms, not measured (#60). xfa.host.messageBox keeps its title, icon and buttons, and app.alert in an XFA script reads its own argument order; every message box still answers OK (1) (#4291). Text that embeds a field (a floating field, XFA 3.3 p. 1222) shows the field's value from the data, so a value an initialize, click or calculate script gives it shows, and an event that changes one lays the form out again when it ends; xfa.layout.sheet (from 0) and sheetCount treat each page as a sheet, and an embedded sheet number or count shows as the page number or count does. A repeating row shows its own instance's value, a page area's field the value written under the area, and a typed value or a reset lays the text out again. Missing: fields inside an exclusion group (#6160)."
+evidence = ["crates/xfa/src/tests.rs::a_draw_turns_counter_clockwise_about_its_anchor", "crates/xfa/src/tests.rs::layout_places_captions_fields_and_sizes_containers_to_their_content", "crates/xfa/src/tests.rs::tables_break_across_pages_and_repeat_their_header_row", "crates/xfa/src/tests.rs::rendering_into_the_pdf_replaces_the_placeholder_page_and_adds_fields", "crates/xfa/src/tests.rs::a_form_saved_with_its_pages_is_laid_out_when_it_requires_dynamic_rendering", "crates/engine/src/tests.rs::a_form_saved_with_its_pages_that_requires_dynamic_rendering_is_laid_out_unless_signed", "crates/engine/src/tests.rs::dynamic_xfa_forms_are_laid_out_on_open_filled_and_saved_incrementally", "crates/automation/tests/it/automation.rs::dynamic_xfa_forms_open_render_fill_and_save_through_tools", "crates/ui-egui/tests/it/xfa.rs::a_dynamic_xfa_form_is_laid_out_and_filled", "crates/xfa/src/tests.rs::nested_width_less_subforms_lay_out_in_polynomial_time", "crates/js/src/tests.rs::instance_managers_add_remove_and_count", "crates/xfa/src/tests.rs::the_form_tree_carries_values_presence_instances_and_the_events", "crates/engine/src/tests.rs::xfa_scripts_initialize_calculate_validate_toggle_and_add_rows", "crates/engine/src/tests.rs::xfa_date_arithmetic_reads_the_date_as_its_display_picture_shows_it", "crates/automation/tests/it/automation.rs::xfa_scripts_run_for_buttons_and_field_changes_through_tools", "crates/ui-egui/tests/it/xfa.rs::xfa_buttons_run_their_scripts_in_the_app", "crates/engine/src/tests.rs::hostile_xfa_open_scripts_are_merged_capped_kept_from_printing_and_noted", "crates/engine/src/tests.rs::runaway_xfa_calculations_at_open_end_quickly_with_a_report", "crates/ui-egui/tests/it/xfa.rs::a_form_whose_scripts_were_turned_off_at_open_says_so", "crates/ui-egui/tests/it/xfa.rs::scripts_turned_off_by_a_click_bring_a_closed_notice_bar_back", "crates/automation/tests/it/automation.rs::doc_info_says_when_a_runaway_script_turned_the_forms_scripts_off", "crates/xfa/src/tests.rs::the_live_form_of_nested_repeating_subforms_stops_at_its_node_budget", "crates/xfa/src/tests.rs::data_ops_of_one_event_are_one_datasets_rewrite", "crates/xfa/src/tests.rs::choice_lists_signatures_passwords_and_pictures_become_fields_and_images", "crates/xfa/src/tests.rs::choice_values_come_from_the_data_as_saved_values_and_several_for_lists", "crates/xfa/src/tests.rs::pictures_are_sized_from_their_headers_and_hostile_ones_are_refused_unallocated", "crates/engine/src/tests.rs::xfa_choice_lists_signature_and_picture_fields_open_fill_script_and_save", "crates/xfa/src/tests.rs::repeating_subforms_inside_positioned_content_get_their_instances", "crates/engine/src/tests.rs::xfa_rows_in_areas_are_laid_out_read_calculated_and_written_where_adobe_binds_them", "crates/xfa/src/tests.rs::page_area_without_occur_serves_every_body_page", "apps/pdfcraft-cli/tests/it/xfa.rs::info_reports_the_laid_out_pages_and_fields", "apps/pdfcraft-cli/tests/it/xfa.rs::text_reads_the_layout_including_a_page_absent_from_the_placeholder", "apps/pdfcraft-cli/tests/it/xfa.rs::render_matches_the_engine_layout_on_the_second_page", "apps/pdfcraft-cli/tests/it/xfa.rs::a_laid_out_form_keeps_the_original_copy_permissions", "crates/engine/src/tests.rs::filling_growable_xfa_text_reflows_and_undo_restores_the_layout", "crates/engine/src/tests.rs::xfa_text_growth_refreshes_widget_geometry_but_fixed_height_fields_keep_their_widgets", "crates/automation/tests/it/automation.rs::growable_xfa_text_paginates_after_fill_save_and_print", "crates/engine/src/tests.rs::an_xfa_script_that_fails_partway_keeps_what_it_changed_before_the_error", "crates/engine/src/tests.rs::repeated_xfa_print_buttons_run_their_click_script", "crates/automation/tests/it/automation.rs::repeated_xfa_print_buttons_work_through_tools_and_after_reopen", "crates/xfa/src/tests.rs::rich_text_max_length_reaches_the_field_and_layout", "crates/automation/tests/it/automation.rs::xfa_rich_text_max_length_is_reported_and_enforced_through_tools", "crates/xfa/src/tests.rs::bmp_and_tiff_pictures_are_decoded_and_drawn", "crates/engine/src/tests.rs::active_xfa_does_not_run_pdf_container_scripts_but_keeps_requested_alerts", "crates/engine/src/tests.rs::active_xfa_without_template_scripts_does_not_initialize_pdf_fallback_scripts", "crates/engine/src/tests.rs::inactive_xfa_and_ordinary_pdfs_keep_document_helpers_and_alerts", "crates/automation/tests/it/automation.rs::active_xfa_skips_container_fallback_scripts_after_save_and_reopen", "crates/xfa/src/tests.rs::laying_a_form_out_takes_off_the_usage_rights_it_voids", "crates/engine/src/tests.rs::a_dynamic_xfa_form_is_saved_without_the_usage_rights_its_layout_voided", "crates/xfa/src/tests.rs::faces_measure_text_at_their_standard_14_widths", "crates/xfa/src/tests.rs::rich_text_links_keep_their_address", "crates/xfa/src/tests.rs::links_in_rich_text_become_link_annotations_one_per_line", "crates/xfa/src/tests.rs::a_links_pieces_share_one_address", "crates/xfa/src/tests.rs::a_rule_between_two_pieces_of_a_link_keeps_them_apart", "crates/xfa/src/tests.rs::links_to_anything_but_web_and_email_addresses_stay_plain_text", "crates/automation/tests/it/automation.rs::links_in_xfa_rich_text_are_listed_through_tools", "crates/xfa/src/tests.rs::rounded_corners_make_a_border_one_rounded_shape", "crates/xfa/src/tests.rs::a_rounded_box_cut_by_a_page_break_keeps_its_corners_on_each_page", "crates/xfa/src/tests.rs::rounded_boxes_are_written_as_curved_paths", "crates/xfa/src/tests.rs::a_flowed_subform_is_drawn_with_its_border_under_its_content", "crates/xfa/src/tests.rs::a_check_box_sits_where_its_margins_caption_and_alignment_put_it", "crates/xfa/src/tests.rs::a_check_box_caption_without_a_reserve_takes_the_rest_of_the_field", "crates/xfa/src/tests.rs::a_radio_button_sits_where_a_check_box_would", "crates/xfa/src/tests.rs::a_check_box_caption_without_a_reserve_is_measured_as_it_is_drawn", "crates/xfa/src/tests.rs::signature_fields_are_named_by_their_som_path", "crates/xfa/src/tests.rs::a_signature_on_a_laid_out_box_survives_a_new_layout", "crates/js/src/tests.rs::message_box_keeps_its_title_icon_and_buttons", "crates/js/src/tests.rs::app_alert_in_an_xfa_script_reads_app_alerts_arguments", "crates/engine/src/tests.rs::xfa_message_boxes_keep_their_title_icon_and_buttons", "crates/xfa/src/tests.rs::the_template_knows_its_floating_fields_and_sheet_roles", "crates/engine/src/tests.rs::text_shows_the_values_scripts_give_its_floating_fields", "crates/js/src/tests.rs::the_sheet_is_the_page_on_screen", "crates/xfa/src/tests.rs::embedded_text_shows_each_instances_data", "crates/xfa/src/tests.rs::an_embedded_sheet_number_counts_the_pages", "crates/engine/src/tests.rs::floating_fields_follow_their_data_whoever_writes_it", "crates/forms/src/af/tests.rs::xfa_date_fields_keep_and_show_what_their_pattern_does_not_read", "crates/automation/tests/it/automation.rs::xfa_date_fields_keep_typed_dates_as_another_viewer_does", "crates/xfa/src/tests.rs::relevant_and_presence_say_where_fields_and_draws_show", "crates/xfa/src/tests.rs::screen_only_and_print_only_objects_are_written_with_flags_and_layers", "crates/xfa/src/tests.rs::a_master_page_started_by_a_screen_only_subform_keeps_its_own_objects_everywhere", "crates/engine/src/tests.rs::xfa_screen_only_and_print_only_objects_show_and_print_where_the_form_says", "crates/xfa/src/tests.rs::links_in_screen_only_and_print_only_text_work_where_their_text_shows", "crates/engine/src/tests.rs::xfa_enter_and_exit_scripts_run_on_every_focus_change", "crates/engine/src/tests.rs::an_exit_the_fields_change_ran_does_not_run_twice", "crates/engine/src/tests.rs::a_radio_buttons_own_focus_scripts_run", "crates/automation/tests/it/automation.rs::xfa_focus_scripts_run_through_form_focus", "crates/ui-egui/tests/it/xfa.rs::xfa_enter_and_exit_scripts_run_whenever_the_focus_moves", "crates/engine/src/tests.rs::xfa_signing_scripts_run_before_and_after_signing", "crates/automation/tests/it/automation.rs::signing_an_xfa_box_runs_its_signing_scripts_through_tools", "crates/xfa/src/tests.rs::fields_that_must_be_filled_in_are_required", "crates/xfa/src/proto/tests.rs::fields_and_draws_take_size_border_fill_caption_and_font_from_a_style_sheet", "crates/xfa/src/proto/tests.rs::what_an_element_declares_overrides_what_it_inherits", "crates/xfa/src/proto/tests.rs::prototypes_inherit_from_prototypes", "crates/xfa/src/proto/tests.rs::prototype_loops_end_with_a_warning", "crates/xfa/src/proto/tests.rs::a_reference_to_nothing_or_another_document_is_left_as_it_is", "crates/xfa/src/proto/tests.rs::an_expansion_past_its_budget_leaves_the_template_unresolved_with_a_warning", "crates/xfa/src/proto/tests.rs::hostile_references_neither_panic_nor_run_away", "crates/xfa/src/tests.rs::a_caption_without_a_font_of_its_own_takes_its_fields", "crates/engine/src/tests.rs::xfa_initialize_scripts_that_hide_subforms_lay_the_form_out_once", "crates/engine/src/tests.rs::xfa_resets_in_a_row_reset_every_named_subform_and_nothing_else", "crates/js/src/tests.rs::hosts_given_the_same_form_reuse_its_flattened_copy_and_change_only_their_own", "crates/js/src/tests.rs::a_form_sent_again_does_not_carry_the_last_scripts_changes", "crates/xfa/src/tests.rs::corners_not_listed_follow_the_edge_pattern", "crates/js/src/xfa/props_tests.rs::unspecified_properties_read_as_the_spec_defaults", "crates/js/src/xfa/props_tests.rs::widget_border_and_validate_reads_throw_no_type_error", "crates/js/src/xfa/props_tests.rs::writes_are_read_back_in_the_run_and_have_no_effect", "crates/js/src/xfa/props_tests.rs::a_calculation_reads_its_override_script_and_message", "crates/js/src/xfa/props_tests.rs::a_fill_type_the_fill_does_not_have_throws_and_leaves_the_fill_as_it_was", "crates/xfa/src/props_tests.rs::a_calculation_is_kept_with_its_override_message_and_script", "crates/xfa/src/props_tests.rs::hostile_property_trees_are_cut_to_the_limits", "crates/engine/src/xfa.rs::a_click_script_reads_field_properties", "crates/engine/src/xfa.rs::snapshots_share_property_trees_across_runs_and_events", "crates/engine/src/tests.rs::an_xfa_script_that_shows_a_section_adds_its_page_and_undo_takes_it_away", "crates/engine/src/tests.rs::an_xfa_script_relayout_that_keeps_the_page_count_moves_fields_in_the_view", "crates/engine/src/tests.rs::an_xfa_reset_whose_calculations_hide_a_section_takes_its_page_away", "crates/automation/tests/it/automation.rs::an_xfa_script_that_adds_a_page_is_seen_and_saved_through_tools", "crates/engine/src/tests.rs::ready_events_run_in_order_and_layout_ready_runs_again_after_a_new_layout", "crates/engine/src/tests.rs::calculations_run_before_form_ready_which_runs_in_reverse", "crates/xfa/src/tests.rs::date_fields_are_shown_through_their_display_picture", "crates/automation/tests/it/automation.rs::xfa_date_fields_show_typed_dates_through_their_display_picture", "crates/engine/src/tests.rs::xfa_check_box_and_radio_button_clicks_run_their_click_scripts", "crates/automation/tests/it/automation.rs::xfa_check_box_and_radio_clicks_run_through_form_fill", "crates/ui-egui/tests/it/xfa.rs::xfa_check_box_and_radio_clicks_run_their_click_scripts_in_the_app"]
+notes = "A draw placed by position turns about its anchor (rotate); fields, subforms and draws in a flow don't. Active XFA layout skips PDF-container document-script initialization for the Acrobat console/field context, so fallback-viewer scripts do not run there. Scripts remain in the file/listing; explicit console/field and XFA alerts still run. Ordinary PDF, static XFA and unlaid-out shells keep document scripts; static-conversion undo restores the XFA policy. Changed growable multiline text (no fixed h) reflows from final datasets after edits, with or without scripts; pages/widgets refresh and undo/redo, save/reopen and print retain all text. A field change, reset or picture whose scripts or data lay the form out again (a section shown that needs another page, or hidden again) rebuilds the pages and fields the same way, whether or not the page count changed, so the view, undo/redo and save see the new pages. Oversized text still uses the existing read-only page-text fallback with a warning; fixed-height fields do not reflow. Repeated page-master buttons resolve their own PDF field to the shared XFA click script; the numPages-based print script requests printing from every copy, including after save/reopen (#2572). Rich-text exData/maxLength is carried into AcroForm MaxLen, reported by form_fields and enforced by form_fill (Unicode characters); limits and accepted values survive save/reopen (#2570). laid out from the template on open by the xfa crate (prototypes first: use/usehref references to #id or #som(...) in the same template, as Designer style sheets write them, are merged in by the XFA 3.3 chapter 6 rules, the element's own attributes and children winning, with loops cut and chain length, nesting, look-up and merge work and growth capped, each with a warning; prototypes in other documents are not followed, and SOM references cover names, #class and [n] only; positioned, tb, lr-tb, table/row, page masters (a page area with no occur repeats without limit, one with occur max=1 is used once, one with occur min=1 the body never reached gets a page after the body, as Acrobat Pro does on a synthetic form), breaks, repeated header rows, borders and fills of flowed subforms (a page break between their children gives each page's part a closed border, the margins repeated at the cut, as measured on a synthetic form in another viewer, and a child's own page break breaks them the same way; one holding an item that doesn't fit on its page, cut across pages or placed past the content area's bottom, is drawn without its border, with a layout warning), captions (in their field's font unless they name their own), objects shown only on screen or only in print (relevant -print and +print, inside containers too: fields by their annotation flags, draws in optional content groups whose view and print usage say so; PdfCraft's own printing doesn't yet apply a layer's print usage, so a screen-only or print-only draw prints as it shows on screen, and a hidden object relevant prints isn't laid out), rounded and inverted border corners (XFA 3.3 p. 38 gives the order of edges and corners and says the last one listed is reused for the sides not listed; readers draw an unlisted edge or corner from the one on the same side instead, one serving all four, two alternating, three reusing the second for the bottom-left; edges already followed the readers, and corners now do too), rich text (its http, https and mailto links clickable), JPEG/PNG/GIF/BMP/TIFF images) into real pages and AcroForm fields (text, password, date with AFDate formats (a date one of the edit picture's patterns reads is kept in its first, and in the data as an ISO date; text none of them reads, ISO text included, is kept and shown as typed rather than refused, as another viewer keeps it on a synthetic form; shown through the field's display picture (weekday and month names included) and typed in its edit picture's pattern, as another viewer shows a date on a synthetic form, a two-digit year in that pattern read with XFA's century split of 30 (00 to 29 are 2000 to 2029); the field holds its date in the edit pattern whether it came from the data, the template's default or typing, so it never reads two ways; a field with no picture at all shows yyyy-mm-dd, where that viewer uses its locale's default), check boxes and radio groups (each box placed by its field's margins, caption and paragraph alignment as measured on two synthetic forms in another viewer: with no caption at the right of the content area, beside a reserved caption where the alignment puts it, and a caption without a reserve taking the rest of the field; a check box's own margin larger than the box draws a bigger box there, which isn't copied), drop-downs and list boxes with shown/saved item pairs and multi-select, signature fields (each named by its SOM path, under a generated field for each step above it, so that another viewer, which lays the form out again, finds a signature made here, as seen on a synthetic form, and a box signed here keeps its signature, and that name, when a script lays the form out again; a box whose path, or a part of it, the file already gives another field keeps its own name, and its signature isn't found there yet), image fields showing their picture (pictures decoded once per document, at most 20 million pixels, and reused across re-layouts), buttons with reset/print/save/URL; a field or exclusion group that must be filled in, validate nullTest=\"error\", is Required, so field highlighting outlines it as another viewer does on a real form; a push button, which keeps no value, is not), filled from the datasets packet (including rows another viewer added), saved as an incremental revision with the values merged into the datasets so Adobe's viewers show them; usage rights the form carried (/Perms /UR3) are taken off with a note, as the layout voids them and a form with void usage rights opens with every field locked; doc_info reports xfa_layout. CLI info reports the laid-out page/field counts and dimensions while retaining the input file size and raw counts as pdf_pages/acroform_fields; text and render use those pages too, preserving copy permissions and leaving the source file unchanged (#1645). A form a viewer saved with its pages drawn and only its signature boxes as fields is laid out too when its configuration says dynamicRender is required, unless one of those boxes is signed: that one stays as saved, and is fillable only once filling a signed dynamic form is designed (#4309). XFA JavaScript and FormCalc (form.xfa-formcalc) run in the js crate's XFA object model (xfa.form, SOM resolution, rawValue, formattedValue in a date display picture's pattern (number and text display pictures still give the raw value), presence, access, instance managers, xfa.host, xfa.layout, xfa.event, and property objects (XFA 3.3 ch. 3 p. 78, ch. 17), every property path the 367 inventoried forms read (the one known gap is value.text and value.exData, read by about 15 of them: a node's value stays its raw value, and changing what value returns is left to a follow-up with a full-corpus regression check): read as the template writes them, with the spec's defaults for what those forms read where it leaves them out (presence of border (hidden when the object has no border element, as readers read it), edge, corner and fill; an edge or corner past those the template lists, up to four (a border's fifth and later are out of reach, as the layout draws four), as the one drawn on that side (XFA 3.3 p. 38 says the last one listed is reused for the sides not listed; readers draw such a side from the edge or corner on the same side instead, two listed alternating, three reusing the second for the fourth, one serving every side, and reads follow the readers; with none listed, the defaults: thickness 0.5pt, solid, square cap, black, a corner's radius 0in, square join, not inverted, pp. 663, 687), made as a copy of it when a script reaches it so that a write changes only that side (copies have their own budget, apart from the script's writes); colours (a border fill white, a font fill, edges and corners black); font typeface, size and weight; para hAlign and vAlign; validate nullTest, scriptTest and formatTest; occur min, max and initial; a fill's type solid and a field's widget textEdit; margin insets; break before and after; bind ref; a comb's numberOfCells; a calculation's override, disabled where the template has no calculate element and error where it has one, pp. 641-642), other unspecified attributes reading as an empty value that compares as \"\" and never throws (further defaults are added as forms need them): border with its edges, corners and fill (colour, linear/radial/pattern/stipple/solid), font, para, margin, ui and its widget as oneOfChild (with the widget's own border and margin), validate with its message texts and picture, occur, break/breakBefore/breakAfter, assist with toolTip and speak, format with its picture, the value element's content type, caption, items, bind, desc, the object's extras, calculate with its script and message, and keep (intact, next, previous; intact defaults by container, pp. 762-763), with className, oneOfChild, children by name (desc.vMandatory, message.scriptTest) and by class (ui[\"#textEdit\"]), getElement(name, index), isPropertySpecified, getAttribute, setAttribute, rawValue (a desc's first text), a validate's script text, resolveNode(s), somExpression and nodes (length/item/namedItem) on them, SOM expressions from a node that run into its properties (resolveNode(\"ui.#textEdit\"), \"border.edge[1]\", \"extras.arrayGroup[*].groupName\", \"ui.*\"), getAttribute, getElement and isPropertySpecified on nodes, and a node's mandatory, validationMessage, formatMessage and mandatoryMessage read from its validate (a single unnamed message text serves every test, p. 782, and setting one overwrites it, as readers do; reading validate.message. where no such text exists raises a script error, as in readers), and fillColor, fontColor and borderColor from its border fill, font fill and edge colours (borderColor set colours all four edges); what a script writes to them is read back later in the same script but has no effect on the form yet. The caption (its value as text or rich text, read as its words, by name, class, resolveNode or oneOfChild, XFA 3.3 p. 643) and a field's items (each entry as the list or check button shows it, p. 758) are property objects too; a value content the element doesn't hold reads as null, and a fill type the fill doesn't have (its pattern when it is solid) raises an error the script can catch and leaves the fill as it was, as readers do; exData.loadXML and saveXML do nothing yet. PdfCraft's choice-list methods are not on main yet (addItem, clearItems and boundItem are missing, and selectedIndex reads give an object that takes anything); until they land, items reads follow the template. FormCalc reads none of these properties yet): on open initialize (children before their parent), calculate, form:ready (in the reverse of initialize's order), layout:ready and docReady, in the order another viewer runs them on a synthetic form, and calculate once more when a ready script wrote a value (all calculations: which read it isn't recorded); validate scripts don't run on open; layout:ready again, once each, after a script or typing into a growable field lays the form out again (with the new page count); exit, validate and calculate after a field changes, click for buttons (through js_run and the app) and for check boxes and radio buttons each time a click changes them, after their change scripts, a radio group's change and click scripts running before those of the button now on, in the order another viewer runs them on a synthetic form (in the app and through form_fill), enter and exit each time a field gains or loses focus, changed or not (through form_focus and the app; a radio button runs its own; an exit its change already ran is not run again, and scripts that change nothing leave no edit; exit as measured on a synthetic form in another viewer, enter from the spec and not measured), preSign as signing a box begins, so what it changes (a date, a lock) and says shows before the signer confirms and is signed too, taken back if signing ends without a signature, and postSign once signed (in the app; through sign_document when run_form_scripts asks, with every field preSign changed listed), with rows added and removed, subforms shown and hidden, and the form laid out again, all as one undo step and kept in the file. All the scripts of one event run on one thread, each in a fresh context on the form as the engine holds it then (nothing shared between scripts; the live form kept up to date in place for values, rebuilt only when the structure changed, and each script starting from a copy of one flattened form, shared until the form changes; resets in a row applied together), so hundreds of calculations, and a 1,300-script form's initialize scripts, run within the open budget. Hostile scripts are bounded per event (merged and capped effects, messages and console lines, lower loop limits and a time budget on open and calculate, one datasets rewrite per event, print/save/links/focus from clicks only, a runaway script abandoned and the form's scripts turned off, which the app says in a toast and on the notice bar, with a button to the JavaScript console, and doc_info reports as xfa_scripts_off) and what open-time scripts changed is noted. Opening lays the form out once, after its initialize and calculate scripts (which read the live form, not the pages), so a form whose initialize scripts hide many sections is initialized within the open budget and opens again as it was saved; a large form can still run out of that budget, and what it skips is reported. A script that fails partway keeps what it changed before the error, as JavaScript does (forms often trip over an object an earlier version had after their first lines did the work). Missing: the extra layout:ready another viewer runs on opening after scripts change only field text; value.text and value.exData (a node's value is still its raw value, and value.#text on a draw resolves to null); property writes (border, colours, validate.nullTest, occur, toolTip) taking effect and being saved; node setAttribute, clone, createNode and nodes.append/insert/remove; property reads from FormCalc; a page area's relevant=\"-print\" (on a synthetic form Acrobat still prints the page but leaves it blank; PdfCraft prints its content, #2574); a page break before the first section (Acrobat opens an empty body page first when the first section has breakBefore targetType=pageArea, with or without startNew, as seen on synthetic forms; PdfCraft skips a break on an empty page and lays out one page fewer, #2574); loops inside nested calls are only stopped by abandoning their thread, and script memory is not capped; a radio group's own enter and exit scripts; the change event per keystroke; a postSign script that checks its signature through event.target.getField(...).signatureValidate() fails, as event.target isn't the document yet, and a preSign script's message is a notice, where another viewer asks for an answer before it goes on; a check box's or radio button's exit scripts run after each click, where another viewer runs them once, when it loses the focus; xfa.template, connections and data descriptions; a hidden instance of a repeating subform hides them all; barcodes are drawn as their text, not bars; keep rules; text is measured at the exact standard-14 widths of the face it is drawn in (bold, italic and Times included), not in the template's own typefaces, and Acrobat fidelity is eyeballed on real forms, not measured (#60). xfa.host.messageBox keeps its title, icon and buttons, and app.alert in an XFA script reads its own argument order; every message box still answers OK (1) (#4291). Text that embeds a field (a floating field, XFA 3.3 p. 1222) shows the field's value from the data, so a value an initialize, click or calculate script gives it shows, and an event that changes one lays the form out again when it ends; xfa.layout.sheet (from 0) and sheetCount treat each page as a sheet, and an embedded sheet number or count shows as the page number or count does. A repeating row shows its own instance's value, a page area's field the value written under the area, and a typed value or a reset lays the text out again. Missing: fields inside an exclusion group (#6160)."
[[feature]]
id = "form.xfa-formcalc"