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
final Redactor redactor = new Redactor("sample.xlsx"); | |
try | |
{ | |
CellFilter filter = new CellFilter(); | |
filter.setColumnIndex(1); | |
filter.setWorkSheetName("Customers"); | |
Pattern expression = Pattern.compile("^\\w+([-+.']\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$"); | |
RedactorChangeLog result = redactor.apply(new CellColumnRedaction(filter, expression, new ReplacementOptions("[customer email]"))); | |
if (result.getStatus() != RedactionStatus.Failed) | |
{ |
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 (Metadata metadata = new Metadata("sample.jpeg")) | |
{ | |
var root = metadata.GetRootPackage<JpegRootPackage>(); | |
root.RemoveImageResourcePackage(); | |
metadata.Save("output.jpeg"); | |
} |
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
// Load the document | |
using (FileStream stream = File.Open("document.docx", FileMode.Open, FileAccess.ReadWrite)) | |
{ | |
using (Watermarker watermarker = new Watermarker(stream)) | |
{ | |
// Use path to the image as constructor's parameter | |
using (ImageWatermark watermark = new ImageWatermark("logo.png")) | |
{ | |
watermark.HorizontalAlignment = HorizontalAlignment.Center; | |
watermark.VerticalAlignment = VerticalAlignment.Center; |
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
// Create an instance of Parser class | |
using(Parser parser = new Parser("sample.docx")) | |
{ | |
// Extract text into the reader | |
using(TextReader reader = parser.GetText()) | |
{ | |
// Print text from the document | |
// If text extraction isn't supported, reader is null | |
Console.WriteLine(reader == null ? "Text extraction isn't supported." : reader.ReadToEnd()); | |
} |
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
// Set text for description field | |
const string description = | |
"GroupDocs.Assembly for .NET is a class library that enables you to generate documents in popular " + | |
"Office and email file formats based upon template documents and data obtained from various sources " + | |
"including databases, XML, JSON, OData, objects of custom .NET types, external documents, and more."; | |
// Create document assembler | |
DocumentAssembler assembler = new DocumentAssembler(); | |
// Generate report | |
assembler.AssembleDocument( | |
"ReadMe.docx", |
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("D:\\sample.pdf")) | |
{ | |
TextSignOptions options = new TextSignOptions("John Smith") | |
{ | |
// set Text color | |
ForeColor = Color.Red | |
}; | |
// sign document to file | |
signature.Sign("D:\\signed.pdf", options); |
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
// For complete examples and data files, please go to https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java | |
public static class DocumentSignature | |
{ | |
public String getVersion(){ return Version; } | |
public void setVersion(String value){ Version = value; } | |
// specify SkipSerialization attribute to skip this field on serialization | |
@SkipSerializationAttribute() | |
public String Version; | |
public boolean isProcessed(){ return IsProcessed; } |
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
// For complete examples and data files, please go to https://github.com/groupdocs-viewer/GroupDocs.Viewer-for-.NET | |
/// <summary> | |
/// The implementation of GroupDocs.Viewer data handler for Azure Blob Storage. | |
/// </summary> | |
public class AzureInputDataHandler : IInputDataHandler | |
{ | |
/// <summary> | |
/// The blob delimiter. | |
/// </summary> | |
private const char Delimiter = '/'; |
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
// For complete examples and data files, please go to https://github.com/groupdocs-viewer/GroupDocs.Viewer-for-Java | |
try{ | |
// Setup GroupDocs.Viewer config | |
ViewerConfig config = Utilities.getConfiguration(); | |
// Create html handler | |
ViewerHtmlHandler htmlHandler = new ViewerHtmlHandler(config); | |
// Get document stream | |
FileInputStream stream = new FileInputStream("./Data/Storage/" + fileName); |
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
// For complete examples and data files, please go to https://github.com/groupdocs-viewer/GroupDocs.Viewer-for-Java | |
try{ | |
// Setup GroupDocs.Viewer config | |
ViewerConfig config = Utilities.getConfiguration(); | |
// Create html handler | |
ViewerHtmlHandler htmlHandler = new ViewerHtmlHandler(config); | |
// Get document stream | |
FileInputStream stream = new FileInputStream("./Data/Storage/" + fileName); |
NewerOlder