Program.cs
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | using Bytescout.PDF; using System; namespace ReadForm { class Program { static void Main( string [] args) { // Load PDF form Document pdfDocument = new Document( @"form.pdf" ); pdfDocument.RegistrationName = "demo" ; pdfDocument.RegistrationKey = "demo" ; Page page = pdfDocument.Pages[0]; // Get widget by its name and get value string box1 = ((EditBox) page.Annotations[ "editBox1" ]).Text; string box2 = ((EditBox) page.Annotations[ "editBox2" ]).Text; bool checkBox1 = ((CheckBox) page.Annotations[ "checkBox1" ]).Checked; // Cleanup pdfDocument.Dispose(); // Writing values to console Console.WriteLine( "Form values are as follows:" ); Console.WriteLine(box1); Console.WriteLine(box2); Console.WriteLine(checkBox1); Console.WriteLine(); Console.WriteLine( "Press any key to exit...." ); Console.ReadLine(); } } } |
Click here to get your Free Trial version of the SDK
also available as: