Skip to content

Instantly share code, notes, and snippets.

Avatar

GroupDocs GroupDocsGists

View GitHub Profile
View RenderDocumentAsHtmlExcludingFonts.cs
// For complete examples and data files, please go to https://github.com/groupdocs-viewer/GroupDocs.Viewer-for-.NET
//Get Configurations
ViewerConfig config = Utilities.GetConfigurations();
// Create html handler
ViewerHtmlHandler htmlHandler = new ViewerHtmlHandler(config);
// Guid implies that unique document name
string guid = DocumentName;
View CodeForGif.cs
string extension = Path.GetExtension(guid);
if (extension == ".gif")
{
//return the file from storage
// Get original file
FileContainer container = imageHandler.GetFile(guid);
var fileStream = container.Stream;
// return File(pageImage.Stream, GetContentType(_convertImageFileType));
View RemoveHyperlinksUsingFindWatermark.cs
//For complete examples and data files, please go to https://github.com/groupdocs-watermark/GroupDocs.Watermark-for-.NET
using (SlidesDocument doc = Document.Load<SlidesDocument>(Utilities.MapSourceFilePath(FilePath)))
{
doc.SearchableObjects.SlidesSearchableObjects = SlidesSearchableObjects.Hyperlinks;
// Find all hyperlinks
var watermarks = doc.FindWatermarks();
// Remove found watermarks
watermarks.Clear();
View ReplaceMouseOverHyperlinks.cs
View GettingSupportedDocumentFormats.cs
// For complete examples and data files, please go to https://github.com/groupdocs-viewer/GroupDocs.Viewer-for-.NET
// Setup GroupDocs.Viewer config
ViewerConfig config = Utilities.GetConfigurations();
// Create image or html handler
ViewerImageHandler imageHandler = new ViewerImageHandler(config);
// Get supported document formats
DocumentFormatsContainer documentFormatsContainer = imageHandler.GetSupportedDocumentFormats();
Dictionary<string, string> supportedDocumentFormats = documentFormatsContainer.SupportedDocumentFormats;
View LocalizedStringXML.xml
<?xml version="1.0" encoding="utf-8" ?>
<root>
<data name="EXC_TMPL_CORRUPTED_OR_DAMAGED_FILE">
<value>Could not load file '{0}', file is corrupted or damaged.</value>
</data>
<data name="EXC_TMPL_FILE_TYPE_NOT_SUPPORTED">
<value>File type '{0}' is not supported.</value>
</data>
<data name="EXC_TMPL_INVALID_PASSWORD">
<value>Unable to decrypt file '{0}'. Password is invalid.</value>
View UsingLocalizedStrings.cs
// For complete examples and data files, please go to https://github.com/groupdocs-viewer/GroupDocs.Viewer-for-.NET
// Setup GroupDocs.Viewer config
ViewerConfig config = Utilities.GetConfigurations();
config.LocalesPath = @"D:\Locale";
CultureInfo cultureInfo = new CultureInfo("fr-FR");
ViewerHtmlHandler htmlHandler = new ViewerHtmlHandler(config, cultureInfo);
// File guid
string guid = DocumentName;
View EncodingEmailDocument.cs
// Setup GroupDocs.Viewer config
ViewerConfig config = Utilities.GetConfigurations();
//Initialize viewer handler
ViewerImageHandler viewerImageHandler = new ViewerImageHandler(viewerConfig);
//Set encoding
Encoding encoding = Encoding.GetEncoding("shift-jis");
//Set image options
View EncodingExcelDocument.cs
// Setup GroupDocs.Viewer config
ViewerConfig config = Utilities.GetConfigurations();
//Initialize viewer handler
ViewerImageHandler viewerImageHandler = new ViewerImageHandler(viewerConfig);
//Set encoding
Encoding encoding = Encoding.GetEncoding("shift-jis");
//Set image options
View EncodingWordDocument.cs
// Setup GroupDocs.Viewer config
ViewerConfig config = Utilities.GetConfigurations();
//Initialize viewer handler
ViewerImageHandler viewerImageHandler = new ViewerImageHandler(viewerConfig);
//Set encoding
Encoding encoding = Encoding.GetEncoding("shift-jis");
//Set image options
You can’t perform that action at this time.