Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ class Program
static void Main(string[] args)
{
// Open the input PDF file as a stream.
using (FileStream stream = new FileStream(Path.GetFullPath(@"Data\Input.pdf"), FileMode.Open, FileAccess.ReadWrite))
using (FileStream stream = new FileStream(Path.GetFullPath(@"Data/Input.pdf"), FileMode.Open, FileAccess.ReadWrite))
{
// Initialize the Smart Data Extractor.
DataExtractor extractor = new DataExtractor();
// Extract form data as JSON.
string data = extractor.ExtractDataAsJson(stream);
// Save the extracted JSON data into an output file.
File.WriteAllText(Path.GetFullPath(@"Output\Output.json"), data, Encoding.UTF8);
File.WriteAllText(Path.GetFullPath(@"Output/Output.json"), data, Encoding.UTF8);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
using System.Text;

//Open the input PDF file as a stream.
using (FileStream stream = new FileStream(Path.GetFullPath(@"Data\Input.pdf"), FileMode.Open, FileAccess.ReadWrite))
using (FileStream stream = new FileStream(Path.GetFullPath(@"Data/Input.pdf"), FileMode.Open, FileAccess.ReadWrite))
{
//Initialize the Smart Data Extractor.
DataExtractor extractor = new DataExtractor();
//Extract data as Markdown.
string data = extractor.ExtractDataAsMarkdown(stream);
//Save the extracted Markdown data into an output file.
File.WriteAllText(Path.GetFullPath(@"Output\Output.md"), data, Encoding.UTF8);
File.WriteAllText(Path.GetFullPath(@"Output/Output.md"), data, Encoding.UTF8);
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ class Program
static void Main(string[] args)
{
// Read the input PDF file as stream.
using (FileStream inputStream = new FileStream(Path.GetFullPath(@"Data\Input.pdf"), FileMode.Open, FileAccess.ReadWrite))
using (FileStream inputStream = new FileStream(Path.GetFullPath(@"Data/Input.pdf"), FileMode.Open, FileAccess.ReadWrite))
{
// Initialize the Form Recognizer.
FormRecognizer smartFormRecognizer = new FormRecognizer();
// Recognize the form and get the output as JSON string.
string outputJson = smartFormRecognizer.RecognizeFormAsJson(inputStream);
// Save the output JSON to file.
File.WriteAllText(Path.GetFullPath(@"Output\Output.json"),outputJson);
File.WriteAllText(Path.GetFullPath(@"Output/Output.json"),outputJson);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ class Program
static void Main(string[] args)
{
// Open the input PDF file as a stream.
using (FileStream stream = new FileStream(Path.GetFullPath(@"Data\Input.pdf"), FileMode.Open, FileAccess.ReadWrite))
using (FileStream stream = new FileStream(Path.GetFullPath(@"Data/Input.pdf"), FileMode.Open, FileAccess.ReadWrite))
{
// Initialize the Smart Table Extractor.
TableExtractor extractor = new TableExtractor();
// Extract table data from the PDF document as JSON string.
string data = extractor.ExtractTableAsJson(stream);
// Save the extracted JSON data into an output file.
File.WriteAllText(Path.GetFullPath(@"Output\Output.json"), data, Encoding.UTF8);
File.WriteAllText(Path.GetFullPath(@"Output/Output.json"), data, Encoding.UTF8);
}
}
}
Expand Down
Loading