コード例 #1
0
        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();

            XamlFixedSaveOptions xamlFixedSaveOptions = new XamlFixedSaveOptions();

            xamlFixedSaveOptions.PageSavingCallback = new CustomPageFileNamePageSavingCallback();

            XpsSaveOptions xpsSaveOptions = new XpsSaveOptions();

            xpsSaveOptions.PageSavingCallback = new CustomPageFileNamePageSavingCallback();
        }
コード例 #2
0
        [Test] //ExSkip
        public void ResourceFolder()
        {
            // Open a document which contains resources
            Document doc = new Document(MyDir + "Rendering.docx");

            ResourceUriPrinter callback = new ResourceUriPrinter();

            XamlFixedSaveOptions options = new XamlFixedSaveOptions
            {
                SaveFormat             = SaveFormat.XamlFixed,
                ResourcesFolder        = ArtifactsDir + "XamlFixedResourceFolder",
                ResourcesFolderAlias   = ArtifactsDir + "XamlFixedFolderAlias",
                ResourceSavingCallback = callback
            };

            // A folder specified by ResourcesFolderAlias will contain the resources instead of ResourcesFolder
            // We must ensure the folder exists before the streams can put their resources into it
            Directory.CreateDirectory(options.ResourcesFolderAlias);

            doc.Save(ArtifactsDir + "XamlFixedSaveOptions.ResourceFolder.xaml", options);

            foreach (string resource in callback.Resources)
            {
                Console.WriteLine(resource);
            }
            TestResourceFolder(callback); //ExSkip
        }
コード例 #3
0
        [Test] //ExSkip
        public void ResourceFolder()
        {
            Document           doc      = new Document(MyDir + "Rendering.docx");
            ResourceUriPrinter callback = new ResourceUriPrinter();

            // Create a "XamlFixedSaveOptions" object, which we can pass to the document's "Save" method
            // to modify how we save the document to the XAML save format.
            XamlFixedSaveOptions options = new XamlFixedSaveOptions();

            Assert.AreEqual(SaveFormat.XamlFixed, options.SaveFormat);

            // Use the "ResourcesFolder" property to assign a folder in the local file system into which
            // Aspose.Words will save all the document's linked resources, such as images and fonts.
            options.ResourcesFolder = ArtifactsDir + "XamlFixedResourceFolder";

            // Use the "ResourcesFolderAlias" property to use this folder
            // when constructing image URIs instead of the resources folder's name.
            options.ResourcesFolderAlias = ArtifactsDir + "XamlFixedFolderAlias";

            options.ResourceSavingCallback = callback;

            // A folder specified by "ResourcesFolderAlias" will need to contain the resources instead of "ResourcesFolder".
            // We must ensure the folder exists before the callback's streams can put their resources into it.
            Directory.CreateDirectory(options.ResourcesFolderAlias);

            doc.Save(ArtifactsDir + "XamlFixedSaveOptions.ResourceFolder.xaml", options);

            foreach (string resource in callback.Resources)
            {
                Console.WriteLine(resource);
            }
            TestResourceFolder(callback); //ExSkip
        }
コード例 #4
0
        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();
        }