public static void Run()
        {
            string outputDirectory    = Utils.GetOutputDirectoryPath();
            string pageFilePathFormat = Path.Combine(outputDirectory, "RAR_result.html");

            // TO single page HTML
            using (Viewer viewer = new Viewer(TestFiles.SAMPLE_RAR_WITH_FOLDERS))
            {
                HtmlViewOptions options = HtmlViewOptions.ForEmbeddedResources(pageFilePathFormat);

                options.RenderToSinglePage = true;

                viewer.View(options);
            }

            // RAR_result_page_{0}.html - {0} is page number mask
            pageFilePathFormat = Path.Combine(outputDirectory, "RAR_result_page_{0}.html");

            // TO multi pages HTML
            using (Viewer viewer = new Viewer(TestFiles.SAMPLE_RAR_WITH_FOLDERS))
            {
                HtmlViewOptions options = HtmlViewOptions.ForEmbeddedResources(pageFilePathFormat);

                /*
                 * If options.RenderToSinglePage is set to false (by default),
                 * you can set the number of items per page (default is 16), this property is for rendering to HTML only
                 */
                options.ArchiveOptions.ItemsPerPage = 10;

                viewer.View(options);
            }

            Console.WriteLine($"\nSource document rendered successfully.\nCheck output in {outputDirectory}.");
        }
Exemplo n.º 2
0
        public static void Run()
        {
            string outputDirectory    = Utils.GetOutputDirectoryPath();
            string cachePath          = Path.Combine(outputDirectory, "cache");
            string pageFilePathFormat = Path.Combine(outputDirectory, "page_{0}.html");

            FileCache      cache    = new FileCache(cachePath);
            ViewerSettings settings = new ViewerSettings(cache);

            using (Viewer viewer = new Viewer(TestFiles.SAMPLE_DOCX, settings))
            {
                HtmlViewOptions options = HtmlViewOptions.ForEmbeddedResources(pageFilePathFormat);

                Stopwatch stopWatch = Stopwatch.StartNew();
                viewer.View(options);
                stopWatch.Stop();

                Console.WriteLine("Time taken on first call to View method {0} (ms).", stopWatch.ElapsedMilliseconds);

                stopWatch.Restart();
                viewer.View(options);
                stopWatch.Stop();

                Console.WriteLine("Time taken on second call to View method {0} (ms).", stopWatch.ElapsedMilliseconds);
            }

            Console.WriteLine($"\nSource document rendered successfully.\nCheck output in {outputDirectory}.");
        }
Exemplo n.º 3
0
        public ActionResult Index()
        {
            License lic = new License();

            lic.SetLicense(@"D:/GD Licenses/Conholdate.Total.NET.lic");
            MemoryStream outputStream = new MemoryStream();
            //specify just the file name if you are pulling the data from database
            var    filePath = Server.MapPath("~/Content/");
            string fileName = filePath + "sample.pdf";

            FileType fileType = FileType.FromExtension(Path.GetExtension(fileName));

            using (Viewer viewer = new Viewer(() => GetSourceFileStream(fileName), () => new LoadOptions(fileType)))
            {
                HtmlViewOptions Options = HtmlViewOptions.ForEmbeddedResources(
                    (pageNumber) => outputStream,
                    (pageNumber, pageStream) => { });
                viewer.View(Options);
            }

            outputStream.Position = 0;


            return(File(outputStream, "text/html"));
        }
 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);
 }
