Пример #1
0
        /// <summary>
        /// Constructor initializes fields
        /// </summary>
        public Presentation()
        {
            Random random = new Random();

            this.URI    = $"wikipedia.org/wiki/presentations/{this.uris[random.Next(this.uris.Count)]}";
            this.Format = (PresentationFormat)random.Next(Enum.GetNames(typeof(PresentationFormat)).Length);
        }
Пример #2
0
        public static void Run()
        {
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.FullName);

            // ExStart:RenderProjectToPredefinedPageSizes
            // Source File to Render
            string fileName = "Project2.mpp";

            // Read the Project
            Project project1 = new Project(dataDir + fileName);

            // Select a Presentation format
            PresentationFormat format = PresentationFormat.GanttChart;

            // Render the project to all Pre-Defined page sizes
            foreach (PageSize pageSize in (PageSize[])Enum.GetValues(typeof(PageSize)))
            {
                PdfSaveOptions options = new PdfSaveOptions();
                options.PresentationFormat = format;
                options.FitContent         = true;
                options.PageSize           = pageSize;
                string resultFile = "result_PredefinedPageSizes_" + format.ToString() + "_" + pageSize.ToString() + "_out.pdf";
                project1.Save(dataDir + resultFile, options);
            }
            // ExEnd:RenderProjectToPredefinedPageSizes
        }
        private SaveOptions GetSaveOptions(PresentationFormat format)
        {
            var options = new PdfSaveOptions
            {
                PresentationFormat = format,
                PageSize           = PageSize.A3,
                StartDate          = new DateTime(2010, 7, 1),
                EndDate            = new DateTime(2010, 9, 1),

                // set a task filter to skip task 'Task5' and 'Task3'
                TasksFilter = new CustomTasksFilter()
            };

            return(options);
        }
Пример #4
0
        public static void Run()
        {
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.FullName);

            // ExStart:RenderDifferentPresentationFormatsToXAML
            Project project = new Project(dataDir + "Project2.mpp");

            PresentationFormat presentationFormat = PresentationFormat.GanttChart;
            string             resultFile         = "RenderDifferentPresentationFormatsToXAML_" + presentationFormat + "_out.xaml";
            SaveOptions        options            = new XamlOptions();

            options.PresentationFormat = presentationFormat;

            project.Save(dataDir + resultFile, options);
            // ExEnd:RenderDifferentPresentationFormatsToXAML
        }
        public static void Run()
        {
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.FullName);

            // ExStart:RenderResourceSheetView
            // Create project instance
            Project project1 = new Project(dataDir + "ResourceSheetView.mpp");

            // Set the Presentation Format to Resource Sheet
            PresentationFormat format = PresentationFormat.ResourceSheet;

            // Define rendering options
            PdfSaveOptions options = new PdfSaveOptions();

            options.PresentationFormat = format;
            project1.Save(dataDir + "ResourceSheetView_out.pdf", options);
            // ExEnd:RenderResourceSheetView
        }
        public void RenderProjectToPredefinedPageSizes()
        {
            // ExStart:RenderProjectToPredefinedPageSizes
            // ExFor: SaveOptions.PageSize
            // ExSummary: Shows how to set page size (can be one of the values of the <see cref="P:Aspose.Tasks.Visualization.TiffCompression" /> enumeration).
            var project = new Project(DataDir + "Project2.mpp");

            const PresentationFormat Format = PresentationFormat.GanttChart;

            // Render the project to all Pre-Defined page sizes
            foreach (var pageSize in (PageSize[])Enum.GetValues(typeof(PageSize)))
            {
                var options = new PdfSaveOptions
                {
                    PresentationFormat = Format,
                    FitContent         = true,
                    PageSize           = pageSize
                };
                project.Save(OutDir + "PredefinedPageSizes_" + Format + "_" + pageSize + "_out.pdf", options);
            }

            // ExEnd:RenderProjectToPredefinedPageSizes
        }
Пример #7
0
 /// <summary>
 /// Сopy constructor
 /// </summary>
 /// <param name="URI">URI</param>
 /// <param name="Format">Format</param>
 public Presentation(string URI, PresentationFormat Format)
 {
     this.URI    = URI;
     this.Format = Format;
 }