Skip to content

PdfCraft: An open-source PDF reader and editor written by scratch in pure Rust

Merge PR #4295: Check boxes and radio buttons draw their mark in the field's text colour

aiongg4eb7cf4a4be5
diff --cc crates/forms/src/author.rs
index 1d21cf2e7,ad6495948..72582f06d
--- a/crates/forms/src/author.rs
+++ b/crates/forms/src/author.rs
@@@ -964,10 -666,13 +964,10 @@@ pub fn add_field(doc: &mut Document, pa
caption: None,
list: None,
};
- let ap = appearance::check_box_states(doc, &w, FieldKind::Radio, export);
+ let ap = appearance::check_box_states(doc, &w, FieldKind::Radio, export, "/ZaDb 0 Tf 0 g");
doc.update_dict(widget, |d| d.set(b"AP".to_vec(), Object::Dict(ap)))?;
}
- _ => {
- doc.update_dict(widget, |d| d.set(b"T".to_vec(), PdfString::text(&name)))?;
- add_to_fields(doc, af, widget)?;
- }
+ _ => attach(doc, af, widget, &parts)?,
}
add_to_page(doc, page_ref, widget)?;
redraw_field(doc, &field_name)?;