Exemplo n.º 5
0
        public static void Run()
        {
            string outputDirectory    = Utils.GetOutputDirectoryPath();
            string pageFilePathFormat = Path.Combine(outputDirectory, "cmx_result_{0}.html");

            // TO HTML
            using (Viewer viewer = new Viewer(TestFiles.SAMPLE_CMX))
            {
                HtmlViewOptions options = HtmlViewOptions.ForEmbeddedResources(pageFilePathFormat);

                viewer.View(options);

                // To render 2nd image, just specify
                //viewer.View(options,2);
            }

            // TO JPG
            pageFilePathFormat = Path.Combine(outputDirectory, "cmx_result_{0}.jpg");

            using (Viewer viewer = new Viewer(TestFiles.SAMPLE_CMX))
            {
                JpgViewOptions options = new JpgViewOptions(pageFilePathFormat);

                viewer.View(options);

                // To render 2nd image, just specify
                //viewer.View(options,2);
            }

            // TO PNG
            pageFilePathFormat = Path.Combine(outputDirectory, "cmx_result_{0}.png");

            using (Viewer viewer = new Viewer(TestFiles.SAMPLE_CMX))
            {
                PngViewOptions options = new PngViewOptions(pageFilePathFormat);

                viewer.View(options);

                // To render 2nd image, just specify
                //viewer.View(options,2);
            }

            // TO PDF
            pageFilePathFormat = Path.Combine(outputDirectory, "cmx_result.pdf");

            using (Viewer viewer = new Viewer(TestFiles.SAMPLE_CMX))
            {
                PdfViewOptions options = new PdfViewOptions(pageFilePathFormat);

                viewer.View(options);

                // By default all images will be rendered in output.pdf, to render only 2nd image in output PDF
                //viewer.View(options,2);
            }

            Console.WriteLine($"\nSource document rendered successfully.\nCheck output in {outputDirectory}.");
        }
        public static void Run()
        {
            string outputDirectory  = Utils.GetOutputDirectoryPath();
            string pageFileFullPath = Path.Combine(outputDirectory, "Txt_result.html");

            // TO MULTI PAGES HTML
            using (Viewer viewer = new Viewer(TestFiles.SAMPLE_TXT))
            {
                HtmlViewOptions options = HtmlViewOptions.ForEmbeddedResources(pageFileFullPath);

                viewer.View(options);
            }

            pageFileFullPath = Path.Combine(outputDirectory, "Txt_result_single_page.html");

            // TO SINGLE HTML
            using (Viewer viewer = new Viewer(TestFiles.SAMPLE_2_TXT))
            {
                HtmlViewOptions options = HtmlViewOptions.ForEmbeddedResources(pageFileFullPath);
                options.RenderToSinglePage = true;

                viewer.View(options);
            }

            // TO JPG
            pageFileFullPath = Path.Combine(outputDirectory, "Txt_result.jpg");

            using (Viewer viewer = new Viewer(TestFiles.SAMPLE_TXT))
            {
                JpgViewOptions options = new JpgViewOptions(pageFileFullPath);

                viewer.View(options);
            }

            // TO PNG
            pageFileFullPath = Path.Combine(outputDirectory, "Txt_result.png");

            using (Viewer viewer = new Viewer(TestFiles.SAMPLE_TXT))
            {
                PngViewOptions options = new PngViewOptions(pageFileFullPath);

                viewer.View(options);
            }

            // TO PDF
            pageFileFullPath = Path.Combine(outputDirectory, "Txt_result.pdf");

            using (Viewer viewer = new Viewer(TestFiles.SAMPLE_TXT))
            {
                PdfViewOptions options = new PdfViewOptions(pageFileFullPath);

                viewer.View(options);
            }

            Console.WriteLine($"\nSource document rendered successfully.\nCheck output in {outputDirectory}.");
        }
Exemplo n.º 7
0
        public static void Run()
        {
            string outputDirectory    = Utils.GetOutputDirectoryPath();
            string pageFilePathFormat = Path.Combine(outputDirectory, "result_page.html");

            // TO HTML
            using (Viewer viewer = new Viewer(TestFiles.SAMPLE_VISIO))
            {
                HtmlViewOptions options = HtmlViewOptions.ForEmbeddedResources(pageFilePathFormat);
                options.VisioRenderingOptions.RenderFiguresOnly = true;
                options.VisioRenderingOptions.FigureWidth       = 250;

                viewer.View(options);
            }

            // TO JPG
            pageFilePathFormat = Path.Combine(outputDirectory, "visio_result.jpg");

            using (Viewer viewer = new Viewer(TestFiles.SAMPLE_VISIO))
            {
                JpgViewOptions options = new JpgViewOptions(pageFilePathFormat);
                options.VisioRenderingOptions.RenderFiguresOnly = true;
                options.VisioRenderingOptions.FigureWidth       = 250;

                viewer.View(options);
            }

            // TO PNG
            pageFilePathFormat = Path.Combine(outputDirectory, "visio_result.png");

            using (Viewer viewer = new Viewer(TestFiles.SAMPLE_VISIO))
            {
                PngViewOptions options = new PngViewOptions(pageFilePathFormat);
                options.VisioRenderingOptions.RenderFiguresOnly = true;
                options.VisioRenderingOptions.FigureWidth       = 250;

                viewer.View(options);
            }

            // TO PDF
            pageFilePathFormat = Path.Combine(outputDirectory, "visio_result.pdf");

            using (Viewer viewer = new Viewer(TestFiles.SAMPLE_VISIO))
            {
                PdfViewOptions options = new PdfViewOptions(pageFilePathFormat);
                options.VisioRenderingOptions.RenderFiguresOnly = true;
                options.VisioRenderingOptions.FigureWidth       = 250;

                viewer.View(options);
            }

            Console.WriteLine($"\nSource document rendered successfully.\nCheck output in {outputDirectory}.");
        }
