Aspose.Pdf.Examples.CSharp.AsposePDF.DocumentConversion.PDFToHTMLFormat.OutPutToStream.PDFNEWNET_34748 C# (CSharp) Method

PDFNEWNET_34748() public static method

public static PDFNEWNET_34748 ( ) : void
return void
        public static void PDFNEWNET_34748()
        {
            //-----------------------------------------------------
            // 1) Tune paths and set license
            //-----------------------------------------------------
            (new Aspose.Pdf.License()).SetLicense(@"F:\_Sources\Aspose_5\trunk\testdata\License\Aspose.Total.lic");
            Document pdfDocument = new Document(@"F:\ExternalTestsData\34748_36189.pdf");
            string outHtmlFile = @"F:\ExternalTestsData\34748.html";
            _folderForReferencedResources_34748 = @"F:\ExternalTestsData\out_34748\";
            //-----------------------------------------------------
            // 2) Clean results if they already present
            //-----------------------------------------------------
            if (Directory.Exists(_folderForReferencedResources_34748))
            {
                Directory.Delete(_folderForReferencedResources_34748, true);
            }
            File.Delete(outHtmlFile);
            //-----------------------------------------------------
            // Create HtmlSaveOption with tested feature
            //-----------------------------------------------------
            HtmlSaveOptions saveOptions = new HtmlSaveOptions();
            saveOptions.CustomResourceSavingStrategy = new HtmlSaveOptions.ResourceSavingStrategy(Strategy_11_CUSTOM_SAVE_OF_FONTS_AND_IMAGES);
            saveOptions.CustomCssSavingStrategy = new HtmlSaveOptions.CssSavingStrategy(Strategy_11_CSS_WriteCssToPredefinedFolder);
            saveOptions.CustomStrategyOfCssUrlCreation = new HtmlSaveOptions.CssUrlMakingStrategy(Strategy_11_CSS_ReturnResultPathInPredefinedTestFolder);

            using (Stream outStream = File.OpenWrite(outHtmlFile))
            {
                pdfDocument.Save(outStream, saveOptions);
            }
        }