public static void Run() { using (Viewer viewer = new Viewer(TestFiles.SAMPLE_PDF)) { ViewInfo info = viewer.GetViewInfo(ViewInfoOptions.ForHtmlView()); Console.WriteLine(info); } Console.WriteLine("\nView info retrieved successfully."); }
private PageDescriptionEntity GetPageDescritpionEntity(ICustomViewer customViewer, string documentGuid, int pageNumber, string fileCacheSubFolder) { PageDescriptionEntity page; customViewer.CreateCache(); var viewInfo = customViewer.GetViewer().GetViewInfo(ViewInfoOptions.ForHtmlView()); page = GetPageInfo(viewInfo.Pages[pageNumber - 1], Path.Combine(fileCacheSubFolder, "PagesInfo.xml")); page.SetData(GetPageContent(pageNumber, documentGuid, cachePath, false)); return(page); }
public static void Run() { using (Viewer viewer = new Viewer(TestFiles.SAMPLE_PDF)) { ViewInfoOptions options = ViewInfoOptions.ForHtmlView(); PdfViewInfo info = viewer.GetViewInfo(options) as PdfViewInfo; Console.WriteLine("Document type is: " + info.FileType); Console.WriteLine("Pages count: " + info.Pages.Count); Console.WriteLine("Printing allowed: " + info.PrintingAllowed); } Console.WriteLine("\nView info retrieved successfully."); }
private static void ReadFolders(Viewer viewer, string folder) { ViewInfoOptions options = ViewInfoOptions.ForHtmlView(); options.ArchiveOptions.Folder = folder; ArchiveViewInfo viewInfo = viewer.GetViewInfo(options) as ArchiveViewInfo; foreach (string subFolder in viewInfo.Folders) { Console.WriteLine($" - {subFolder}"); ReadFolders(viewer, subFolder); } }
public static void Run() { using (Viewer viewer = new Viewer(TestFiles.SAMPLE_MPP)) { ProjectManagementViewInfo info = viewer.GetViewInfo( ViewInfoOptions.ForHtmlView()) as ProjectManagementViewInfo; Console.WriteLine("Document type is: " + info.FileType); Console.WriteLine("Pages count: " + info.Pages.Count); Console.WriteLine("Project start date: {0}", info.StartDate); Console.WriteLine("Project end date: {0}", info.EndDate); } Console.WriteLine("\nView info retrieved successfully."); }
public static void Run() { using (Viewer viewer = new Viewer(TestFiles.THREE_SHEETS)) { ViewInfoOptions viewInfoOptions = ViewInfoOptions.ForHtmlView(); viewInfoOptions.SpreadsheetOptions = SpreadsheetOptions.ForOnePagePerSheet(); ViewInfo viewInfo = viewer.GetViewInfo(viewInfoOptions); Console.WriteLine("Worksheets:"); foreach (Page page in viewInfo.Pages) { Console.WriteLine($" - Worksheet {page.Number} name '{page.Name}'"); } } }
public static void Run() { using (Viewer viewer = new Viewer(TestFiles.SAMPLE_ZIP_WITH_FOLDERS)) { ViewInfo info = viewer.GetViewInfo(ViewInfoOptions.ForHtmlView()); Console.WriteLine("File type: " + info.FileType); Console.WriteLine("Pages count: " + info.Pages.Count); Console.WriteLine("Folders: "); Console.WriteLine(" - /"); string rootFolder = string.Empty; ReadFolders(viewer, rootFolder); } Console.WriteLine("\nView info retrieved successfully."); }
public static void Run() { using (Viewer viewer = new Viewer(TestFiles.SAMPLE_OST_SUBFOLDERS)) { ViewInfoOptions options = ViewInfoOptions.ForHtmlView(); OutlookViewInfo rootFolderInfo = viewer.GetViewInfo(options) as OutlookViewInfo; Console.WriteLine("File type is: " + rootFolderInfo.FileType); Console.WriteLine("Pages count: " + rootFolderInfo.Pages.Count); foreach (string folder in rootFolderInfo.Folders) { Console.WriteLine(folder); } } Console.WriteLine("\nView info retrieved successfully."); }
public static void Run() { using (Viewer viewer = new Viewer(TestFiles.SAMPLE_DWG_WITH_LAYOUTS_AND_LAYERS)) { CadViewInfo info = viewer.GetViewInfo( ViewInfoOptions.ForHtmlView()) as CadViewInfo; Console.WriteLine("Document type is: " + info.FileType); Console.WriteLine("Pages count: " + info.Pages.Count); foreach (Layout layout in info.Layouts) { Console.WriteLine(layout); } foreach (Layer layer in info.Layers) { Console.WriteLine(layer); } } Console.WriteLine("\nCAD info obtained successfully."); }
private static LoadDocumentEntity GetLoadDocumentEntity(bool loadAllPages, string documentGuid, string fileCacheSubFolder, ICustomViewer customViewer, bool printVersion) { if (loadAllPages) { customViewer.CreateCache(); } dynamic viewInfo = customViewer.GetViewer().GetViewInfo(ViewInfoOptions.ForHtmlView()); LoadDocumentEntity loadDocumentEntity = new LoadDocumentEntity(); if (!Directory.Exists(cachePath)) { Directory.CreateDirectory(cachePath); } string pagesInfoPath; TryCreatePagesInfoXml(fileCacheSubFolder, viewInfo, out pagesInfoPath); foreach (Page page in viewInfo.Pages) { PageDescriptionEntity pageData = GetPageInfo(page, pagesInfoPath); if (loadAllPages) { pageData.SetData(GetPageContent(page.Number, documentGuid, cachePath, printVersion)); } loadDocumentEntity.SetPages(pageData); } loadDocumentEntity.SetGuid(documentGuid); return(loadDocumentEntity); }