Exemple #1
0
        public static PageSetup Load()
        {
            pageSetup.PageFormat = PageFormats.Get(Properties.Settings.Default.Paper);
            pageSetup.IncludeMarginForPunchHoles = Properties.Settings.Default.IncludeMarginForPunchHoles;
            pageSetup.IncludeImage         = Properties.Settings.Default.IncludeImage;
            pageSetup.IncludeNumber        = Properties.Settings.Default.IncludeNumber;
            pageSetup.IncludeValueAndColor = Properties.Settings.Default.IncludeValueAndColor;
            pageSetup.FrameStyle           = Properties.Settings.Default.FrameStyle;
            pageSetup.ColorStyle           = Properties.Settings.Default.ColorStyle;
            pageSetup.FontSize             = Properties.Settings.Default.FontSize;
            pageSetup.IncludeBorder        = Properties.Settings.Default.IncludeBorder;
            pageSetup.IncludeTitle         = Properties.Settings.Default.IncludeTitle;
            pageSetup.Catalog                = Properties.Settings.Default.Catalog;
            pageSetup.AppendCatalog          = Properties.Settings.Default.AppendCatalog;
            pageSetup.IncludeSamplePagesOnly = Properties.Settings.Default.IncludeSamplePagesOnly;
            pageSetup.IncludePdfImages       = Properties.Settings.Default.IncludePdfImages;
            pageSetup.IncludePdfBookmarks    = Properties.Settings.Default.IncludePdfBookmarks;
            pageSetup.RealLifePageScale      = Properties.Settings.Default.RealLifePageScale;

            return(pageSetup);
        }
Exemple #2
0
        private void Initialize()
        {
            this.Text = App.GetName() + " · Print " + (printMode == PrintMode.ToScreen ? "Preview" : "Document");

            buttonOk.Text = (printMode == PrintMode.ToScreen ? "Preview" : "Print");

            groupBoxAlbumOptions.Enabled = (printMode == PrintMode.ToDocument);
            groupBoxPrinter.Enabled      = groupBoxAlbumOptions.Enabled;

            string printerName = App.GetSetting("PDFPrinter");

            textPrinter.Text = printerName;

            bool printerExists = PrinterSettings.InstalledPrinters.Cast <string>().Any(name => printerName.ToUpper().Trim() == name.ToUpper().Trim());

            labelPrinter.Visible = !printerExists;

            if (printMode == PrintMode.ToDocument)
            {
                buttonOk.Enabled = printerExists;
            }
            else
            {
                buttonOk.Enabled = true;
            }

            PageSetup pageSetup = PageSetup.Get();

            // Format

            comboBoxFormat.Items.AddRange(PageFormats.Get().Select(format => format.FormatName).ToArray());
            comboBoxFormat.Text = pageSetup.PageFormat.FormatName;
            checkBoxIncludeMarginForPunchHoles.Checked = pageSetup.IncludeMarginForPunchHoles;

            // Stamps Options

            checkBoxIncludeImage.Checked  = pageSetup.IncludeImage;
            checkBoxIncludeNumber.Checked = pageSetup.IncludeNumber;
            checkBoxIncludeValue.Checked  = pageSetup.IncludeValueAndColor;

            // Frame Options

            switch (pageSetup.FrameStyle)
            {
            case FrameStyle.ThinSolid:
                radioButtonThinSolid.Checked = true;
                break;

            case FrameStyle.Thick:
                radioButtonThick.Checked = true;
                break;

            case FrameStyle.ThinDotted:
                radioButtonThinDotted.Checked = true;
                break;
            }

            // Color Options

            switch (pageSetup.ColorStyle)
            {
            case ColorStyle.Greyscale:
                radioButtonGreyscale.Checked = true;
                break;

            case ColorStyle.Color:
                radioButtonColor.Checked = true;
                break;
            }

            // Font Options

            switch (pageSetup.FontSize)
            {
            case FontSize.Small:
                radioButtonSmall.Checked = true;
                break;

            case FontSize.Medium:
                radioButtonMedium.Checked = true;
                break;

            case FontSize.Large:
                radioButtonLarge.Checked = true;
                break;
            }

            // Page Options

            checkBoxIncludeBorder.Checked = pageSetup.IncludeBorder;
            checkBoxIncludeTitle.Checked  = pageSetup.IncludeTitle;

            // Catalog Options

            comboBoxCatalog.Items.AddRange(Catalogs.Get());
            comboBoxCatalog.Text          = Catalogs.Convert(pageSetup.Catalog);
            checkBoxAppendCatalog.Checked = pageSetup.AppendCatalog;

            // Album Options

            checkBoxIncludeSamplePagesOnly.Checked = pageSetup.IncludeSamplePagesOnly;
            checkBoxIncludePdfImage.Checked        = pageSetup.IncludePdfImages;
            checkBoxIncludePdfBookmarks.Checked    = pageSetup.IncludePdfBookmarks;

            // Real life page scale

            numericRealLifePageScale.Value = pageSetup.RealLifePageScale;

            if (this.excludeNumber)
            {
                checkBoxIncludeNumber.Checked = false;
                checkBoxIncludeNumber.Enabled = false;
            }

            if (this.excludeValueAndColor)
            {
                checkBoxIncludeValue.Checked = false;
                checkBoxIncludeValue.Enabled = false;
            }
        }