public void CheckThatAllMethodsArePresent()
        {
            HtmlFixedSaveOptions htmlFixedSaveOptions = new HtmlFixedSaveOptions();

            htmlFixedSaveOptions.PageSavingCallback = new CustomPageFileNamePageSavingCallback();

            ImageSaveOptions imageSaveOptions = new ImageSaveOptions(SaveFormat.Png);

            imageSaveOptions.PageSavingCallback = new CustomPageFileNamePageSavingCallback();

            PdfSaveOptions pdfSaveOptions = new PdfSaveOptions();

            pdfSaveOptions.PageSavingCallback = new CustomPageFileNamePageSavingCallback();

            PsSaveOptions psSaveOptions = new PsSaveOptions();

            psSaveOptions.PageSavingCallback = new CustomPageFileNamePageSavingCallback();

            SvgSaveOptions svgSaveOptions = new SvgSaveOptions();

            svgSaveOptions.PageSavingCallback = new CustomPageFileNamePageSavingCallback();

            SwfSaveOptions swfSaveOptions = new SwfSaveOptions();

            swfSaveOptions.PageSavingCallback = new CustomPageFileNamePageSavingCallback();

            XamlFixedSaveOptions xamlFixedSaveOptions = new XamlFixedSaveOptions();

            xamlFixedSaveOptions.PageSavingCallback = new CustomPageFileNamePageSavingCallback();

            XpsSaveOptions xpsSaveOptions = new XpsSaveOptions();

            xpsSaveOptions.PageSavingCallback = new CustomPageFileNamePageSavingCallback();
        }
        public void SetLogo()
        {
            Document doc = new Document(MyDir + "Document.doc");

            //ExStart
            //ExFor:SwfSaveOptions.#ctor
            //ExFor:SwfSaveOptions
            //ExFor:SwfSaveOptions.LogoImageBytes
            //ExFor:SwfSaveOptions.LogoLink
            //ExSummary:Shows how to specify a custom logo and link it to a web address in the embedded document viewer.
            // Create an instance of SwfSaveOptions.
            SwfSaveOptions options = new SwfSaveOptions();

            // Read the image into byte array.
            byte[] logoBytes = File.ReadAllBytes(MyDir + @"\Images\LogoSmall.png");

            // Specify the logo image to use.
            options.LogoImageBytes = logoBytes;

            // You can specify the URL of web page that should be opened when you click on the logo.
            options.LogoLink = "http://www.aspose.com";
            //ExEnd

            doc.Save(MyDir + @"\Artifacts\SwfSaveOptions.CustomLogo.swf", options);
        }