Exemplo n.º 8
0
        public static void Run()
        {
            string outputDirectory    = Utils.GetOutputDirectoryPath();
            string pageFilePathFormat = Path.Combine(outputDirectory, "page_{0}.html");

            using (Viewer viewer = new Viewer(TestFiles.SAMPLE_DOCX))
            {
                HtmlViewOptions options = HtmlViewOptions.ForEmbeddedResources(pageFilePathFormat);
                viewer.View(options, 1, 3);
            }

            Console.WriteLine($"\nSource document rendered successfully.\nCheck output in {outputDirectory}.");
        }
Exemplo n.º 9
0
        public static void Run()
        {
            string outputDirectory  = Utils.GetOutputDirectoryPath();
            string pageFileFullPath = Path.Combine(outputDirectory, "Excel_2003_Xml_result.html");

            /* Because the XML extension is associated with both an XML text document and Excel 2003 XML SpreadSheetML,
             * please specify the Excel2003XML fileType explicitly to render it as Excel 2003 XML SpreadSheetML.
             */

            LoadOptions loadOptions = new LoadOptions(FileType.Excel2003XML);

            // TO MULTI PAGES HTML
            using (Viewer viewer = new Viewer(TestFiles.SAMPLE_XML_SPREADSHEETML, loadOptions))
            {
                HtmlViewOptions options = HtmlViewOptions.ForEmbeddedResources(pageFileFullPath);

                viewer.View(options);
            }

            // TO JPG
            pageFileFullPath = Path.Combine(outputDirectory, "Excel_2003_Xml_result.jpg");

            using (Viewer viewer = new Viewer(TestFiles.SAMPLE_XML_SPREADSHEETML, loadOptions))
            {
                JpgViewOptions options = new JpgViewOptions(pageFileFullPath);

                viewer.View(options);
            }

            // TO PNG
            pageFileFullPath = Path.Combine(outputDirectory, "Excel_2003_Xml_result.png");

            using (Viewer viewer = new Viewer(TestFiles.SAMPLE_XML_SPREADSHEETML, loadOptions))
            {
                PngViewOptions options = new PngViewOptions(pageFileFullPath);

                viewer.View(options);
            }

            // TO PDF
            pageFileFullPath = Path.Combine(outputDirectory, "Excel_2003_Xml_result.pdf");

            using (Viewer viewer = new Viewer(TestFiles.SAMPLE_XML_SPREADSHEETML, loadOptions))
            {
                PdfViewOptions options = new PdfViewOptions(pageFileFullPath);

                viewer.View(options);
            }

            Console.WriteLine($"\nSource document rendered successfully.\nCheck output in {outputDirectory}.");
        }
Exemplo n.º 10
0
        public static void Run()
        {
            string key                = "sample.docx";
            string outputDirectory    = Utils.GetOutputDirectoryPath();
            string pageFilePathFormat = Path.Combine(outputDirectory, "page_{0}.html");

            using (Viewer viewer = new Viewer(() => DownloadFile(key)))
            {
                HtmlViewOptions options = HtmlViewOptions.ForEmbeddedResources(pageFilePathFormat);
                viewer.View(options);
            }

            Console.WriteLine($"\nSource document rendered successfully.\nCheck output in {outputDirectory}.");
        }
