Skip to content

Instantly share code, notes, and snippets.

GroupDocs GroupDocsGists

Block or report user

Report or block GroupDocsGists

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@GroupDocsGists
GroupDocsGists / AddWatermarkToDocumentNew.cs
Created Oct 15, 2019
GroupDocs.Watermark for .NET 19.10
View AddWatermarkToDocumentNew.cs
foreach (string filePath in Directory.GetFiles(@"C:\Documents"))
{
using (Watermarker watermarker = new Watermarker(filePath))
{
TextWatermark watermark = new TextWatermark("top secret", new Font("Arial", 36));
watermark.ForegroundColor = Color.Red;
watermark.HorizontalAlignment = HorizontalAlignment.Center;
watermark.VerticalAlignment = VerticalAlignment.Center;
watermarker.Add(watermark);
@GroupDocsGists
GroupDocsGists / GenerateReportUsingCSV1.cs
Created Oct 15, 2019
GroupDocs.Assembly for .NET 19.10
View GenerateReportUsingCSV1.cs
Document doc = ... // Loading a template document.
CsvDataSource dataSource = ... // Loading CSV.
DocumentAssembler assembler = new DocumentAssembler();
assembler.AssembleDocument(doc, dataSource, "persons");
View newcodeannotation.cs
// Create list of annotations
List<AnnotationBase> annotations = new List<AnnotationBase>()
{
new AreaAnnotation()
{
PageNumber = 0,
Box = new Rectangle(100, 100, 100, 100),
Message = "area"
},
View oldcodeannotation.cs
// Creating annotation list
List<AnnotationInfo> annotations = new List<AnnotationInfo>()
{
new AnnotationInfo()
{
PageNumber = 0,
Box = new Rectangle(100, 100, 100, 100),
Type = Domain.AnnotationType.Area,
Text = "area"
},
View skipEmptyRowsAndColumnsOfSpreadsheets.java
// For complete examples and data files, please go to https://github.com/groupdocs-conversion/GroupDocs.Conversion-for-Java
ConversionHandler conversionHandler = new ConversionHandler(Utilities.getConfiguration());
CellsLoadOptions loadOptions = new CellsLoadOptions();
loadOptions.setSkipEmptyRowsAndColumns(true);
loadOptions.setOnePagePerSheet(true);
PdfSaveOptions saveOptions = new PdfSaveOptions();
ConvertedDocument result = conversionHandler.<String>convert(sourceFileName, loadOptions, saveOptions);
View SkipEmptyRowsAndColumnsOfSpreadsheets.cs
// For complete examples and data files, please go to https://github.com/groupdocs-conversion/GroupDocs.Conversion-for-.NET
Contracts.Func<LoadOptions> getLoadOptions = () => new SpreadsheetLoadOptions
{
SkipEmptyRowsAndColumns = true,
OnePagePerSheet = true
};
using (Converter converter = new Converter("sample.xlsx", getLoadOptions))
{
PdfConvertOptions options = new PdfConvertOptions();
converter.Convert("converted.pdf", options);
View deleteindex.cs
string indexFolder = @"c:\MyIndex\";
string documentsFolder1 = @"c:\MyDocuments\";
string documentsFolder2 = @"c:\MyDocuments2\";
// Creating an index in the specified folder
Index index = new Index(indexFolder);
// Indexing documents from the specified folders
index.Add(documentsFolder1);
index.Add(documentsFolder2);
// Getting indexed paths from the index
string[] indexedPaths1 = index.GetIndexedPaths();
View separateword.cs
string indexFolder = @"c:\MyIndex";
string documentFolder = @"c:\MyDocuments";
// Creating index
Index index = new Index(indexFolder);
// Setting blended character type for Chinese characters
HashSet<char> hashSet = new HashSet<char>();
for (char character = (char)0x4E00; character <= 0x9FFF; character++) // Common
{
hashSet.Add(character);
}
View highlight.cs
string indexFolder = @"c:\MyIndex";
string documentFolder = @"c:\MyDocuments";
// Creating index
Index index = new Index(indexFolder);
// Adding documents to index
index.Add(documentFolder);
// Searching
SearchResult result = index.Search("hobbit");
// Highlighting found terms in short HTML snippets
if (result.DocumentCount > 0)
View newsearchcode.cs
string indexFolder = @"c:\MyIndex\";
string documentsFolder = @"c:\MyDocuments\";
// Creating an index in the specified folder
Index index = new Index(indexFolder);
// Indexing documents from the specified folder
index.Add(documentsFolder);
// Creating a search options object
SearchOptions options = new SearchOptions();
options.FuzzySearch.Enabled = true; // Enabling the fuzzy search
options.FuzzySearch.FuzzyAlgorithm = new TableDiscreteFunction(2); // Setting the number of possible differences for each word
You can’t perform that action at this time.