Ejemplo n.º 3
0
        public void SetLogo()
        {
            Aspose.Words.Document doc = new Aspose.Words.Document(MyDir + "Document.doc");

            //ExStart
            //ExFor:SwfSaveOptions.#ctor
            //ExFor:SwfSaveOptions
            //ExFor:SwfSaveOptions.LogoImageBytes
            //ExFor:SwfSaveOptions.LogoLink
            //ExSummary:Shows how to specify a custom logo and link it to a web address in the embedded document viewer.
            // Create an instance of SwfSaveOptions.
            SwfSaveOptions options = new SwfSaveOptions();

            // Read the image into byte array.
            byte[] logoBytes = File.ReadAllBytes(MyDir + "LogoSmall.png");

            // Specify the logo image to use.
            options.LogoImageBytes = logoBytes;

            // You can specify the URL of web page that should be opened when you click on the logo.
            options.LogoLink = "http://www.aspose.com";
            //ExEnd

            doc.Save(MyDir + "SwfSaveOptions.CustomLogo Out.swf", options);
        }
        public void CheckThatAllMethodsArePresent()
        {
            HtmlFixedSaveOptions htmlFixedSaveOptions = new HtmlFixedSaveOptions();
            htmlFixedSaveOptions.PageSavingCallback = new CustomPageFileNamePageSavingCallback();

            ImageSaveOptions imageSaveOptions = new ImageSaveOptions(SaveFormat.Png);
            imageSaveOptions.PageSavingCallback = new CustomPageFileNamePageSavingCallback();

            PdfSaveOptions pdfSaveOptions = new PdfSaveOptions();
            pdfSaveOptions.PageSavingCallback = new CustomPageFileNamePageSavingCallback();

            PsSaveOptions psSaveOptions = new PsSaveOptions();
            psSaveOptions.PageSavingCallback = new CustomPageFileNamePageSavingCallback();

            SvgSaveOptions svgSaveOptions = new SvgSaveOptions();
            svgSaveOptions.PageSavingCallback = new CustomPageFileNamePageSavingCallback();

            SwfSaveOptions swfSaveOptions = new SwfSaveOptions();
            swfSaveOptions.PageSavingCallback = new CustomPageFileNamePageSavingCallback();

            XamlFixedSaveOptions xamlFixedSaveOptions = new XamlFixedSaveOptions();
            xamlFixedSaveOptions.PageSavingCallback = new CustomPageFileNamePageSavingCallback();

            XpsSaveOptions xpsSaveOptions = new XpsSaveOptions();
            xpsSaveOptions.PageSavingCallback = new CustomPageFileNamePageSavingCallback();
        }
        public void MetafileRendering(MetafileRenderingMode metafileRendering)
        {
            Document doc = new Document();

            SwfSaveOptions saveOptions = new SwfSaveOptions();

            saveOptions.MetafileRenderingOptions.RenderingMode = metafileRendering;

            doc.Save(MyDir + @"\Artifacts\MetafileRendering.swf", saveOptions);
        }
        public void SetRenderingMode()
        {
            //ExStart
            //ExFor:MetafileRenderingMode
            //ExFor:MetafileRenderingOptions.RenderingMode
            //ExSummary:Defines how metafile images should be rendered
            Document doc = new Document();

            SwfSaveOptions saveOptions = new SwfSaveOptions();

            saveOptions.MetafileRenderingOptions.RenderingMode = MetafileRenderingMode.VectorWithFallback;
            //ExEnd
        }
        public void UseCustomToolTips()
        {
            Document doc = new Document(MyDir + "Document.doc");

            //ExStart
            //ExFor:SwfSaveOptions
            //ExFor:SwfSaveOptions.ToolTipsFontName
            //ExFor:SwfSaveOptions.ToolTips
            //ExFor:SwfViewerControlIdentifier
            //ExSummary:Shows how to change the the tooltips used in the embedded document viewer.
            // We create an instance of SwfSaveOptions to specify our custom tooltips.
            SwfSaveOptions options = new SwfSaveOptions();

            // By default, all tooltips are in English. You can specify font used for each tooltip.
            // Note that font specified should contain proper glyphs normally used in tooltips.
            options.ToolTipsFontName = "Times New Roman";

            // The following code will set the tooltip used for each control. In our case we will change the tooltips from English
            // to Russian.
            options.ToolTips[SwfViewerControlIdentifier.TopPaneActualSizeButton]             = "Оригинальный размер";
            options.ToolTips[SwfViewerControlIdentifier.TopPaneFitToHeightButton]            = "По высоте страницы";
            options.ToolTips[SwfViewerControlIdentifier.TopPaneFitToWidthButton]             = "По ширине страницы";
            options.ToolTips[SwfViewerControlIdentifier.TopPaneZoomOutButton]                = "Увеличить";
            options.ToolTips[SwfViewerControlIdentifier.TopPaneZoomInButton]                 = "Уменшить";
            options.ToolTips[SwfViewerControlIdentifier.TopPaneSelectionModeButton]          = "Режим выделения текста";
            options.ToolTips[SwfViewerControlIdentifier.TopPaneDragModeButton]               = "Режим перетаскивания";
            options.ToolTips[SwfViewerControlIdentifier.TopPaneSinglePageScrollLayoutButton] = "Одностнаничный скролинг";
            options.ToolTips[SwfViewerControlIdentifier.TopPaneSinglePageLayoutButton]       = "Одностраничный режим";
            options.ToolTips[SwfViewerControlIdentifier.TopPaneTwoPageScrollLayoutButton]    = "Двустраничный скролинг";
            options.ToolTips[SwfViewerControlIdentifier.TopPaneTwoPageLayoutButton]          = "Двустраничный режим";
            options.ToolTips[SwfViewerControlIdentifier.TopPaneFullScreenModeButton]         = "Полноэкранный режим";
            options.ToolTips[SwfViewerControlIdentifier.TopPanePreviousPageButton]           = "Предыдущая старница";
            options.ToolTips[SwfViewerControlIdentifier.TopPanePageField]      = "Введите номер страницы";
            options.ToolTips[SwfViewerControlIdentifier.TopPaneNextPageButton] = "Следующая страница";
            options.ToolTips[SwfViewerControlIdentifier.TopPaneSearchField]    = "Введите искомый текст";
            options.ToolTips[SwfViewerControlIdentifier.TopPaneSearchButton]   = "Искать";

            // Left panel.
            options.ToolTips[SwfViewerControlIdentifier.LeftPaneDocumentMapButton]     = "Карта документа";
            options.ToolTips[SwfViewerControlIdentifier.LeftPanePagePreviewPaneButton] = "Предварительный просмотр страниц";
            options.ToolTips[SwfViewerControlIdentifier.LeftPaneAboutButton]           = "О приложении";
            options.ToolTips[SwfViewerControlIdentifier.LeftPaneCollapsePanelButton]   = "Свернуть панель";

            // Bottom panel.
            options.ToolTips[SwfViewerControlIdentifier.BottomPaneShowHideBottomPaneButton] = "Показать/Скрыть панель";
            //ExEnd

            doc.Save(MyDir + @"\Artifacts\SwfSaveOptions.ToolTips.swf", options);
        }
        public void UseCustomToolTips()
        {
            Document doc = new Document(MyDir + "Document.doc");

            //ExStart
            //ExFor:SwfSaveOptions
            //ExFor:SwfSaveOptions.ToolTipsFontName
            //ExFor:SwfSaveOptions.ToolTips
            //ExFor:SwfViewerControlIdentifier
            //ExSummary:Shows how to change the the tooltips used in the embedded document viewer.
            // We create an instance of SwfSaveOptions to specify our custom tooltips.
            SwfSaveOptions options = new SwfSaveOptions();

            // By default, all tooltips are in English. You can specify font used for each tooltip.
            // Note that font specified should contain proper glyphs normally used in tooltips.
            options.ToolTipsFontName = "Times New Roman";

            // The following code will set the tooltip used for each control. In our case we will change the tooltips from English
            // to Russian.
            options.ToolTips[SwfViewerControlIdentifier.TopPaneActualSizeButton] = "Оригинальный размер";
            options.ToolTips[SwfViewerControlIdentifier.TopPaneFitToHeightButton] = "По высоте страницы";
            options.ToolTips[SwfViewerControlIdentifier.TopPaneFitToWidthButton] = "По ширине страницы";
            options.ToolTips[SwfViewerControlIdentifier.TopPaneZoomOutButton] = "Увеличить";
            options.ToolTips[SwfViewerControlIdentifier.TopPaneZoomInButton] = "Уменшить";
            options.ToolTips[SwfViewerControlIdentifier.TopPaneSelectionModeButton] = "Режим выделения текста";
            options.ToolTips[SwfViewerControlIdentifier.TopPaneDragModeButton] = "Режим перетаскивания";
            options.ToolTips[SwfViewerControlIdentifier.TopPaneSinglePageScrollLayoutButton] = "Одностнаничный скролинг";
            options.ToolTips[SwfViewerControlIdentifier.TopPaneSinglePageLayoutButton] = "Одностраничный режим";
            options.ToolTips[SwfViewerControlIdentifier.TopPaneTwoPageScrollLayoutButton] = "Двустраничный скролинг";
            options.ToolTips[SwfViewerControlIdentifier.TopPaneTwoPageLayoutButton] = "Двустраничный режим";
            options.ToolTips[SwfViewerControlIdentifier.TopPaneFullScreenModeButton] = "Полноэкранный режим";
            options.ToolTips[SwfViewerControlIdentifier.TopPanePreviousPageButton] = "Предыдущая старница";
            options.ToolTips[SwfViewerControlIdentifier.TopPanePageField] = "Введите номер страницы";
            options.ToolTips[SwfViewerControlIdentifier.TopPaneNextPageButton] = "Следующая страница";
            options.ToolTips[SwfViewerControlIdentifier.TopPaneSearchField] = "Введите искомый текст";
            options.ToolTips[SwfViewerControlIdentifier.TopPaneSearchButton] = "Искать";
            
            // Left panel.
            options.ToolTips[SwfViewerControlIdentifier.LeftPaneDocumentMapButton] = "Карта документа";
            options.ToolTips[SwfViewerControlIdentifier.LeftPanePagePreviewPaneButton] = "Предварительный просмотр страниц";
            options.ToolTips[SwfViewerControlIdentifier.LeftPaneAboutButton] = "О приложении";
            options.ToolTips[SwfViewerControlIdentifier.LeftPaneCollapsePanelButton] = "Свернуть панель";
            
            // Bottom panel.
            options.ToolTips[SwfViewerControlIdentifier.BottomPaneShowHideBottomPaneButton] = "Показать/Скрыть панель";
            //ExEnd

            doc.Save(MyDir + @"\Artifacts\SwfSaveOptions.ToolTips.swf", options);
        }
        public void HideControls()
        {
            //ExStart
            //ExFor:SwfSaveOptions.TopPaneControlFlags
            //ExFor:SwfTopPaneControlFlags
            //ExFor:SwfSaveOptions.ShowSearch
            //ExSummary:Shows how to choose which controls to display in the embedded document viewer.
            Document doc = new Document(MyDir + "Document.doc");

            // Create an instance of SwfSaveOptions and set some buttons as hidden.
            SwfSaveOptions options = new SwfSaveOptions();

            // Hide all the buttons with the exception of the page control buttons. Similar flags can be used for the left control pane as well.
            options.TopPaneControlFlags = SwfTopPaneControlFlags.HideAll | SwfTopPaneControlFlags.ShowActualSize | SwfTopPaneControlFlags.ShowFitToWidth | SwfTopPaneControlFlags.ShowFitToHeight | SwfTopPaneControlFlags.ShowZoomIn | SwfTopPaneControlFlags.ShowZoomOut;

            // You can also choose to show or hide the main elements of the viewer. Hide the search control.
            options.ShowSearch = false;
            //ExEnd

            doc.Save(MyDir + @"\Artifacts\SwfSaveOptions.HideControls.swf", options);
        }