Exemplo n.º 11
0
        public static void Run()
        {
            string url                = "https://cms.admin.containerize.com/templates/groupdocs/images/logos/groupdocs-logo.png";
            string outputDirectory    = Utils.GetOutputDirectoryPath();
            string pageFilePathFormat = Path.Combine(outputDirectory, "page_{0}.html");

            using (Viewer viewer = new Viewer(() => GetRemoteFile(url)))
            {
                HtmlViewOptions options = HtmlViewOptions.ForEmbeddedResources(pageFilePathFormat);
                viewer.View(options);
            }

            Console.WriteLine($"\nSource document rendered successfully.\nCheck output in {outputDirectory}.");
        }
Exemplo n.º 12
0
        public String PrintableHtml(string file, string folderName)
        {
            string outPath = AppSettings.WorkingDirectory + folderName + "/" + file;

            //GroupDocs.Apps.API.Models.License.SetGroupDocsViewerLicense();
            HtmlViewOptions options = HtmlViewOptions.ForEmbeddedResources("page_{0}.html");

            options.Minify = true;

            GroupDocs.Viewer.Viewer viewer = new GroupDocs.Viewer.Viewer(AppSettings.WorkingDirectory + folderName + "/" + file);
            viewer.View(options);

            return("".Replace(".doc-page { position: absolute; }", ".doc-page { position: relative; }"));
        }
Exemplo n.º 13
0
        /// <summary>
        /// View file.
        /// </summary>
        /// <param name="viewer">Viewer object.</param>
        /// <param name="page">Page number to view.</param>
        private void ViewFile(Viewer viewer, int page = 1)
        {
            if (ViewInfo != null)
            {
                HtmlViewOptions htmlViewOptions = HtmlViewOptions.ForEmbeddedResources(MemoryPageStreamFactory);
                viewer.View(htmlViewOptions, page);

                MemoryPageStreamFactory.Stream.Position = 0;
                webBrowerMain.DocumentStream            = MemoryPageStreamFactory.Stream;
            }

            UpdateControlsVisibility();
            DisplayViewInfo();
        }
        public static void Run()
        {
            string outputDirectory    = Utils.GetOutputDirectoryPath();
            string pageFilePathFormat = Path.Combine(outputDirectory, "chm_result_{0}.html");

            // TO HTML
            using (Viewer viewer = new Viewer(TestFiles.SAMPLE_CHM))
            {
                HtmlViewOptions options = HtmlViewOptions.ForEmbeddedResources(pageFilePathFormat);
                options.RenderToSinglePage = true; // Enable it if you want to convert all CHM content to single page

                //viewer.View(options,1,2,3); // Convert only 1,2,3 pages
                viewer.View(options);  // Convert all pages
            }

            // TO JPG
            pageFilePathFormat = Path.Combine(outputDirectory, "chm_result_{0}.jpg");

            using (Viewer viewer = new Viewer(TestFiles.SAMPLE_CHM))
            {
                JpgViewOptions options = new JpgViewOptions(pageFilePathFormat);

                viewer.View(options, 1, 2, 3); // Convert only 1,2,3 pages
                //viewer.View(options); // Convert all pages
            }

            // TO PNG
            pageFilePathFormat = Path.Combine(outputDirectory, "chm_result_{0}.png");

            using (Viewer viewer = new Viewer(TestFiles.SAMPLE_CHM))
            {
                PngViewOptions options = new PngViewOptions(pageFilePathFormat);

                viewer.View(options, 1, 2, 3); // Convert only 1,2,3 pages
                //viewer.View(options); // Convert all pages
            }

            // TO PDF
            pageFilePathFormat = Path.Combine(outputDirectory, "chm_result.pdf");

            using (Viewer viewer = new Viewer(TestFiles.SAMPLE_CHM))
            {
                PdfViewOptions options = new PdfViewOptions(pageFilePathFormat);

                viewer.View(options); // Convert all pages
            }

            Console.WriteLine($"\nSource document rendered successfully.\nCheck output in {outputDirectory}.");
        }
        public static void Run()
        {
            string outputDirectory    = Utils.GetOutputDirectoryPath();
            string pageFilePathFormat = Path.Combine(outputDirectory, "page_{0}.html");

            // TO HTML
            using (Viewer viewer = new Viewer(TestFiles.SAMPLE_XLSX))
            {
                HtmlViewOptions options = HtmlViewOptions.ForEmbeddedResources(pageFilePathFormat);
                options.SpreadsheetOptions.RenderHeadings = true;

                viewer.View(options, 1, 2, 3);
            }

            // TO JPG
            pageFilePathFormat = Path.Combine(outputDirectory, "page_{0}.jpg");

            using (Viewer viewer = new Viewer(TestFiles.SAMPLE_XLSX))
            {
                JpgViewOptions options = new JpgViewOptions(pageFilePathFormat);
                options.SpreadsheetOptions.RenderHeadings = true;

                viewer.View(options, 1, 2, 3);
            }

            // TO PNG
            pageFilePathFormat = Path.Combine(outputDirectory, "page_{0}.png");

            using (Viewer viewer = new Viewer(TestFiles.SAMPLE_XLSX))
            {
                PngViewOptions options = new PngViewOptions(pageFilePathFormat);
                options.SpreadsheetOptions.RenderHeadings = true;

                viewer.View(options, 1, 2, 3);
            }

            // TO PDF
            pageFilePathFormat = Path.Combine(outputDirectory, "output.pdf");

            using (Viewer viewer = new Viewer(TestFiles.SAMPLE_XLSX))
            {
                PdfViewOptions options = new PdfViewOptions(pageFilePathFormat);
                options.SpreadsheetOptions.RenderHeadings = true;

                viewer.View(options, 1, 2, 3);
            }

            Console.WriteLine($"\nSource document rendered successfully.\nCheck output in {outputDirectory}.");
        }
        public static void Run()
        {
            string outputDirectory    = Utils.GetOutputDirectoryPath();
            string pageFilePathFormat = Path.Combine(outputDirectory, "page_{0}.html");

            using (Viewer viewer = new Viewer(TestFiles.SAMPLE_XLSX_WITH_EMPTY_COLUMN))
            {
                HtmlViewOptions options = HtmlViewOptions.ForEmbeddedResources(pageFilePathFormat);
                options.SpreadsheetOptions.SkipEmptyColumns = true;

                viewer.View(options);
            }

            Console.WriteLine($"\nSource document rendered successfully.\nCheck output in {outputDirectory}.");
        }
        public static void Run()
        {
            string outputDirectory    = Utils.GetOutputDirectoryPath();
            string pageFilePathFormat = Path.Combine(outputDirectory, "page_{0}.html");

            using (Viewer viewer = new Viewer(TestFiles.MISSING_FONT_PPTX))
            {
                HtmlViewOptions options = HtmlViewOptions.ForEmbeddedResources(pageFilePathFormat);
                options.DefaultFontName = "Courier New";

                viewer.View(options);
            }

            Console.WriteLine($"\nSource document rendered successfully.\nCheck output in {outputDirectory}.");
        }
Exemplo n.º 18
0
        /// <summary>
        /// This example demonstrates how to render folder of archive file.
        /// </summary>
        private static void RenderSpecificArchiveFolder()
        {
            string outputDirectory    = Utils.GetOutputDirectoryPath();
            string pageFilePathFormat = Path.Combine(outputDirectory, "archive_folder_page_{0}.html");

            using (Viewer viewer = new Viewer(TestFiles.SAMPLE_RAR_WITH_FOLDERS))
            {
                HtmlViewOptions options = HtmlViewOptions.ForEmbeddedResources(pageFilePathFormat);
                options.ArchiveOptions.Folder = @"with_folders\ThirdFolderWithItems";

                viewer.View(options);
            }

            Console.WriteLine($"\nSource document rendered successfully.\nCheck output in {outputDirectory}.");
        }
        public static void Run()
        {
            string outputDirectory    = Utils.GetOutputDirectoryPath();
            string pageFilePathFormat = Path.Combine(outputDirectory, "page_{0}.html");

            using (Viewer viewer = new Viewer(TestFiles.HIEROGLYPHS_PDF))
            {
                HtmlViewOptions options = HtmlViewOptions.ForEmbeddedResources(pageFilePathFormat);
                options.PdfOptions.DisableCharsGrouping = true;

                viewer.View(options);
            }

            Console.WriteLine($"\nSource document rendered successfully.\nCheck output in {outputDirectory}.");
        }
Exemplo n.º 20
0
        public static void Run()
        {
            string outputDirectory    = Utils.GetOutputDirectoryPath();
            string pageFilePathFormat = Path.Combine(outputDirectory, "page_{0}.html");

            using (Viewer viewer = new Viewer(TestFiles.SAMPLE_XLSX_WITH_TEXT_OVERFLOW))
            {
                HtmlViewOptions options = HtmlViewOptions.ForEmbeddedResources(pageFilePathFormat);
                options.SpreadsheetOptions.TextOverflowMode = TextOverflowMode.HideText;

                viewer.View(options);
            }

            Console.WriteLine($"\nSource document rendered successfully.\nCheck output in {outputDirectory}.");
        }
        public static void Run()
        {
            string outputDirectory    = Utils.GetOutputDirectoryPath();
            string pageFilePathFormat = Path.Combine(outputDirectory, "page_{0}.html");

            using (Viewer viewer = new Viewer(TestFiles.SAMPLE_DWG_WITH_LAYOUTS_AND_LAYERS))
            {
                HtmlViewOptions options = HtmlViewOptions.ForEmbeddedResources(pageFilePathFormat);
                options.CadOptions = CadOptions.ForRenderingByScaleFactor(0.5f);

                viewer.View(options);
            }

            Console.WriteLine($"\nSource document rendered successfully.\nCheck output in {outputDirectory}.");
        }
        public static void Run()
        {
            string outputDirectory    = Utils.GetOutputDirectoryPath();
            string pageFilePathFormat = Path.Combine(outputDirectory, "page_{0}.html");

            using (Viewer viewer = new Viewer(TestFiles.SAMPLE_DOCX_WITH_TRACKED_CHANGES))
            {
                HtmlViewOptions options = HtmlViewOptions.ForEmbeddedResources(pageFilePathFormat);
                options.WordProcessingOptions.RenderTrackedChanges = true;

                viewer.View(options);
            }

            Console.WriteLine($"\nSource document rendered successfully.\nCheck output in {outputDirectory}.");
        }
Exemplo n.º 23
0
        public static void Run()
        {
            string outputDirectory    = Utils.GetOutputDirectoryPath();
            string pageFilePathFormat = Path.Combine(outputDirectory, "page_{0}.html");
            string filePath           = "ftp://localhost/sample.doc";

            using (Viewer viewer = new Viewer(() => GetFileFromFtp(filePath)))
            {
                HtmlViewOptions options = HtmlViewOptions.ForEmbeddedResources(pageFilePathFormat);

                viewer.View(options);
            }

            Console.WriteLine($"\nSource document rendered successfully.\nCheck output in {outputDirectory}.");
        }
Exemplo n.º 24
0
        public static void Run()
        {
            string outputDirectory    = Utils.GetOutputDirectoryPath();
            string pageFilePathFormat = Path.Combine(outputDirectory, "RAR_result_{0}.html");

            // TO HTML
            using (Viewer viewer = new Viewer(TestFiles.SAMPLE_RAR_WITH_FOLDERS))
            {
                HtmlViewOptions options = HtmlViewOptions.ForEmbeddedResources(pageFilePathFormat);

                viewer.View(options);
            }

            // TO JPG
            pageFilePathFormat = Path.Combine(outputDirectory, "RAR_result_{0}.jpg");

            using (Viewer viewer = new Viewer(TestFiles.SAMPLE_RAR_WITH_FOLDERS))
            {
                JpgViewOptions options = new JpgViewOptions(pageFilePathFormat);

                viewer.View(options);
            }

            // TO PNG
            pageFilePathFormat = Path.Combine(outputDirectory, "RAR_result_{0}.png");

            using (Viewer viewer = new Viewer(TestFiles.SAMPLE_RAR_WITH_FOLDERS))
            {
                PngViewOptions options = new PngViewOptions(pageFilePathFormat);

                viewer.View(options);
            }

            // TO PDF
            pageFilePathFormat = Path.Combine(outputDirectory, "RAR_result.pdf");

            using (Viewer viewer = new Viewer(TestFiles.SAMPLE_RAR_WITH_FOLDERS))
            {
                PdfViewOptions options = new PdfViewOptions(pageFilePathFormat);

                viewer.View(options);
            }

            GetViewInfoForRar();
            RenderSpecificArchiveFolder();

            Console.WriteLine($"\nSource document rendered successfully.\nCheck output in {outputDirectory}.");
        }
        public static void Run()
        {
            string outputDirectory    = Utils.GetOutputDirectoryPath();
            string pageFilePathFormat = Path.Combine(outputDirectory, "page_{0}.html");
            int    countRowsPerPage   = 45;

            using (Viewer viewer = new Viewer(TestFiles.SAMPLE_XLSX))
            {
                HtmlViewOptions options = HtmlViewOptions.ForEmbeddedResources(pageFilePathFormat);
                options.SpreadsheetOptions = SpreadsheetOptions.ForSplitSheetIntoPages(countRowsPerPage);

                viewer.View(options);
            }

            Console.WriteLine($"\nSource document rendered successfully.\nCheck output in {outputDirectory}.");
        }
        public static void Run()
        {
            string outputDirectory    = Utils.GetOutputDirectoryPath();
            string pageFilePathFormat = Path.Combine(outputDirectory, "page_{0}.html");

            using (Viewer viewer = new Viewer(TestFiles.SAMPLE_OST_SUBFOLDERS))
            {
                HtmlViewOptions options = HtmlViewOptions.ForEmbeddedResources(pageFilePathFormat);
                options.OutlookOptions.TextFilter    = "Microsoft";
                options.OutlookOptions.AddressFilter = "susan";

                viewer.View(options);
            }

            Console.WriteLine($"\nSource document rendered successfully.\nCheck output in {outputDirectory}.");
        }
Exemplo n.º 27
0
        /// <summary>
        /// Logging to file.
        /// </summary>
        public static void ToFile()
        {
            ViewerSettings viewerSettings = new ViewerSettings(new FileLogger("output.log"));

            string outputDirectory    = Utils.GetOutputDirectoryPath();
            string pageFilePathFormat = Path.Combine(outputDirectory, "page_{0}.html");

            using (Viewer viewer = new Viewer(TestFiles.SAMPLE_PDF, viewerSettings))
            {
                HtmlViewOptions options = HtmlViewOptions.ForEmbeddedResources(pageFilePathFormat);

                viewer.View(options);
            }

            Console.WriteLine($"\nSource document rendered successfully.\nCheck output in {outputDirectory}.");
        }
        public static void Run()
        {
            FontSettings.SetFontSources(
                new FolderFontSource(Utils.FontsPath, Fonts.SearchOption.TopFolderOnly));

            string outputDirectory    = Utils.GetOutputDirectoryPath();
            string pageFilePathFormat = Path.Combine(outputDirectory, "page_{0}.html");

            using (Viewer viewer = new Viewer(TestFiles.MISSING_FONT_ODG))
            {
                HtmlViewOptions options = HtmlViewOptions.ForEmbeddedResources(pageFilePathFormat);
                viewer.View(options);
            }

            Console.WriteLine($"\nSource document rendered successfully.\nCheck output in {outputDirectory}.");
        }
Exemplo n.º 29
0
        public static void Run()
        {
            string outputDirectory    = Utils.GetOutputDirectoryPath();
            string pageFilePathFormat = Path.Combine(outputDirectory, "page_{0}.html");

            using (Viewer viewer = new Viewer(TestFiles.SAMPLE_NSF))
            {
                HtmlViewOptions options = HtmlViewOptions.ForEmbeddedResources(pageFilePathFormat);
                //options.LotusNotesOptions.TextFilter = "April 2015";
                options.LotusNotesOptions.AddressFilter = "*****@*****.**";

                viewer.View(options);
            }

            Console.WriteLine($"\nSource document rendered successfully.\nCheck output in {outputDirectory}.");
        }
        public static void Run()
        {
            string outputDirectory    = Utils.GetOutputDirectoryPath();
            string pageFilePathFormat = Path.Combine(outputDirectory, "page_{0}.html");

            LoadOptions loadOptions = new LoadOptions
            {
                ResourceLoadingTimeout = TimeSpan.FromSeconds(5)
            };

            using (Viewer viewer = new Viewer(TestFiles.WITH_EXTERNAL_IMAGE_DOC, loadOptions))
            {
                HtmlViewOptions options = HtmlViewOptions.ForEmbeddedResources(pageFilePathFormat);
                viewer.View(options);
            }

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