Last active
November 12, 2019 10:40
-
-
Save GroupDocsGists/4c2db27e6a13326c84fd18d33be62e80 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using (Signature signature = new Signature(sample.pdf)) | |
{ | |
// setup search options | |
ImageSearchOptions searchOptions = new ImageSearchOptions() | |
{ | |
// specify special pages to search on | |
AllPages = false, | |
// single page number | |
PageNumber = 1, | |
// setup extended search in pages setup | |
PagesSetup = new PagesSetup() { FirstPage = true, LastPage = true, OddPages = false, EvenPages = false } | |
}; | |
// search document | |
List<ImageSignature> signatures = signature.Search<ImageSignature>(searchOptions); | |
// output signatures | |
foreach (ImageSignature imageSignature in signatures) | |
{ | |
if (imageSignature != null) | |
{ | |
Console.Write($"Found Image signature with size {imageSignature.Size}."); | |
Console.WriteLine($"Location at {imageSignature.Left}-{imageSignature.Top}. Size is {imageSignature.Width}x{imageSignature.Height}."); | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using (Signature signature = new Signature(sample.pdf)) | |
{ | |
// setup search options | |
TextSearchOptions searchOptions = new TextSearchOptions() | |
{ | |
// specify special pages to search on | |
AllPages = false, | |
// single page number | |
PageNumber = 1, | |
// setup extended search in pages setup | |
PagesSetup = new PagesSetup() { FirstPage = true, LastPage = true, OddPages = false, EvenPages = false }, | |
// specify text match type | |
MatchType = TextMatchType.Exact, | |
// specify text pattern to search | |
Text = "John Smith" | |
}; | |
// search document | |
List<TextSignature> signatures = signature.Search<TextSignature>(searchOptions); | |
// output signatures | |
foreach (TextSignature textSignature in signatures) | |
{ | |
if (textSignature != null) | |
{ | |
Console.Write($"Found Text signature: {textSignature.SignatureImplementation} with text {textSignature.Text}."); | |
Console.WriteLine($"Location at {textSignature.Left}-{textSignature.Top}. Size is {textSignature.Width}x{textSignature.Height}."); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment