diff options
| author | Jake Sandler | 2018-06-09 11:06:26 -0400 |
|---|---|---|
| committer | Jake Sandler | 2018-06-09 11:06:26 -0400 |
| commit | 6835fd7dedbc36bd371bda113fe5089d1637d3ef (patch) | |
| tree | b37e517a8fd23a4e484d8ebd97612aa9c5df96d4 | |
| parent | e982aaff888603a47cba6dd7d5d60f6607dad9a4 (diff) | |
| download | pdf_form-6835fd7dedbc36bd371bda113fe5089d1637d3ef.tar.bz2 | |
Added README
| -rw-r--r-- | README.md | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/README.md b/README.md new file mode 100644 index 0000000..b41dd96 --- /dev/null +++ b/README.md @@ -0,0 +1,31 @@ +# Fill PDF Forms +A library to programatically identify and fill out PDF forms + +## Example Code +* Read a PDF and discover the form fields +``` +extern crate pdf_form; +use pdf_form::{Form, FieldType}; + +// Load the pdf into a form from a path +let form = Form::load("path/to/pdf").unwrap(); +// Get all types of the form fields (e.g. Text, Radio, etc) in a Vector +let field_types = form.get_all_types(); +// Print the types +for type in field_types { + println!("{:?}", type); +}; + +``` +* Write to the form fields +``` +extern crate pdf_form; +use pdf_form::{Form, FieldState}; + +// Load the pdf into a form from a path +let mut form = Form::load("path/to/pdf").unwrap(); +form.set_text(0, String::from("filling the field")); +form.save("path/to/new/pdf"); + +``` + |
