diff options
| author | Jake Sandler | 2018-06-09 11:06:08 -0400 | 
|---|---|---|
| committer | Jake Sandler | 2018-06-09 11:06:08 -0400 | 
| commit | e982aaff888603a47cba6dd7d5d60f6607dad9a4 (patch) | |
| tree | 228b988045b93b6998255f436a724c0dbf68b17a /src | |
| parent | 2f175f59b033ebe74f86e08becb2bc1e759bdeee (diff) | |
| download | pdf_form-e982aaff888603a47cba6dd7d5d60f6607dad9a4.tar.bz2 | |
added ability to get all field types at once
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib.rs | 10 | 
1 files changed, 10 insertions, 0 deletions
| @@ -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<FieldType> { +        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 | 
