Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// For complete examples and data files, please go to https://github.com/groupdocs-viewer/GroupDocs.Viewer-for-.NET
// Setup GroupDocs.Viewer config
ViewerConfig config = new ViewerConfig();
config.StoragePath = @"C:\storage";
// Create HTML or image handler
ViewerHtmlHandler htmlHandler = new ViewerHtmlHandler(config);
string guid = "archive.zip";
// Get archive document info
ArchiveDocumentInfoContainer documentInfoContainer = htmlHandler.GetDocumentInfo(guid) as ArchiveDocumentInfoContainer;
foreach (string folderName in documentInfoContainer.Folders)
Console.WriteLine("Folder name: {0}", folderName);
// For complete examples and data files, please go to https://github.com/groupdocs-viewer/GroupDocs.Viewer-for-.NET
// Setup GroupDocs.Viewer config
ViewerConfig config = new ViewerConfig();
config.StoragePath = @"C:\storage";
// Create HTML or image handler
ViewerHtmlHandler htmlHandler = new ViewerHtmlHandler(config);
string guid = "archive.zip";
// set option to retrieve list of folders from certain folder.
HtmlOptions options = new HtmlOptions();
options.ArchiveOptions.FolderName = "FirstLevelFolder/SecondLevelFolder";
// Get archive document info
ArchiveDocumentInfoContainer documentInfoContainer = htmlHandler.GetDocumentInfo(guid, options) as ArchiveDocumentInfoContainer;
foreach (string folderName in documentInfoContainer.Folders)
Console.WriteLine("Folder name: {0}", folderName);
// For complete examples and data files, please go to https://github.com/groupdocs-viewer/GroupDocs.Viewer-for-.NET
// Setup GroupDocs.Viewer config
ViewerConfig viewerConfig = new ViewerConfig();
viewerConfig.StoragePath = @"C:\storage";
// Create image handler
ViewerImageHandler imageHandler = new ViewerImageHandler(viewerConfig);
// Create PDF file security
string ownerPassword = "owner password";
string userPassword = "user password";
PdfFilePermissions denyPrinting = PdfFilePermissions.All ^ PdfFilePermissions.Printing;
PdfFileSecurity pdfFileSecurity = new PdfFileSecurity(ownerPassword, userPassword, denyPrinting);
// Create options
PdfFileOptions pdfFileOptions = new PdfFileOptions();
pdfFileOptions.PdfFileSecurity = pdfFileSecurity;
string guid = "document.doc";
FileContainer fileContainer = imageHandler.GetPdfFile(guid, pdfFileOptions);
// For complete examples and data files, please go to https://github.com/groupdocs-viewer/GroupDocs.Viewer-for-.NET
// Setup GroupDocs.Viewer config
ViewerConfig config = new ViewerConfig();
config.StoragePath = @"C:\storage";
// Create image handler or use ViewerHtmlHandler to render into HTML
ViewerImageHandler imageHandler = new ViewerImageHandler(config);
string guid = "sample.zip";
// Create image options with specified folder name (use HtmlOptions to render into HTML)
ImageOptions options = new ImageOptions();
options.ArchiveOptions.FolderName = "FirstLevelFolder/SecondLevelFolder";
// Render document into image
List<PageImage> pages = imageHandler.GetPages(guid, options);
foreach (PageImage page in pages)
{
// use page.Stream to work with rendering result
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.