var options = new PdfAConvertOptions
{
PdfAVersion = PdfAStandardVersion.PDF_A_3B
};
// Add the source file
options.AddInput(new FileDataSource("path_to_your_pdf_file.pdf")); // replace with your actual file path
// Add the path to save the converted file
options.AddOutput(new FileDataSource("path_to_the_converted_file.pdf"));
// Create the plugin instance
var plugin = new PdfAConverter();
// Run the conversion
plugin.Process(options);
var regexes = new Regex[]
{
new Regex(@"(?s)document\s+(?:(?:no\(?s?\)?\.?)|(?:number(?:\(?s\)?)?))\s+(?:(?:[\w-]*\d[\w-]*)+(?:[,;\s]|and)*)+", RegexOptions.IgnoreCase),
new Regex(@"[\s\r\n]+Tract[\s\r\n]+of:?", RegexOptions.IgnoreCase),
new Regex(@"vested[\s\r\n]+in", RegexOptions.IgnoreCase),
new Regex("Vested in:", RegexOptions.IgnoreCase),
new Regex(@"file.?[\s\r\n]+(?:nos?|numbers?|#s?|nums?).?[\s\r\n]+(\d+)-(\d+)", RegexOptions.IgnoreCase),
new Regex(@"file.?[\s\r\n]+nos?.?:?[\s\r\n]+([\d\r\n-]+)", RegexOptions.IgnoreCase)
};
var document = new Document(input);
var absorber = new TextFragmentAbsorber(
regexes,
new TextSearchOptions(true)
);
document.Pages.Accept(absorber);
// Get result
var result = absorber.RegexResults