Exemplo n.º 1
0
        public void TestRunAs(Parameter.FileTypes type, Parameter.Orientations orient, bool rename_test)
        {
            var setting = CreateSetting();

            setting.FileType    = type;
            setting.Resolution  = Parameter.Resolutions.Resolution72;
            setting.Orientation = orient;
            var suffix = string.Format("-{0}", orient);

            AssertRun(setting, suffix);

            if (rename_test)
            {
                setting.ExistedFile = Parameter.ExistedFiles.Rename;
                AssertRun(setting, suffix);
            }
        }
Exemplo n.º 2
0
        public void TestRunAsPdf(Parameter.PdfVersions pdfver, Parameter.Orientations orient, bool webopt, bool embed)
        {
            var setting = CreateSetting();

            setting.PDFVersion  = pdfver;
            setting.Orientation = orient;
            setting.WebOptimize = webopt;
            setting.EmbedFont   = embed;

            var suffix = string.Format("-{0}-{1}", pdfver, orient);

            if (webopt)
            {
                suffix += "-webopt";
            }
            if (!embed)
            {
                suffix += "-noembed";
            }
            AssertRun(setting, suffix);
        }
Exemplo n.º 3
0
        /* ----------------------------------------------------------------- */
        ///
        /// LoadIndices
        ///
        /// <summary>
        /// CubePdf.Settings.Document オブジェクトから CubePDF メイン画面で
        /// 表示されているコンボボックスのインデックス関連の情報を抽出して、
        /// 対応する変数にロードします。
        /// </summary>
        ///
        /* ----------------------------------------------------------------- */
        private void LoadIndices(CubePdf.Settings.Document document)
        {
            var filetype = document.Root.Find(_RegFileType);
            if (filetype != null)
            {
                foreach (int item in Enum.GetValues(typeof(Parameter.FileTypes)))
                {
                    if (item == (int)filetype.Value)
                    {
                        _type = (Parameter.FileTypes)filetype.Value;
                        break;
                    }
                }
            }

            var pdfversion = document.Root.Find(_RegPdfVersion);
            if (pdfversion != null)
            {
                foreach (int item in Enum.GetValues(typeof(Parameter.PdfVersions)))
                {
                    if (item == (int)pdfversion.Value)
                    {
                        _pdfver = (Parameter.PdfVersions)pdfversion.Value;
                        break;
                    }
                }
            }

            var resolution = document.Root.Find(_RegResolution);
            if (resolution != null)
            {
                foreach (int item in Enum.GetValues(typeof(Parameter.Resolutions)))
                {
                    if (item == (int)resolution.Value)
                    {
                        _resolution = (Parameter.Resolutions)resolution.Value;
                        break;
                    }
                }
            }

            var orientation = document.Root.Find(_RegOrientation);
            if (orientation != null)
            {
                foreach (int item in Enum.GetValues(typeof(Parameter.Orientations)))
                {
                    if (item == (int)orientation.Value)
                    {
                        _orientation = (Parameter.Orientations)orientation.Value;
                        break;
                    }
                }
            }

            var exist = document.Root.Find(_RegExistedFile);
            if (exist != null)
            {
                foreach (int item in Enum.GetValues(typeof(Parameter.ExistedFiles)))
                {
                    if (item == (int)exist.Value)
                    {
                        _exist = (Parameter.ExistedFiles)exist.Value;
                        break;
                    }
                }
            }

            var postproc = document.Root.Find(_RegPostProcess);
            if (postproc != null)
            {
                foreach (int item in Enum.GetValues(typeof(Parameter.PostProcesses)))
                {
                    if (item == (int)postproc.Value)
                    {
                        _postproc = (Parameter.PostProcesses)postproc.Value;
                        break;
                    }
                }
            }

            var downsampling = document.Root.Find(_RegDownSampling);
            if (downsampling != null)
            {
                foreach (int item in Enum.GetValues(typeof(Parameter.DownSamplings)))
                {
                    if (item == (int)downsampling.Value)
                    {
                        _downsampling = (Parameter.DownSamplings)downsampling.Value;
                        break;
                    }
                }
            }

            var filter = document.Root.Find(_RegImageFilter);
            if (filter != null)
            {
                foreach (int item in Enum.GetValues(typeof(Parameter.ImageFilters)))
                {
                    if (item == (int)filter.Value)
                    {
                        _filter = (Parameter.ImageFilters)filter.Value;
                        break;
                    }
                }
            }

            var save = document.Root.Find(_RegSaveSetting);
            if (save != null)
            {
                foreach (int item in Enum.GetValues(typeof(Parameter.SaveSettings)))
                {
                    if (item == (int)save.Value)
                    {
                        _save = (Parameter.SaveSettings)save.Value;
                        break;
                    }
                }
            }
        }