Ejemplo n.º 10
0
        public void HideControls()
        {
            //ExStart
            //ExFor:SwfSaveOptions.TopPaneControlFlags
            //ExFor:SwfTopPaneControlFlags
            //ExFor:SwfSaveOptions.ShowSearch
            //ExSummary:Shows how to choose which controls to display in the embedded document viewer.
            Aspose.Words.Document doc = new Aspose.Words.Document(MyDir + "Document.doc");

            // Create an instance of SwfSaveOptions and set some buttons as hidden.
            SwfSaveOptions options = new SwfSaveOptions();
            // Hide all the buttons with the exception of the page control buttons. Similar flags can be used for the left control pane as well.
            options.TopPaneControlFlags = SwfTopPaneControlFlags.HideAll | SwfTopPaneControlFlags.ShowActualSize |
                SwfTopPaneControlFlags.ShowFitToWidth | SwfTopPaneControlFlags.ShowFitToHeight |
                SwfTopPaneControlFlags.ShowZoomIn | SwfTopPaneControlFlags.ShowZoomOut;

            // You can also choose to show or hide the main elements of the viewer. Hide the search control.
            options.ShowSearch = false;
            //ExEnd

            doc.Save(MyDir + "SwfSaveOptions.HideControls Out.swf", options);
        }
