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
// Java code to sign Word files with digital signature certificate using Java | |
Signature signature = new Signature("path/document.docx"); | |
DigitalSignOptions options = new DigitalSignOptions("certificate.pfx"); | |
options.setImageFilePath("image.jpg"); | |
options.setLeft(100); | |
options.setTop(100); | |
options.setPageNumber(1); | |
options.setPassword("1234567890"); |
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
// Java code to sign PDF with digital signature certificate using Java | |
Signature signature = new Signature("path/document.pdf"); | |
DigitalSignOptions options = new DigitalSignOptions("certificate.pfx"); | |
options.setImageFilePath("image.jpg"); | |
options.setLeft(100); | |
options.setTop(100); | |
options.setPageNumber(1); | |
options.setPassword("1234567890"); |
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
// Fuzzy Search multiple files across multiple folders using Java | |
// Creating an index folder and add document's folder to it | |
Index index = new Index("path/indexing-folder-path"); | |
index.add("path/parent-folder"); | |
SearchOptions options = new SearchOptions(); | |
options.getFuzzySearch().setEnabled(true); // Enabling the fuzzy search | |
options.getFuzzySearch().setFuzzyAlgorithm(new SimilarityLevel(0.75)); |
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
// Highlight and Print Search Results for all the documents | |
for (int i = 0 ; i < result.getDocumentCount(); i++) | |
{ | |
FoundDocument document = result.getFoundDocument(i); | |
OutputAdapter outputAdapter = new FileOutputAdapter(OutputFormat.Html, "path/Highlight" + i + ".html"); | |
Highlighter highlighter = new DocumentHighlighter(outputAdapter); | |
index.highlight(document, highlighter); | |
System.out.println("\tDocument: " + document.getDocumentInfo().getFilePath()); |
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
// Highlight and Print Search Results for all the documents using C# | |
for (int i = 0; i < result.DocumentCount; i++) | |
{ | |
FoundDocument document = result.GetFoundDocument(i); | |
OutputAdapter outputAdapter = new FileOutputAdapter(OutputFormat.Html, indexFolder + "/Highlight" + i + ".html"); | |
Highlighter highlighter = new DocumentHighlighter(outputAdapter); | |
index.Highlight(document, highlighter); | |
Console.WriteLine("\tDocument: " + document.DocumentInfo.FilePath); |
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
// Fuzzy Search multiple files across multiple folders using C# | |
// Creating an index folder and add document's folder to it | |
Index index = new Index("indexing-folder-path"); | |
index.Add("path/parent-folder"); | |
SearchOptions options = new SearchOptions(); | |
options.FuzzySearch.Enabled = true; // Enabling the fuzzy search | |
options.FuzzySearch.FuzzyAlgorithm = new SimilarityLevel(0.8); |
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
// Regex Search multiple files across folders using Java | |
// Creating an index folder and add document's folder to it | |
Index index = new Index("path/indexing-folder-path"); | |
index.add("path/parent-folder"); | |
// Prepare the Regex Query and Search | |
// Regex here is to identify all words having any consecutive repeated characters. | |
String query = "^(.)\\1{1,}"; | |
SearchResult result = index.search(query); |
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
// Search by RegEx in multiple files across multiple folders using C# | |
// Creating an index folder and add document's folder to it | |
Index index = new Index("indexing-folder-path"); | |
index.Add("path/parent-folder"); | |
// Prepare the Regex Query and Search | |
// Regex here is to identify all words having any consecutive repeated characters. | |
string query = "^(.)\\1{1,}"; | |
SearchResult result = index.Search(query); |
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
// Printing the result | |
Console.WriteLine("Documents: " + result.DocumentCount); | |
Console.WriteLine("Total occurrences: " + result.OccurrenceCount); | |
for (int i = 0; i < result.DocumentCount; i++) | |
{ | |
FoundDocument document = result.GetFoundDocument(i); | |
Console.WriteLine("Document: " + document.DocumentInfo.FilePath); | |
Console.WriteLine("Occurrences: " + document.OccurrenceCount); | |
for (int j = 0; j < document.FoundFields.Length; j++) |
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
// Printing Search Results === | |
for (int i = 0 ; i < result.getDocumentCount(); i++) | |
{ | |
FoundDocument document = result.getFoundDocument(i); | |
// Printing Search Results =========== | |
System.out.println("Occurrences: " + document.getOccurrenceCount()); | |
for (FoundDocumentField field : document.getFoundFields()) { | |
System.out.println("\tField: " + field.getFieldName()); |
NewerOlder