diff --git a/Data-Extraction/Smart-Data-Extractor/Apply-Confidence-threshold/.NET/Apply-Confidence-Threshold-to-Extract-data.slnx b/Data-Extraction/Smart-Data-Extractor/Apply-Confidence-threshold/.NET/Apply-Confidence-Threshold-to-Extract-data.slnx new file mode 100644 index 00000000..b8903de3 --- /dev/null +++ b/Data-Extraction/Smart-Data-Extractor/Apply-Confidence-threshold/.NET/Apply-Confidence-Threshold-to-Extract-data.slnx @@ -0,0 +1,3 @@ + + + diff --git a/Data-Extraction/Smart-Data-Extractor/Apply-Confidence-threshold/.NET/Apply-Confidence-Threshold-to-Extract-data/Apply-Confidence-Threshold-to-Extract-data.csproj b/Data-Extraction/Smart-Data-Extractor/Apply-Confidence-threshold/.NET/Apply-Confidence-Threshold-to-Extract-data/Apply-Confidence-Threshold-to-Extract-data.csproj new file mode 100644 index 00000000..d75067f4 --- /dev/null +++ b/Data-Extraction/Smart-Data-Extractor/Apply-Confidence-threshold/.NET/Apply-Confidence-Threshold-to-Extract-data/Apply-Confidence-Threshold-to-Extract-data.csproj @@ -0,0 +1,24 @@ + + + + Exe + net10.0 + Apply_Confidence_Threshold_to_Extract_data + enable + enable + + + + + + + + + Always + + + Always + + + + diff --git a/Data-Extraction/Smart-Data-Extractor/Apply-Confidence-threshold/.NET/Apply-Confidence-Threshold-to-Extract-data/Data/Input.pdf b/Data-Extraction/Smart-Data-Extractor/Apply-Confidence-threshold/.NET/Apply-Confidence-Threshold-to-Extract-data/Data/Input.pdf new file mode 100644 index 00000000..839bbb72 Binary files /dev/null and b/Data-Extraction/Smart-Data-Extractor/Apply-Confidence-threshold/.NET/Apply-Confidence-Threshold-to-Extract-data/Data/Input.pdf differ diff --git a/Data-Extraction/Smart-Data-Extractor/Apply-Confidence-threshold/.NET/Apply-Confidence-Threshold-to-Extract-data/Output/.gitkeep b/Data-Extraction/Smart-Data-Extractor/Apply-Confidence-threshold/.NET/Apply-Confidence-Threshold-to-Extract-data/Output/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/Data-Extraction/Smart-Data-Extractor/Apply-Confidence-threshold/.NET/Apply-Confidence-Threshold-to-Extract-data/Program.cs b/Data-Extraction/Smart-Data-Extractor/Apply-Confidence-threshold/.NET/Apply-Confidence-Threshold-to-Extract-data/Program.cs new file mode 100644 index 00000000..f91bc36c --- /dev/null +++ b/Data-Extraction/Smart-Data-Extractor/Apply-Confidence-threshold/.NET/Apply-Confidence-Threshold-to-Extract-data/Program.cs @@ -0,0 +1,33 @@ +using System.IO; +using Syncfusion.Pdf.Parsing; +using Syncfusion.SmartDataExtractor; + +namespace ApplyConfidenceThresholdToExtractData +{ + class Program + { + static void Main(string[] args) + { + // Load the input PDF file. + using (FileStream stream = new FileStream(@"Data\Input.pdf", FileMode.Open, FileAccess.Read)) + { + // Initialize the Smart Data Extractor. + DataExtractor extractor = new DataExtractor(); + + // Apply confidence threshold to extract the data. + // Only elements with confidence >= 0.75 will be included in the results. + // Default confidence threshold value is 0.6. + extractor.ConfidenceThreshold = 0.75; + + // Extract data and return as a loaded PDF document. + PdfLoadedDocument pdf = extractor.ExtractDataAsPdfDocument(stream); + + // Save the extracted output as a new PDF file. + pdf.Save(@"Output\Output.pdf"); + + // Close the document to release resources. + pdf.Close(true); + } + } + } +} diff --git a/Data-Extraction/Smart-Data-Extractor/Different-form-recognizer-options/.NET/Different-form-recognizer-options.slnx b/Data-Extraction/Smart-Data-Extractor/Different-form-recognizer-options/.NET/Different-form-recognizer-options.slnx new file mode 100644 index 00000000..5e6a4732 --- /dev/null +++ b/Data-Extraction/Smart-Data-Extractor/Different-form-recognizer-options/.NET/Different-form-recognizer-options.slnx @@ -0,0 +1,3 @@ + + + diff --git a/Data-Extraction/Smart-Data-Extractor/Different-form-recognizer-options/.NET/Different-form-recognizer-options/Data/Input.pdf b/Data-Extraction/Smart-Data-Extractor/Different-form-recognizer-options/.NET/Different-form-recognizer-options/Data/Input.pdf new file mode 100644 index 00000000..839bbb72 Binary files /dev/null and b/Data-Extraction/Smart-Data-Extractor/Different-form-recognizer-options/.NET/Different-form-recognizer-options/Data/Input.pdf differ diff --git a/Data-Extraction/Smart-Data-Extractor/Different-form-recognizer-options/.NET/Different-form-recognizer-options/Different-form-recognizer-options.csproj b/Data-Extraction/Smart-Data-Extractor/Different-form-recognizer-options/.NET/Different-form-recognizer-options/Different-form-recognizer-options.csproj new file mode 100644 index 00000000..0f3c6f5f --- /dev/null +++ b/Data-Extraction/Smart-Data-Extractor/Different-form-recognizer-options/.NET/Different-form-recognizer-options/Different-form-recognizer-options.csproj @@ -0,0 +1,24 @@ + + + + Exe + net10.0 + Different_form_recognizer_options + enable + enable + + + + + + + + + Always + + + Always + + + + diff --git a/Data-Extraction/Smart-Data-Extractor/Different-form-recognizer-options/.NET/Different-form-recognizer-options/Output/.gitkeep b/Data-Extraction/Smart-Data-Extractor/Different-form-recognizer-options/.NET/Different-form-recognizer-options/Output/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/Data-Extraction/Smart-Data-Extractor/Different-form-recognizer-options/.NET/Different-form-recognizer-options/Program.cs b/Data-Extraction/Smart-Data-Extractor/Different-form-recognizer-options/.NET/Different-form-recognizer-options/Program.cs new file mode 100644 index 00000000..1e15dad4 --- /dev/null +++ b/Data-Extraction/Smart-Data-Extractor/Different-form-recognizer-options/.NET/Different-form-recognizer-options/Program.cs @@ -0,0 +1,56 @@ +using System.IO; +using Syncfusion.Pdf.Parsing; +using Syncfusion.SmartDataExtractor; +using Syncfusion.SmartFormRecognizer; + +namespace DifferentFormRecognizerOptions +{ + class Program + { + static void Main(string[] args) + { + // Open the input PDF file as a stream. + using (FileStream stream = new FileStream(@"Data\Input.pdf", FileMode.Open, FileAccess.Read)) + { + // Initialize the Smart Data Extractor. + DataExtractor extractor = new DataExtractor(); + + // Enable form detection in the document to identify form fields. + extractor.EnableFormDetection = true; + + // Configure form recognition options for advanced detection. + FormRecognizeOptions formOptions = new FormRecognizeOptions(); + + // Recognize forms across pages 1 to 5 in the document. + formOptions.PageRange = new int[,] { { 1, 5 } }; + + // Set confidence threshold for form recognition to filter results. + formOptions.ConfidenceThreshold = 0.6; + + // Enable detection of signatures within the document. + formOptions.DetectSignatures = true; + + // Enable detection of textboxes within the document. + formOptions.DetectTextboxes = true; + + // Enable detection of checkboxes within the document. + formOptions.DetectCheckboxes = true; + + // Enable detection of radio buttons within the document. + formOptions.DetectRadioButtons = true; + + // Assign the configured form recognition options to the extractor. + extractor.FormRecognizeOptions = formOptions; + + // Extract form data and return as a loaded PDF document. + PdfLoadedDocument pdf = extractor.ExtractDataAsPdfDocument(stream); + + // Save the extracted output as a new PDF file. + pdf.Save(@"Output\Output.pdf"); + + // Close the document to release resources. + pdf.Close(true); + } + } + } +} diff --git a/Data-Extraction/Smart-Data-Extractor/Different-table-extraction-options/.NET/Different-table-extraction-options.slnx b/Data-Extraction/Smart-Data-Extractor/Different-table-extraction-options/.NET/Different-table-extraction-options.slnx new file mode 100644 index 00000000..e125af74 --- /dev/null +++ b/Data-Extraction/Smart-Data-Extractor/Different-table-extraction-options/.NET/Different-table-extraction-options.slnx @@ -0,0 +1,3 @@ + + + diff --git a/Data-Extraction/Smart-Data-Extractor/Different-table-extraction-options/.NET/Different-table-extraction-options/Data/Input.pdf b/Data-Extraction/Smart-Data-Extractor/Different-table-extraction-options/.NET/Different-table-extraction-options/Data/Input.pdf new file mode 100644 index 00000000..839bbb72 Binary files /dev/null and b/Data-Extraction/Smart-Data-Extractor/Different-table-extraction-options/.NET/Different-table-extraction-options/Data/Input.pdf differ diff --git a/Data-Extraction/Smart-Data-Extractor/Different-table-extraction-options/.NET/Different-table-extraction-options/Different-table-extraction-options.csproj b/Data-Extraction/Smart-Data-Extractor/Different-table-extraction-options/.NET/Different-table-extraction-options/Different-table-extraction-options.csproj new file mode 100644 index 00000000..9b895008 --- /dev/null +++ b/Data-Extraction/Smart-Data-Extractor/Different-table-extraction-options/.NET/Different-table-extraction-options/Different-table-extraction-options.csproj @@ -0,0 +1,24 @@ + + + + Exe + net10.0 + Different_table_extraction_options + enable + enable + + + + + + + + + Always + + + Always + + + + diff --git a/Data-Extraction/Smart-Data-Extractor/Different-table-extraction-options/.NET/Different-table-extraction-options/Output/.gitkeep b/Data-Extraction/Smart-Data-Extractor/Different-table-extraction-options/.NET/Different-table-extraction-options/Output/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/Data-Extraction/Smart-Data-Extractor/Different-table-extraction-options/.NET/Different-table-extraction-options/Program.cs b/Data-Extraction/Smart-Data-Extractor/Different-table-extraction-options/.NET/Different-table-extraction-options/Program.cs new file mode 100644 index 00000000..4471152b --- /dev/null +++ b/Data-Extraction/Smart-Data-Extractor/Different-table-extraction-options/.NET/Different-table-extraction-options/Program.cs @@ -0,0 +1,47 @@ +using System.IO; +using Syncfusion.Pdf.Parsing; +using Syncfusion.SmartDataExtractor; +using Syncfusion.SmartTableExtractor; + +namespace DifferentTableExtractionOptions +{ + class Program + { + static void Main(string[] args) + { + // Load the input PDF file. + using (FileStream stream = new FileStream(@"Data\Input.pdf", FileMode.Open, FileAccess.Read)) + { + // Initialize the Smart Data Extractor. + DataExtractor extractor = new DataExtractor(); + + // Enable table detection and set confidence threshold. + extractor.EnableTableDetection = true; + + // Configure table extraction options. + TableExtractionOptions tableOptions = new TableExtractionOptions(); + + // Extract tables across pages 1 to 5. + tableOptions.PageRange = new int[,] { { 1, 5 } }; + + // Set confidence threshold for table extraction. + tableOptions.ConfidenceThreshold = 0.6; + + // Enable detection of borderless tables. + tableOptions.DetectBorderlessTables = true; + + // Assign the table extraction options to the extractor. + extractor.TableExtractionOptions = tableOptions; + + // Extract data and return as a loaded PDF document. + PdfLoadedDocument pdf = extractor.ExtractDataAsPdfDocument(stream); + + // Save the extracted output as a new PDF file. + pdf.Save(@"Output\Output.pdf"); + + // Close the document to release resources. + pdf.Close(true); + } + } + } +} diff --git a/Data-Extraction/Smart-Data-Extractor/Disable-Form-detection/.NET/Disable-Form-detection.slnx b/Data-Extraction/Smart-Data-Extractor/Disable-Form-detection/.NET/Disable-Form-detection.slnx new file mode 100644 index 00000000..e634ced5 --- /dev/null +++ b/Data-Extraction/Smart-Data-Extractor/Disable-Form-detection/.NET/Disable-Form-detection.slnx @@ -0,0 +1,3 @@ + + + diff --git a/Data-Extraction/Smart-Data-Extractor/Disable-Form-detection/.NET/Disable-Form-detection/Data/Input.pdf b/Data-Extraction/Smart-Data-Extractor/Disable-Form-detection/.NET/Disable-Form-detection/Data/Input.pdf new file mode 100644 index 00000000..839bbb72 Binary files /dev/null and b/Data-Extraction/Smart-Data-Extractor/Disable-Form-detection/.NET/Disable-Form-detection/Data/Input.pdf differ diff --git a/Data-Extraction/Smart-Data-Extractor/Disable-Form-detection/.NET/Disable-Form-detection/Disable-Form-detection.csproj b/Data-Extraction/Smart-Data-Extractor/Disable-Form-detection/.NET/Disable-Form-detection/Disable-Form-detection.csproj new file mode 100644 index 00000000..78069111 --- /dev/null +++ b/Data-Extraction/Smart-Data-Extractor/Disable-Form-detection/.NET/Disable-Form-detection/Disable-Form-detection.csproj @@ -0,0 +1,24 @@ + + + + Exe + net10.0 + Disable_Form_detection + enable + enable + + + + + + + + + Always + + + Always + + + + diff --git a/Data-Extraction/Smart-Data-Extractor/Disable-Form-detection/.NET/Disable-Form-detection/Output/.gitkeep b/Data-Extraction/Smart-Data-Extractor/Disable-Form-detection/.NET/Disable-Form-detection/Output/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/Data-Extraction/Smart-Data-Extractor/Disable-Form-detection/.NET/Disable-Form-detection/Program.cs b/Data-Extraction/Smart-Data-Extractor/Disable-Form-detection/.NET/Disable-Form-detection/Program.cs new file mode 100644 index 00000000..a22d32a8 --- /dev/null +++ b/Data-Extraction/Smart-Data-Extractor/Disable-Form-detection/.NET/Disable-Form-detection/Program.cs @@ -0,0 +1,33 @@ +using System.IO; +using Syncfusion.Pdf.Parsing; +using Syncfusion.SmartDataExtractor; +using Syncfusion.SmartFormRecognizer; + +namespace FormDetection +{ + class Program + { + static void Main(string[] args) + { + // Open the input PDF file as a stream. + using (FileStream stream = new FileStream(@"Data\Input.pdf", FileMode.Open, FileAccess.Read)) + { + // Initialize the Smart Data Extractor. + DataExtractor extractor = new DataExtractor(); + + // Enable or disable form detection in the document to identify form fields. + // By default this property is true. + extractor.EnableFormDetection = false; + + // Extract form data and return as a loaded PDF document. + PdfLoadedDocument pdf = extractor.ExtractDataAsPdfDocument(stream); + + // Save the extracted output as a new PDF file. + pdf.Save(@"Output\Output.pdf"); + + // Close the document to release resources. + pdf.Close(true); + } + } + } +} diff --git a/Data-Extraction/Smart-Data-Extractor/Disable-Table-detection/.NET/Disable-Table-detection.slnx b/Data-Extraction/Smart-Data-Extractor/Disable-Table-detection/.NET/Disable-Table-detection.slnx new file mode 100644 index 00000000..b454802f --- /dev/null +++ b/Data-Extraction/Smart-Data-Extractor/Disable-Table-detection/.NET/Disable-Table-detection.slnx @@ -0,0 +1,3 @@ + + + diff --git a/Data-Extraction/Smart-Data-Extractor/Disable-Table-detection/.NET/Disable-Table-detection/Data/Input.pdf b/Data-Extraction/Smart-Data-Extractor/Disable-Table-detection/.NET/Disable-Table-detection/Data/Input.pdf new file mode 100644 index 00000000..839bbb72 Binary files /dev/null and b/Data-Extraction/Smart-Data-Extractor/Disable-Table-detection/.NET/Disable-Table-detection/Data/Input.pdf differ diff --git a/Data-Extraction/Smart-Data-Extractor/Disable-Table-detection/.NET/Disable-Table-detection/Disable-Table-detection.csproj b/Data-Extraction/Smart-Data-Extractor/Disable-Table-detection/.NET/Disable-Table-detection/Disable-Table-detection.csproj new file mode 100644 index 00000000..2de90ee7 --- /dev/null +++ b/Data-Extraction/Smart-Data-Extractor/Disable-Table-detection/.NET/Disable-Table-detection/Disable-Table-detection.csproj @@ -0,0 +1,24 @@ + + + + Exe + net10.0 + Disable_Table_detection + enable + enable + + + + + + + + + Always + + + Always + + + + diff --git a/Data-Extraction/Smart-Data-Extractor/Disable-Table-detection/.NET/Disable-Table-detection/Output/.gitkeep b/Data-Extraction/Smart-Data-Extractor/Disable-Table-detection/.NET/Disable-Table-detection/Output/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/Data-Extraction/Smart-Data-Extractor/Disable-Table-detection/.NET/Disable-Table-detection/Program.cs b/Data-Extraction/Smart-Data-Extractor/Disable-Table-detection/.NET/Disable-Table-detection/Program.cs new file mode 100644 index 00000000..87ea9295 --- /dev/null +++ b/Data-Extraction/Smart-Data-Extractor/Disable-Table-detection/.NET/Disable-Table-detection/Program.cs @@ -0,0 +1,32 @@ +using System.IO; +using Syncfusion.Pdf.Parsing; +using Syncfusion.SmartDataExtractor; + +namespace DisableTableDetection +{ + class Program + { + static void Main(string[] args) + { + // Load the input PDF file. + using (FileStream stream = new FileStream(@"Data\Input.pdf", FileMode.Open, FileAccess.Read)) + { + // Initialize the Smart Data Extractor. + DataExtractor extractor = new DataExtractor(); + + // Enable or disable table detection and set confidence threshold. + // By default this property is true. + extractor.EnableTableDetection = false; + + // Extract data and return as a loaded PDF document. + PdfLoadedDocument pdf = extractor.ExtractDataAsPdfDocument(stream); + + // Save the extracted output as a new PDF file. + pdf.Save(@"Output\Output.pdf"); + + // Close the document to release resources. + pdf.Close(true); + } + } + } +} diff --git a/Data-Extraction/Smart-Data-Extractor/Extract-data-as-JSON-from-PDF/.NET/Extract-data-as-JSON-from-PDF-document.slnx b/Data-Extraction/Smart-Data-Extractor/Extract-data-as-JSON-from-PDF/.NET/Extract-data-as-JSON-from-PDF-document.slnx new file mode 100644 index 00000000..7b6ec0d3 --- /dev/null +++ b/Data-Extraction/Smart-Data-Extractor/Extract-data-as-JSON-from-PDF/.NET/Extract-data-as-JSON-from-PDF-document.slnx @@ -0,0 +1,3 @@ + + + diff --git a/Data-Extraction/Smart-Data-Extractor/Extract-data-as-JSON-from-PDF/.NET/Extract-data-as-JSON-from-PDF-document/Data/Input.pdf b/Data-Extraction/Smart-Data-Extractor/Extract-data-as-JSON-from-PDF/.NET/Extract-data-as-JSON-from-PDF-document/Data/Input.pdf new file mode 100644 index 00000000..839bbb72 Binary files /dev/null and b/Data-Extraction/Smart-Data-Extractor/Extract-data-as-JSON-from-PDF/.NET/Extract-data-as-JSON-from-PDF-document/Data/Input.pdf differ diff --git a/Data-Extraction/Smart-Data-Extractor/Extract-data-as-JSON-from-PDF/.NET/Extract-data-as-JSON-from-PDF-document/Extract-data-as-JSON-from-PDF-document.csproj b/Data-Extraction/Smart-Data-Extractor/Extract-data-as-JSON-from-PDF/.NET/Extract-data-as-JSON-from-PDF-document/Extract-data-as-JSON-from-PDF-document.csproj new file mode 100644 index 00000000..ddf1b0a7 --- /dev/null +++ b/Data-Extraction/Smart-Data-Extractor/Extract-data-as-JSON-from-PDF/.NET/Extract-data-as-JSON-from-PDF-document/Extract-data-as-JSON-from-PDF-document.csproj @@ -0,0 +1,24 @@ + + + + Exe + net10.0 + Extract_data_as_JSON_from_PDF_document + enable + enable + + + + + + + + + Always + + + Always + + + + diff --git a/Data-Extraction/Smart-Data-Extractor/Extract-data-as-JSON-from-PDF/.NET/Extract-data-as-JSON-from-PDF-document/Output/.gitkeep b/Data-Extraction/Smart-Data-Extractor/Extract-data-as-JSON-from-PDF/.NET/Extract-data-as-JSON-from-PDF-document/Output/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/Data-Extraction/Smart-Data-Extractor/Extract-data-as-JSON-from-PDF/.NET/Extract-data-as-JSON-from-PDF-document/Program.cs b/Data-Extraction/Smart-Data-Extractor/Extract-data-as-JSON-from-PDF/.NET/Extract-data-as-JSON-from-PDF-document/Program.cs new file mode 100644 index 00000000..5e44b4f7 --- /dev/null +++ b/Data-Extraction/Smart-Data-Extractor/Extract-data-as-JSON-from-PDF/.NET/Extract-data-as-JSON-from-PDF-document/Program.cs @@ -0,0 +1,25 @@ +using System.IO; +using System.Text; +using Syncfusion.SmartDataExtractor; + +namespace ExtractDataAsJsonFromPdfDocument +{ + class Program + { + static void Main(string[] args) + { + // Open the input PDF file as a stream. + using (FileStream stream = new FileStream(@"Data\Input.pdf", FileMode.Open, FileAccess.Read)) + { + // 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(@"Output\Output.json", data, Encoding.UTF8); + } + } + } +} diff --git a/Data-Extraction/Smart-Data-Extractor/Extract-data-as-JSON-from-an-Image/.NET/Extract-data-as-JSON-from-an-Image.slnx b/Data-Extraction/Smart-Data-Extractor/Extract-data-as-JSON-from-an-Image/.NET/Extract-data-as-JSON-from-an-Image.slnx new file mode 100644 index 00000000..314e06ac --- /dev/null +++ b/Data-Extraction/Smart-Data-Extractor/Extract-data-as-JSON-from-an-Image/.NET/Extract-data-as-JSON-from-an-Image.slnx @@ -0,0 +1,3 @@ + + + diff --git a/Data-Extraction/Smart-Data-Extractor/Extract-data-as-JSON-from-an-Image/.NET/Extract-data-as-JSON-from-an-Image/Data/Input.png b/Data-Extraction/Smart-Data-Extractor/Extract-data-as-JSON-from-an-Image/.NET/Extract-data-as-JSON-from-an-Image/Data/Input.png new file mode 100644 index 00000000..7170e658 Binary files /dev/null and b/Data-Extraction/Smart-Data-Extractor/Extract-data-as-JSON-from-an-Image/.NET/Extract-data-as-JSON-from-an-Image/Data/Input.png differ diff --git a/Data-Extraction/Smart-Data-Extractor/Extract-data-as-JSON-from-an-Image/.NET/Extract-data-as-JSON-from-an-Image/Extract-data-as-JSON-from-an-Image.csproj b/Data-Extraction/Smart-Data-Extractor/Extract-data-as-JSON-from-an-Image/.NET/Extract-data-as-JSON-from-an-Image/Extract-data-as-JSON-from-an-Image.csproj new file mode 100644 index 00000000..569d69f1 --- /dev/null +++ b/Data-Extraction/Smart-Data-Extractor/Extract-data-as-JSON-from-an-Image/.NET/Extract-data-as-JSON-from-an-Image/Extract-data-as-JSON-from-an-Image.csproj @@ -0,0 +1,24 @@ + + + + Exe + net10.0 + Extract_data_as_JSON_from_an_Image + enable + enable + + + + + + + + + Always + + + Always + + + + diff --git a/Data-Extraction/Smart-Data-Extractor/Extract-data-as-JSON-from-an-Image/.NET/Extract-data-as-JSON-from-an-Image/Output/.gitkeep b/Data-Extraction/Smart-Data-Extractor/Extract-data-as-JSON-from-an-Image/.NET/Extract-data-as-JSON-from-an-Image/Output/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/Data-Extraction/Smart-Data-Extractor/Extract-data-as-JSON-from-an-Image/.NET/Extract-data-as-JSON-from-an-Image/Program.cs b/Data-Extraction/Smart-Data-Extractor/Extract-data-as-JSON-from-an-Image/.NET/Extract-data-as-JSON-from-an-Image/Program.cs new file mode 100644 index 00000000..1f0e8e3b --- /dev/null +++ b/Data-Extraction/Smart-Data-Extractor/Extract-data-as-JSON-from-an-Image/.NET/Extract-data-as-JSON-from-an-Image/Program.cs @@ -0,0 +1,25 @@ +using System.Text; +using Syncfusion.SmartDataExtractor; + +namespace ExtractDataAsJsonFromImage +{ + class Program + { + static void Main(string[] args) + { + // Open the input image file as a stream. + using (FileStream stream = new FileStream( + @"Data\Input.png", FileMode.Open, FileAccess.Read)) + { + // Initialize the Data Extractor. + DataExtractor extractor = new DataExtractor(); + + // Extract data as JSON from the image stream. + string data = extractor.ExtractDataAsJson(stream); + + // Save the extracted JSON data into an output file. + File.WriteAllText(@"Output\Output.json", data, Encoding.UTF8); + } + } + } +} diff --git a/Data-Extraction/Smart-Data-Extractor/Extract-data-as-stream/.NET/Extract-data-as-stream.slnx b/Data-Extraction/Smart-Data-Extractor/Extract-data-as-stream/.NET/Extract-data-as-stream.slnx new file mode 100644 index 00000000..fc9e8b43 --- /dev/null +++ b/Data-Extraction/Smart-Data-Extractor/Extract-data-as-stream/.NET/Extract-data-as-stream.slnx @@ -0,0 +1,3 @@ + + + diff --git a/Data-Extraction/Smart-Data-Extractor/Extract-data-as-stream/.NET/Extract-data-as-stream/Data/Input.pdf b/Data-Extraction/Smart-Data-Extractor/Extract-data-as-stream/.NET/Extract-data-as-stream/Data/Input.pdf new file mode 100644 index 00000000..839bbb72 Binary files /dev/null and b/Data-Extraction/Smart-Data-Extractor/Extract-data-as-stream/.NET/Extract-data-as-stream/Data/Input.pdf differ diff --git a/Data-Extraction/Smart-Data-Extractor/Extract-data-as-stream/.NET/Extract-data-as-stream/Extract-data-as-stream.csproj b/Data-Extraction/Smart-Data-Extractor/Extract-data-as-stream/.NET/Extract-data-as-stream/Extract-data-as-stream.csproj new file mode 100644 index 00000000..149d7346 --- /dev/null +++ b/Data-Extraction/Smart-Data-Extractor/Extract-data-as-stream/.NET/Extract-data-as-stream/Extract-data-as-stream.csproj @@ -0,0 +1,24 @@ + + + + Exe + net10.0 + Extract_data_as_stream + enable + enable + + + + + + + + + Always + + + Always + + + + diff --git a/Data-Extraction/Smart-Data-Extractor/Extract-data-as-stream/.NET/Extract-data-as-stream/Output/.gitkeep b/Data-Extraction/Smart-Data-Extractor/Extract-data-as-stream/.NET/Extract-data-as-stream/Output/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/Data-Extraction/Smart-Data-Extractor/Extract-data-as-stream/.NET/Extract-data-as-stream/Program.cs b/Data-Extraction/Smart-Data-Extractor/Extract-data-as-stream/.NET/Extract-data-as-stream/Program.cs new file mode 100644 index 00000000..43a331a8 --- /dev/null +++ b/Data-Extraction/Smart-Data-Extractor/Extract-data-as-stream/.NET/Extract-data-as-stream/Program.cs @@ -0,0 +1,27 @@ +using System.IO; +using Syncfusion.SmartDataExtractor; + +namespace ExtractDataAsStream +{ + class Program + { + static void Main(string[] args) + { + // Open the input PDF file as a stream. + using (FileStream inputStream = new FileStream(@"Data\Input.pdf", FileMode.Open, FileAccess.Read, FileShare.Read)) + { + // Initialize the Smart Data Extractor. + DataExtractor extractor = new DataExtractor(); + + // Extract data and return as a PDF stream. + Stream pdfStream = extractor.ExtractDataAsPdfStream(inputStream); + + // Save the extracted PDF stream into an output file. + using (FileStream outputStream = new FileStream(@"Output\Output.pdf", FileMode.Create, FileAccess.Write)) + { + pdfStream.CopyTo(outputStream); + } + } + } + } +} diff --git a/Data-Extraction/Smart-Data-Extractor/Extract-data-from-PDF-document/.NET/Extract-data-from-PDF-document.slnx b/Data-Extraction/Smart-Data-Extractor/Extract-data-from-PDF-document/.NET/Extract-data-from-PDF-document.slnx new file mode 100644 index 00000000..373f236e --- /dev/null +++ b/Data-Extraction/Smart-Data-Extractor/Extract-data-from-PDF-document/.NET/Extract-data-from-PDF-document.slnx @@ -0,0 +1,3 @@ + + + diff --git a/Data-Extraction/Smart-Data-Extractor/Extract-data-from-PDF-document/.NET/Extract-data-from-PDF-document/Data/Input.pdf b/Data-Extraction/Smart-Data-Extractor/Extract-data-from-PDF-document/.NET/Extract-data-from-PDF-document/Data/Input.pdf new file mode 100644 index 00000000..839bbb72 Binary files /dev/null and b/Data-Extraction/Smart-Data-Extractor/Extract-data-from-PDF-document/.NET/Extract-data-from-PDF-document/Data/Input.pdf differ diff --git a/Data-Extraction/Smart-Data-Extractor/Extract-data-from-PDF-document/.NET/Extract-data-from-PDF-document/Extract-data-from-PDF-document.csproj b/Data-Extraction/Smart-Data-Extractor/Extract-data-from-PDF-document/.NET/Extract-data-from-PDF-document/Extract-data-from-PDF-document.csproj new file mode 100644 index 00000000..eef3fb37 --- /dev/null +++ b/Data-Extraction/Smart-Data-Extractor/Extract-data-from-PDF-document/.NET/Extract-data-from-PDF-document/Extract-data-from-PDF-document.csproj @@ -0,0 +1,21 @@ + + + + Exe + net10.0 + Extract_data_from_PDF_document + enable + enable + + + + + + + + + Always + + + + diff --git a/Data-Extraction/Smart-Data-Extractor/Extract-data-from-PDF-document/.NET/Extract-data-from-PDF-document/Output/.gitkeep b/Data-Extraction/Smart-Data-Extractor/Extract-data-from-PDF-document/.NET/Extract-data-from-PDF-document/Output/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/Data-Extraction/Smart-Data-Extractor/Extract-data-from-PDF-document/.NET/Extract-data-from-PDF-document/Program.cs b/Data-Extraction/Smart-Data-Extractor/Extract-data-from-PDF-document/.NET/Extract-data-from-PDF-document/Program.cs new file mode 100644 index 00000000..1e334d88 --- /dev/null +++ b/Data-Extraction/Smart-Data-Extractor/Extract-data-from-PDF-document/.NET/Extract-data-from-PDF-document/Program.cs @@ -0,0 +1,27 @@ + +using Syncfusion.Pdf.Parsing; +using Syncfusion.SmartDataExtractor; + +namespace ExtractDataFromPDFDocument +{ + class Program + { + static void Main(string[] args) + { + //Open the input PDF file as a stream. + using (FileStream inputStream = new FileStream(Path.GetFullPath(@"Data\Input.pdf"), FileMode.Open)) + { + //Initialize the Smart Data Extractor. + DataExtractor extractor = new DataExtractor(); + //Extract data and return as a loaded PDF document. + PdfLoadedDocument document = extractor.ExtractDataAsPdfDocument(inputStream); + + //Save the extracted output as a new PDF file inside the Output folder. + document.Save(Path.GetFullPath(@"Output/Output.pdf")); + + //Close the document to release resources. + document.Close(true); + } + } + } +} \ No newline at end of file diff --git a/Data-Extraction/Smart-Data-Extractor/Extract-data-within-specific-range/.NET/Extract-data-within-specific-range.slnx b/Data-Extraction/Smart-Data-Extractor/Extract-data-within-specific-range/.NET/Extract-data-within-specific-range.slnx new file mode 100644 index 00000000..43ca5d37 --- /dev/null +++ b/Data-Extraction/Smart-Data-Extractor/Extract-data-within-specific-range/.NET/Extract-data-within-specific-range.slnx @@ -0,0 +1,3 @@ + + + diff --git a/Data-Extraction/Smart-Data-Extractor/Extract-data-within-specific-range/.NET/Extract-data-within-specific-range/Data/Input.pdf b/Data-Extraction/Smart-Data-Extractor/Extract-data-within-specific-range/.NET/Extract-data-within-specific-range/Data/Input.pdf new file mode 100644 index 00000000..839bbb72 Binary files /dev/null and b/Data-Extraction/Smart-Data-Extractor/Extract-data-within-specific-range/.NET/Extract-data-within-specific-range/Data/Input.pdf differ diff --git a/Data-Extraction/Smart-Data-Extractor/Extract-data-within-specific-range/.NET/Extract-data-within-specific-range/Extract-data-within-specific-range.csproj b/Data-Extraction/Smart-Data-Extractor/Extract-data-within-specific-range/.NET/Extract-data-within-specific-range/Extract-data-within-specific-range.csproj new file mode 100644 index 00000000..eb08161b --- /dev/null +++ b/Data-Extraction/Smart-Data-Extractor/Extract-data-within-specific-range/.NET/Extract-data-within-specific-range/Extract-data-within-specific-range.csproj @@ -0,0 +1,24 @@ + + + + Exe + net10.0 + Extract_data_within_specific_range + enable + enable + + + + + + + + + Always + + + Always + + + + diff --git a/Data-Extraction/Smart-Data-Extractor/Extract-data-within-specific-range/.NET/Extract-data-within-specific-range/Output/.gitkeep b/Data-Extraction/Smart-Data-Extractor/Extract-data-within-specific-range/.NET/Extract-data-within-specific-range/Output/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/Data-Extraction/Smart-Data-Extractor/Extract-data-within-specific-range/.NET/Extract-data-within-specific-range/Program.cs b/Data-Extraction/Smart-Data-Extractor/Extract-data-within-specific-range/.NET/Extract-data-within-specific-range/Program.cs new file mode 100644 index 00000000..fcd42e25 --- /dev/null +++ b/Data-Extraction/Smart-Data-Extractor/Extract-data-within-specific-range/.NET/Extract-data-within-specific-range/Program.cs @@ -0,0 +1,31 @@ +using System.IO; +using Syncfusion.Pdf.Parsing; +using Syncfusion.SmartDataExtractor; + +namespace ExtractDataWithinSpecificRange +{ + class Program + { + static void Main(string[] args) + { + // Open the input PDF file as a stream. + using (FileStream stream = new FileStream(@"Data\Input.pdf", FileMode.Open, FileAccess.Read)) + { + // Initialize the Smart Data Extractor. + DataExtractor extractor = new DataExtractor(); + + // Set the page range for extraction (pages 1 to 3). + extractor.PageRange = new int[,] { { 1, 3 } }; + + // Extract data and return as a loaded PDF document. + PdfLoadedDocument pdf = extractor.ExtractDataAsPdfDocument(stream); + + // Save the extracted output as a new PDF file. + pdf.Save(@"Output\Output.pdf"); + + // Close the document to release resources. + pdf.Close(true); + } + } + } +}