Ejemplo n.º 11
0
        private static SaveOptions AddBookmarkSaveOptions(SaveFormat saveFormat)
        {
            PdfSaveOptions pdfSaveOptions = new PdfSaveOptions();
            XpsSaveOptions xpsSaveOptions = new XpsSaveOptions();
            SwfSaveOptions swfSaveOptions = new SwfSaveOptions();

            switch (saveFormat)
            {
            case SaveFormat.Pdf:

                //Add bookmarks to the document
                pdfSaveOptions.OutlineOptions.BookmarksOutlineLevels.Add("My Bookmark", 1);
                pdfSaveOptions.OutlineOptions.BookmarksOutlineLevels.Add("Nested Bookmark", 2);
                pdfSaveOptions.OutlineOptions.BookmarksOutlineLevels.Add("Bookmark_WithoutWhiteSpaces", 3);

                return(pdfSaveOptions);

            case SaveFormat.Xps:

                //Add bookmarks to the document
                xpsSaveOptions.OutlineOptions.BookmarksOutlineLevels.Add("My Bookmark", 1);
                xpsSaveOptions.OutlineOptions.BookmarksOutlineLevels.Add("Nested Bookmark", 2);
                xpsSaveOptions.OutlineOptions.BookmarksOutlineLevels.Add("Bookmark_WithoutWhiteSpaces", 3);

                return(xpsSaveOptions);

            case SaveFormat.Swf:

                //Add bookmarks to the document
                swfSaveOptions.OutlineOptions.BookmarksOutlineLevels.Add("My Bookmark", 1);
                swfSaveOptions.OutlineOptions.BookmarksOutlineLevels.Add("Nested Bookmark", 2);
                swfSaveOptions.OutlineOptions.BookmarksOutlineLevels.Add("Bookmark_WithoutWhiteSpaces", 3);

                return(swfSaveOptions);
            }

            return(null);
        }
        private static SaveOptions AddBookmarkSaveOptions(SaveFormat saveFormat)
        {
            PdfSaveOptions pdfSaveOptions = new PdfSaveOptions();
            XpsSaveOptions xpsSaveOptions = new XpsSaveOptions();
            SwfSaveOptions swfSaveOptions = new SwfSaveOptions();

            switch (saveFormat)
            {
                case SaveFormat.Pdf:

                    //Add bookmarks to the document
                    pdfSaveOptions.OutlineOptions.BookmarksOutlineLevels.Add("My Bookmark", 1);
                    pdfSaveOptions.OutlineOptions.BookmarksOutlineLevels.Add("Nested Bookmark", 2);
                    pdfSaveOptions.OutlineOptions.BookmarksOutlineLevels.Add("Bookmark_WithoutWhiteSpaces", 3);

                    return pdfSaveOptions;

                case SaveFormat.Xps:

                    //Add bookmarks to the document
                    xpsSaveOptions.OutlineOptions.BookmarksOutlineLevels.Add("My Bookmark", 1);
                    xpsSaveOptions.OutlineOptions.BookmarksOutlineLevels.Add("Nested Bookmark", 2);
                    xpsSaveOptions.OutlineOptions.BookmarksOutlineLevels.Add("Bookmark_WithoutWhiteSpaces", 3);

                    return xpsSaveOptions;

                case SaveFormat.Swf:

                    //Add bookmarks to the document
                    swfSaveOptions.OutlineOptions.BookmarksOutlineLevels.Add("My Bookmark", 1);
                    swfSaveOptions.OutlineOptions.BookmarksOutlineLevels.Add("Nested Bookmark", 2);
                    swfSaveOptions.OutlineOptions.BookmarksOutlineLevels.Add("Bookmark_WithoutWhiteSpaces", 3);

                    return swfSaveOptions;
            }

            return null;
        }