diff --git a/Data-Extraction/Smart-Data-Extractor/Apply-Confidence-threshold/.NET/Apply-Confidence-Threshold-to-Extract-data.sln b/Data-Extraction/Smart-Data-Extractor/Apply-Confidence-threshold/.NET/Apply-Confidence-Threshold-to-Extract-data.sln new file mode 100644 index 00000000..6d00922f --- /dev/null +++ b/Data-Extraction/Smart-Data-Extractor/Apply-Confidence-threshold/.NET/Apply-Confidence-Threshold-to-Extract-data.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 18 +VisualStudioVersion = 18.4.11626.88 stable +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Apply-Confidence-Threshold-to-Extract-data", "Apply-Confidence-Threshold-to-Extract-data\Apply-Confidence-Threshold-to-Extract-data.csproj", "{FCC97ADF-66EF-ADE8-DDD5-7D240743444D}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {FCC97ADF-66EF-ADE8-DDD5-7D240743444D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FCC97ADF-66EF-ADE8-DDD5-7D240743444D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FCC97ADF-66EF-ADE8-DDD5-7D240743444D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FCC97ADF-66EF-ADE8-DDD5-7D240743444D}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal 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..268da549 --- /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 + net8.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..4b6ad9fa --- /dev/null +++ b/Data-Extraction/Smart-Data-Extractor/Apply-Confidence-threshold/.NET/Apply-Confidence-Threshold-to-Extract-data/Program.cs @@ -0,0 +1,29 @@ +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(Path.GetFullPath(@"Data\Input.pdf"), FileMode.Open, FileAccess.ReadWrite)) + { + // Initialize the Smart Data Extractor. + DataExtractor extractor = new DataExtractor(); + // Apply confidence threshold to extract the data. + // Default confidence threshold value is 0.6. + extractor.ConfidenceThreshold = 0.75; + + // Extract data and return as a loaded PDF document. + PdfLoadedDocument document = extractor.ExtractDataAsPdfDocument(stream); + // Save the extracted output as a new PDF file. + document.Save(Path.GetFullPath(@"Output\Output.pdf")); + // Close the document to release resources. + document.Close(true); + } + } + } +} diff --git a/Data-Extraction/Smart-Data-Extractor/Different-form-recognizer-options/.NET/Different-form-recognizer-options.sln b/Data-Extraction/Smart-Data-Extractor/Different-form-recognizer-options/.NET/Different-form-recognizer-options.sln new file mode 100644 index 00000000..6670e40c --- /dev/null +++ b/Data-Extraction/Smart-Data-Extractor/Different-form-recognizer-options/.NET/Different-form-recognizer-options.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 18 +VisualStudioVersion = 18.4.11626.88 stable +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Different-form-recognizer-options", "Different-form-recognizer-options\Different-form-recognizer-options.csproj", "{25CCCA07-E78E-3D50-F90C-0D39039A0572}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {25CCCA07-E78E-3D50-F90C-0D39039A0572}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {25CCCA07-E78E-3D50-F90C-0D39039A0572}.Debug|Any CPU.Build.0 = Debug|Any CPU + {25CCCA07-E78E-3D50-F90C-0D39039A0572}.Release|Any CPU.ActiveCfg = Release|Any CPU + {25CCCA07-E78E-3D50-F90C-0D39039A0572}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal 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..f2fea500 --- /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 + net8.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..4097c5be --- /dev/null +++ b/Data-Extraction/Smart-Data-Extractor/Different-form-recognizer-options/.NET/Different-form-recognizer-options/Program.cs @@ -0,0 +1,46 @@ +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(Path.GetFullPath(@"Data\Input.pdf"), FileMode.Open, FileAccess.ReadWrite)) + { + // 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 document = extractor.ExtractDataAsPdfDocument(stream); + // Save the extracted output as a new PDF file. + document.Save(Path.GetFullPath(@"Output\Output.pdf")); + // Close the document to release resources. + document.Close(true); + } + } + } +} diff --git a/Data-Extraction/Smart-Data-Extractor/Different-table-extraction-options/.NET/Different-table-extraction-options.sln b/Data-Extraction/Smart-Data-Extractor/Different-table-extraction-options/.NET/Different-table-extraction-options.sln new file mode 100644 index 00000000..5c1c22b8 --- /dev/null +++ b/Data-Extraction/Smart-Data-Extractor/Different-table-extraction-options/.NET/Different-table-extraction-options.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 18 +VisualStudioVersion = 18.4.11626.88 stable +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Different-table-extraction-options", "Different-table-extraction-options\Different-table-extraction-options.csproj", "{ACF20B57-3A7A-ABDF-F6F6-EDC2516118EB}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {ACF20B57-3A7A-ABDF-F6F6-EDC2516118EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {ACF20B57-3A7A-ABDF-F6F6-EDC2516118EB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {ACF20B57-3A7A-ABDF-F6F6-EDC2516118EB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {ACF20B57-3A7A-ABDF-F6F6-EDC2516118EB}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal 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..d85e7ecb --- /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 + net8.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..32b92e02 --- /dev/null +++ b/Data-Extraction/Smart-Data-Extractor/Different-table-extraction-options/.NET/Different-table-extraction-options/Program.cs @@ -0,0 +1,40 @@ +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(Path.GetFullPath(@"Data\Input.pdf"), FileMode.Open, FileAccess.ReadWrite)) + { + // 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 document = extractor.ExtractDataAsPdfDocument(stream); + // Save the extracted output as a new PDF file. + document.Save(Path.GetFullPath(@"Output\Output.pdf")); + // Close the document to release resources. + document.Close(true); + } + } + } +} diff --git a/Data-Extraction/Smart-Data-Extractor/Disable-Form-detection/.NET/Disable-Form-detection.sln b/Data-Extraction/Smart-Data-Extractor/Disable-Form-detection/.NET/Disable-Form-detection.sln new file mode 100644 index 00000000..6f7ba727 --- /dev/null +++ b/Data-Extraction/Smart-Data-Extractor/Disable-Form-detection/.NET/Disable-Form-detection.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 18 +VisualStudioVersion = 18.4.11626.88 stable +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Disable-Form-detection", "Disable-Form-detection\Disable-Form-detection.csproj", "{6CCD304C-9D53-03E3-7C15-2363008D3E53}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {6CCD304C-9D53-03E3-7C15-2363008D3E53}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6CCD304C-9D53-03E3-7C15-2363008D3E53}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6CCD304C-9D53-03E3-7C15-2363008D3E53}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6CCD304C-9D53-03E3-7C15-2363008D3E53}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal 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..b17370cf --- /dev/null +++ b/Data-Extraction/Smart-Data-Extractor/Disable-Form-detection/.NET/Disable-Form-detection/Disable-Form-detection.csproj @@ -0,0 +1,24 @@ + + + + Exe + net8.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..62034215 --- /dev/null +++ b/Data-Extraction/Smart-Data-Extractor/Disable-Form-detection/.NET/Disable-Form-detection/Program.cs @@ -0,0 +1,28 @@ +using System.IO; +using Syncfusion.Pdf.Parsing; +using Syncfusion.SmartDataExtractor; + +namespace FormDetection +{ + 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)) + { + // 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 document = extractor.ExtractDataAsPdfDocument(stream); + // Save the extracted output as a new PDF file. + document.Save(Path.GetFullPath(@"Output\Output.pdf")); + // Close the document to release resources. + document.Close(true); + } + } + } +} diff --git a/Data-Extraction/Smart-Data-Extractor/Disable-Table-detection/.NET/Disable-Table-detection.sln b/Data-Extraction/Smart-Data-Extractor/Disable-Table-detection/.NET/Disable-Table-detection.sln new file mode 100644 index 00000000..8b919cf1 --- /dev/null +++ b/Data-Extraction/Smart-Data-Extractor/Disable-Table-detection/.NET/Disable-Table-detection.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 18 +VisualStudioVersion = 18.4.11626.88 stable +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Disable-Table-detection", "Disable-Table-detection\Disable-Table-detection.csproj", "{9EA66BBD-844A-5D19-6F7D-67E15AC6D535}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {9EA66BBD-844A-5D19-6F7D-67E15AC6D535}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9EA66BBD-844A-5D19-6F7D-67E15AC6D535}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9EA66BBD-844A-5D19-6F7D-67E15AC6D535}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9EA66BBD-844A-5D19-6F7D-67E15AC6D535}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal 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..7244ffb8 --- /dev/null +++ b/Data-Extraction/Smart-Data-Extractor/Disable-Table-detection/.NET/Disable-Table-detection/Disable-Table-detection.csproj @@ -0,0 +1,24 @@ + + + + Exe + net8.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..d1cb7911 --- /dev/null +++ b/Data-Extraction/Smart-Data-Extractor/Disable-Table-detection/.NET/Disable-Table-detection/Program.cs @@ -0,0 +1,28 @@ +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(Path.GetFullPath(@"Data\Input.pdf"), FileMode.Open, FileAccess.ReadWrite)) + { + // 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 document = extractor.ExtractDataAsPdfDocument(stream); + // Save the extracted output as a new PDF file. + document.Save(Path.GetFullPath(@"Output\Output.pdf")); + // Close the document to release resources. + document.Close(true); + } + } + } +} diff --git a/Data-Extraction/Smart-Data-Extractor/Extract-data-as-JSON-from-PDF/.NET/Extract-data-as-JSON-from-PDF-document.sln b/Data-Extraction/Smart-Data-Extractor/Extract-data-as-JSON-from-PDF/.NET/Extract-data-as-JSON-from-PDF-document.sln new file mode 100644 index 00000000..3315e288 --- /dev/null +++ b/Data-Extraction/Smart-Data-Extractor/Extract-data-as-JSON-from-PDF/.NET/Extract-data-as-JSON-from-PDF-document.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 18 +VisualStudioVersion = 18.4.11626.88 stable +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Extract-data-as-JSON-from-PDF-document", "Extract-data-as-JSON-from-PDF-document\Extract-data-as-JSON-from-PDF-document.csproj", "{FCAE7CF7-9873-FD20-5863-A7D1616D7FD5}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {FCAE7CF7-9873-FD20-5863-A7D1616D7FD5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FCAE7CF7-9873-FD20-5863-A7D1616D7FD5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FCAE7CF7-9873-FD20-5863-A7D1616D7FD5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FCAE7CF7-9873-FD20-5863-A7D1616D7FD5}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal 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..8748cc30 --- /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 + net8.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..54c62f55 --- /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,23 @@ +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(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); + } + } + } +} diff --git a/Data-Extraction/Smart-Data-Extractor/Extract-data-as-JSON-from-an-Image/.NET/Extract-data-as-JSON-from-an-Image.sln b/Data-Extraction/Smart-Data-Extractor/Extract-data-as-JSON-from-an-Image/.NET/Extract-data-as-JSON-from-an-Image.sln new file mode 100644 index 00000000..3b1e05a2 --- /dev/null +++ b/Data-Extraction/Smart-Data-Extractor/Extract-data-as-JSON-from-an-Image/.NET/Extract-data-as-JSON-from-an-Image.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 18 +VisualStudioVersion = 18.4.11626.88 stable +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Extract-data-as-JSON-from-an-Image", "Extract-data-as-JSON-from-an-Image\Extract-data-as-JSON-from-an-Image.csproj", "{BCEC8083-DEB4-CF93-7CE1-8BB2AB892D83}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {BCEC8083-DEB4-CF93-7CE1-8BB2AB892D83}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BCEC8083-DEB4-CF93-7CE1-8BB2AB892D83}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BCEC8083-DEB4-CF93-7CE1-8BB2AB892D83}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BCEC8083-DEB4-CF93-7CE1-8BB2AB892D83}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal 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..d69b17ba --- /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 + net8.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..9a80c2c7 --- /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,22 @@ +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(Path.GetFullPath(@"Data\Input.png"), FileMode.Open, FileAccess.ReadWrite)) + { + // 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(Path.GetFullPath(@"Output\Output.json"), data, Encoding.UTF8); + } + } + } +} diff --git a/Data-Extraction/Smart-Data-Extractor/Extract-data-as-stream/.NET/Extract-data-as-stream.sln b/Data-Extraction/Smart-Data-Extractor/Extract-data-as-stream/.NET/Extract-data-as-stream.sln new file mode 100644 index 00000000..b1c12539 --- /dev/null +++ b/Data-Extraction/Smart-Data-Extractor/Extract-data-as-stream/.NET/Extract-data-as-stream.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 18 +VisualStudioVersion = 18.4.11626.88 stable +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Extract-data-as-stream", "Extract-data-as-stream\Extract-data-as-stream.csproj", "{A26C8821-9497-D3FD-65FE-BFF7340F760E}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {A26C8821-9497-D3FD-65FE-BFF7340F760E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A26C8821-9497-D3FD-65FE-BFF7340F760E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A26C8821-9497-D3FD-65FE-BFF7340F760E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A26C8821-9497-D3FD-65FE-BFF7340F760E}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal 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..ac095fd3 --- /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 + net8.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..f7489c19 --- /dev/null +++ b/Data-Extraction/Smart-Data-Extractor/Extract-data-as-stream/.NET/Extract-data-as-stream/Program.cs @@ -0,0 +1,25 @@ +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(Path.GetFullPath(@"Data\Input.pdf"), FileMode.Open, FileAccess.ReadWrite)) + { + // 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(Path.GetFullPath(@"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.sln b/Data-Extraction/Smart-Data-Extractor/Extract-data-from-PDF-document/.NET/Extract-data-from-PDF-document.sln new file mode 100644 index 00000000..c5c27323 --- /dev/null +++ b/Data-Extraction/Smart-Data-Extractor/Extract-data-from-PDF-document/.NET/Extract-data-from-PDF-document.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 18 +VisualStudioVersion = 18.4.11626.88 stable +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Extract-data-from-PDF-document", "Extract-data-from-PDF-document\Extract-data-from-PDF-document.csproj", "{9547F4B9-E749-04D1-88BC-2ED356ABD894}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {9547F4B9-E749-04D1-88BC-2ED356ABD894}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9547F4B9-E749-04D1-88BC-2ED356ABD894}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9547F4B9-E749-04D1-88BC-2ED356ABD894}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9547F4B9-E749-04D1-88BC-2ED356ABD894}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal 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..16082532 --- /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 + net8.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..3ccfdda2 --- /dev/null +++ b/Data-Extraction/Smart-Data-Extractor/Extract-data-from-PDF-document/.NET/Extract-data-from-PDF-document/Program.cs @@ -0,0 +1,25 @@ + +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,FileAccess.ReadWrite)) + { + //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.sln b/Data-Extraction/Smart-Data-Extractor/Extract-data-within-specific-range/.NET/Extract-data-within-specific-range.sln new file mode 100644 index 00000000..182986aa --- /dev/null +++ b/Data-Extraction/Smart-Data-Extractor/Extract-data-within-specific-range/.NET/Extract-data-within-specific-range.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 18 +VisualStudioVersion = 18.4.11626.88 stable +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Extract-data-within-specific-range", "Extract-data-within-specific-range\Extract-data-within-specific-range.csproj", "{A23DFA8A-D71F-1E63-EF1F-9630B768E0BA}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {A23DFA8A-D71F-1E63-EF1F-9630B768E0BA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A23DFA8A-D71F-1E63-EF1F-9630B768E0BA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A23DFA8A-D71F-1E63-EF1F-9630B768E0BA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A23DFA8A-D71F-1E63-EF1F-9630B768E0BA}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal 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..d6010709 --- /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 + net8.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..4c58b2cf --- /dev/null +++ b/Data-Extraction/Smart-Data-Extractor/Extract-data-within-specific-range/.NET/Extract-data-within-specific-range/Program.cs @@ -0,0 +1,27 @@ +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(Path.GetFullPath(@"Data/Input.pdf"), FileMode.Open, FileAccess.ReadWrite)) + { + // 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 document = extractor.ExtractDataAsPdfDocument(stream); + // Save the extracted output as a new PDF file. + document.Save(Path.GetFullPath(@"Output\Output.pdf")); + // Close the document to release resources. + document.Close(true); + } + } + } +}