コード例 #1
0
 public HtmlViewer(string filePath, IViewerCache cache, LoadOptions loadOptions, int pageNumber = -1, int newAngle = 0)
 {
     this.cache           = cache;
     this.filePath        = filePath;
     this.viewer          = new GroupDocs.Viewer.Viewer(filePath, loadOptions);
     this.viewOptions     = this.CreateHtmlViewOptions(pageNumber, newAngle);
     this.viewInfoOptions = ViewInfoOptions.FromHtmlViewOptions(this.viewOptions);
 }
コード例 #2
0
        public static void Run()
        {
            string outputDirectory    = Utils.GetOutputDirectoryPath();
            string pageFilePathFormat = Path.Combine(outputDirectory, "page_{0}.html");

            using (Viewer viewer = new Viewer(TestFiles.SAMPLE_MPP))
            {
                HtmlViewOptions options = HtmlViewOptions.ForEmbeddedResources(pageFilePathFormat);

                ProjectManagementViewInfo viewInfo =
                    viewer.GetViewInfo(ViewInfoOptions.FromHtmlViewOptions(options)) as ProjectManagementViewInfo;

                options.ProjectManagementOptions.StartDate = viewInfo.StartDate;
                options.ProjectManagementOptions.EndDate   = viewInfo.StartDate.AddDays(7);

                viewer.View(options);
            }

            Console.WriteLine($"\nSource document rendered successfully.\nCheck output in {outputDirectory}.");
        }