From e982aaff888603a47cba6dd7d5d60f6607dad9a4 Mon Sep 17 00:00:00 2001 From: Jake Sandler Date: Sat, 9 Jun 2018 11:06:08 -0400 Subject: added ability to get all field types at once --- src/lib.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 258b3fa..3f1e1c4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -43,6 +43,7 @@ pub struct Form { } /// The possible types of fillable form fields in a PDF +#[derive(Debug)] pub enum FieldType { Button, Radio, @@ -198,6 +199,15 @@ impl Form { } } + /// Gets the types of all of the fields in the form + pub fn get_all_types(&self) -> Vec { + let mut res = Vec::with_capacity(self.len()); + for i in 0..self.len() { + res.push(self.get_type(i)) + }; + res + } + /// Gets the state of field of the given index /// /// # Panics -- cgit v1.2.3