From 033df8ccb35f302a421abe57bc41ae2f29b8b3dc Mon Sep 17 00:00:00 2001 From: Kathy Date: Mon, 25 Oct 2021 14:19:37 +0000 Subject: [PATCH] C2021-047: Allow for setting of Merged Pdf Landscape Page Number Location --- .../frmVersionsProperties.Designer.cs | 154 +++++++++++++++++- .../frmVersionsProperties.cs | 35 +++- .../frmVersionsProperties.resx | 32 ++-- .../Config/DocVersionConfig.cs | 86 ++++++++++ PROMS/Volian.Print.Library/MergedPdf.cs | 20 ++- 5 files changed, 293 insertions(+), 34 deletions(-) diff --git a/PROMS/VEPROMS User Interface/frmVersionsProperties.Designer.cs b/PROMS/VEPROMS User Interface/frmVersionsProperties.Designer.cs index ec35761e..5937d022 100644 --- a/PROMS/VEPROMS User Interface/frmVersionsProperties.Designer.cs +++ b/PROMS/VEPROMS User Interface/frmVersionsProperties.Designer.cs @@ -210,6 +210,13 @@ namespace VEPROMS this.ROPrefixBindingSource = new System.Windows.Forms.BindingSource(this.components); this.PDFLocationBrowserDialog = new System.Windows.Forms.FolderBrowserDialog(); this.formatInfoListBindingSource = new System.Windows.Forms.BindingSource(this.components); + this.gpxMOSLandLocation = new DevComponents.DotNetBar.Controls.GroupPanel(); + this.ppCmbxMOSLandcornerLoc = new DevComponents.DotNetBar.Controls.ComboBoxEx(); + this.tbxMOSLandyloc = new DevComponents.DotNetBar.Controls.TextBoxX(); + this.tbxMOSLandxloc = new DevComponents.DotNetBar.Controls.TextBoxX(); + this.lblMOSLandcorner = new System.Windows.Forms.Label(); + this.lblMOSLandyloc = new System.Windows.Forms.Label(); + this.lblMOSLandxloc = new System.Windows.Forms.Label(); ((System.ComponentModel.ISupportInitialize)(this.docVersionConfigBindingSource)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.imageCodecInfoBindingSource)).BeginInit(); this.ppGpbxUserSpecCB.SuspendLayout(); @@ -240,6 +247,7 @@ namespace VEPROMS this.panVerBtns.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.ROPrefixBindingSource)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.formatInfoListBindingSource)).BeginInit(); + this.gpxMOSLandLocation.SuspendLayout(); this.SuspendLayout(); // // ppBtnCancel @@ -1094,9 +1102,9 @@ namespace VEPROMS this.tcVersions.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.tcVersions.BackColor = System.Drawing.Color.Transparent; this.tcVersions.CanReorderTabs = true; + this.tcVersions.Controls.Add(this.tabControlPanel2); this.tcVersions.Controls.Add(this.tcpGeneral); this.tcVersions.Controls.Add(this.tcpRefereceObjects); - this.tcVersions.Controls.Add(this.tabControlPanel2); this.tcVersions.Controls.Add(this.tabControlPanel1); this.tcVersions.Controls.Add(this.tcpApplicability); this.tcVersions.Controls.Add(this.tabControlPanel5); @@ -1291,6 +1299,7 @@ namespace VEPROMS // // tabControlPanel2 // + this.tabControlPanel2.Controls.Add(this.gpxMOSLandLocation); this.tabControlPanel2.Controls.Add(this.ppChbxMOSview); this.tabControlPanel2.Controls.Add(this.gpxMOSLocation); this.tabControlPanel2.Controls.Add(this.gpxMOSfont); @@ -1342,7 +1351,7 @@ namespace VEPROMS this.gpxMOSLocation.Controls.Add(this.lblMOSyloc); this.gpxMOSLocation.Controls.Add(this.lblMOSxloc); this.gpxMOSLocation.DisabledBackColor = System.Drawing.Color.Empty; - this.gpxMOSLocation.Location = new System.Drawing.Point(280, 100); + this.gpxMOSLocation.Location = new System.Drawing.Point(283, 52); this.gpxMOSLocation.Margin = new System.Windows.Forms.Padding(2); this.gpxMOSLocation.Name = "gpxMOSLocation"; this.gpxMOSLocation.Size = new System.Drawing.Size(209, 98); @@ -1375,7 +1384,7 @@ namespace VEPROMS // this.gpxMOSLocation.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; this.gpxMOSLocation.TabIndex = 5; - this.gpxMOSLocation.Text = "Location"; + this.gpxMOSLocation.Text = "Portait Location"; // // ppCmbxMOScornerLoc // @@ -1645,7 +1654,7 @@ namespace VEPROMS this.ppChbxEnhancedAllowMods.Location = new System.Drawing.Point(135, 206); this.ppChbxEnhancedAllowMods.Margin = new System.Windows.Forms.Padding(2); this.ppChbxEnhancedAllowMods.Name = "ppChbxEnhancedAllowMods"; - this.ppChbxEnhancedAllowMods.Size = new System.Drawing.Size(248, 17); + this.ppChbxEnhancedAllowMods.Size = new System.Drawing.Size(264, 17); this.ppChbxEnhancedAllowMods.TabIndex = 14; this.ppChbxEnhancedAllowMods.Text = "Allow Modifications to Procedure Number and Title"; this.ppChbxEnhancedAllowMods.UseVisualStyleBackColor = false; @@ -2497,7 +2506,7 @@ namespace VEPROMS this.ppChbxAddBlankPgs.Location = new System.Drawing.Point(8, 266); this.ppChbxAddBlankPgs.Margin = new System.Windows.Forms.Padding(2); this.ppChbxAddBlankPgs.Name = "ppChbxAddBlankPgs"; - this.ppChbxAddBlankPgs.Size = new System.Drawing.Size(383, 17); + this.ppChbxAddBlankPgs.Size = new System.Drawing.Size(249, 17); this.ppChbxAddBlankPgs.TabIndex = 66; this.ppChbxAddBlankPgs.Text = "Add Blank Pages When Using Duplex Foldouts"; this.ppChbxAddBlankPgs.UseVisualStyleBackColor = false; @@ -2659,6 +2668,128 @@ namespace VEPROMS // this.formatInfoListBindingSource.DataSource = typeof(VEPROMS.CSLA.Library.FormatInfo); // + // gpxMOSLandLocation + // + this.gpxMOSLandLocation.BackColor = System.Drawing.Color.Transparent; + this.gpxMOSLandLocation.CanvasColor = System.Drawing.SystemColors.Control; + this.gpxMOSLandLocation.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007; + this.gpxMOSLandLocation.Controls.Add(this.ppCmbxMOSLandcornerLoc); + this.gpxMOSLandLocation.Controls.Add(this.tbxMOSLandyloc); + this.gpxMOSLandLocation.Controls.Add(this.tbxMOSLandxloc); + this.gpxMOSLandLocation.Controls.Add(this.lblMOSLandcorner); + this.gpxMOSLandLocation.Controls.Add(this.lblMOSLandyloc); + this.gpxMOSLandLocation.Controls.Add(this.lblMOSLandxloc); + this.gpxMOSLandLocation.DisabledBackColor = System.Drawing.Color.Empty; + this.gpxMOSLandLocation.Location = new System.Drawing.Point(284, 164); + this.gpxMOSLandLocation.Margin = new System.Windows.Forms.Padding(2); + this.gpxMOSLandLocation.Name = "gpxMOSLandLocation"; + this.gpxMOSLandLocation.Size = new System.Drawing.Size(209, 98); + // + // + // + this.gpxMOSLandLocation.Style.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2; + this.gpxMOSLandLocation.Style.BackColorGradientAngle = 90; + this.gpxMOSLandLocation.Style.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground; + this.gpxMOSLandLocation.Style.BorderBottom = DevComponents.DotNetBar.eStyleBorderType.Solid; + this.gpxMOSLandLocation.Style.BorderBottomWidth = 1; + this.gpxMOSLandLocation.Style.BorderColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; + this.gpxMOSLandLocation.Style.BorderLeft = DevComponents.DotNetBar.eStyleBorderType.Solid; + this.gpxMOSLandLocation.Style.BorderLeftWidth = 1; + this.gpxMOSLandLocation.Style.BorderRight = DevComponents.DotNetBar.eStyleBorderType.Solid; + this.gpxMOSLandLocation.Style.BorderRightWidth = 1; + this.gpxMOSLandLocation.Style.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid; + this.gpxMOSLandLocation.Style.BorderTopWidth = 1; + this.gpxMOSLandLocation.Style.CornerDiameter = 4; + this.gpxMOSLandLocation.Style.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; + this.gpxMOSLandLocation.Style.TextAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Center; + this.gpxMOSLandLocation.Style.TextColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText; + this.gpxMOSLandLocation.Style.TextLineAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Near; + // + // + // + this.gpxMOSLandLocation.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.gpxMOSLandLocation.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.gpxMOSLandLocation.TabIndex = 7; + this.gpxMOSLandLocation.Text = "Landscape Location"; + // + // ppCmbxMOSLandcornerLoc + // + this.ppCmbxMOSLandcornerLoc.DisplayMember = "Text"; + this.ppCmbxMOSLandcornerLoc.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; + this.ppCmbxMOSLandcornerLoc.FormattingEnabled = true; + this.ppCmbxMOSLandcornerLoc.ItemHeight = 16; + this.ppCmbxMOSLandcornerLoc.Location = new System.Drawing.Point(59, 53); + this.ppCmbxMOSLandcornerLoc.Margin = new System.Windows.Forms.Padding(2); + this.ppCmbxMOSLandcornerLoc.Name = "ppCmbxMOSLandcornerLoc"; + this.ppCmbxMOSLandcornerLoc.Size = new System.Drawing.Size(144, 22); + this.ppCmbxMOSLandcornerLoc.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ppCmbxMOSLandcornerLoc.TabIndex = 9; + this.ppCmbxMOSLandcornerLoc.WatermarkText = "corner location"; + // + // tbxMOSLandyloc + // + // + // + // + this.tbxMOSLandyloc.Border.Class = "TextBoxBorder"; + this.tbxMOSLandyloc.Border.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.tbxMOSLandyloc.Location = new System.Drawing.Point(62, 30); + this.tbxMOSLandyloc.Margin = new System.Windows.Forms.Padding(2); + this.tbxMOSLandyloc.Name = "tbxMOSLandyloc"; + this.tbxMOSLandyloc.PreventEnterBeep = true; + this.tbxMOSLandyloc.Size = new System.Drawing.Size(75, 20); + this.tbxMOSLandyloc.TabIndex = 8; + // + // tbxMOSLandxloc + // + // + // + // + this.tbxMOSLandxloc.Border.Class = "TextBoxBorder"; + this.tbxMOSLandxloc.Border.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.tbxMOSLandxloc.Location = new System.Drawing.Point(62, 10); + this.tbxMOSLandxloc.Margin = new System.Windows.Forms.Padding(2); + this.tbxMOSLandxloc.Name = "tbxMOSLandxloc"; + this.tbxMOSLandxloc.PreventEnterBeep = true; + this.tbxMOSLandxloc.Size = new System.Drawing.Size(75, 20); + this.tbxMOSLandxloc.TabIndex = 7; + // + // lblMOSLandcorner + // + this.lblMOSLandcorner.AutoSize = true; + this.lblMOSLandcorner.BackColor = System.Drawing.Color.Transparent; + this.lblMOSLandcorner.Location = new System.Drawing.Point(14, 54); + this.lblMOSLandcorner.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + this.lblMOSLandcorner.Name = "lblMOSLandcorner"; + this.lblMOSLandcorner.Size = new System.Drawing.Size(41, 13); + this.lblMOSLandcorner.TabIndex = 6; + this.lblMOSLandcorner.Text = "Corner:"; + // + // lblMOSLandyloc + // + this.lblMOSLandyloc.AutoSize = true; + this.lblMOSLandyloc.BackColor = System.Drawing.Color.Transparent; + this.lblMOSLandyloc.Location = new System.Drawing.Point(14, 32); + this.lblMOSLandyloc.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + this.lblMOSLandyloc.Name = "lblMOSLandyloc"; + this.lblMOSLandyloc.Size = new System.Drawing.Size(34, 13); + this.lblMOSLandyloc.TabIndex = 5; + this.lblMOSLandyloc.Text = "Y (in):"; + // + // lblMOSLandxloc + // + this.lblMOSLandxloc.AutoSize = true; + this.lblMOSLandxloc.BackColor = System.Drawing.Color.Transparent; + this.lblMOSLandxloc.Location = new System.Drawing.Point(14, 10); + this.lblMOSLandxloc.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + this.lblMOSLandxloc.Name = "lblMOSLandxloc"; + this.lblMOSLandxloc.Size = new System.Drawing.Size(34, 13); + this.lblMOSLandxloc.TabIndex = 4; + this.lblMOSLandxloc.Text = "X (in):"; + // // frmVersionsProperties // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -2666,7 +2797,7 @@ namespace VEPROMS this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; this.CancelButton = this.ppBtnCancel; this.CaptionFont = new System.Drawing.Font("Microsoft Sans Serif", 10.2F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.ClientSize = new System.Drawing.Size(810, 369); + this.ClientSize = new System.Drawing.Size(806, 365); this.ControlBox = false; this.Controls.Add(this.panVerBtns); this.Controls.Add(this.tcVersions); @@ -2728,6 +2859,8 @@ namespace VEPROMS this.panVerBtns.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.ROPrefixBindingSource)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.formatInfoListBindingSource)).EndInit(); + this.gpxMOSLandLocation.ResumeLayout(false); + this.gpxMOSLandLocation.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); @@ -2918,5 +3051,12 @@ namespace VEPROMS private DevComponents.DotNetBar.Controls.CheckBoxX ppChbxMOSview; private System.Windows.Forms.Button ppBtnRoToSql; private System.Windows.Forms.CheckBox ppChbxEnhancedAllowMods; - } + private DevComponents.DotNetBar.Controls.GroupPanel gpxMOSLandLocation; + private DevComponents.DotNetBar.Controls.ComboBoxEx ppCmbxMOSLandcornerLoc; + private DevComponents.DotNetBar.Controls.TextBoxX tbxMOSLandyloc; + private DevComponents.DotNetBar.Controls.TextBoxX tbxMOSLandxloc; + private System.Windows.Forms.Label lblMOSLandcorner; + private System.Windows.Forms.Label lblMOSLandyloc; + private System.Windows.Forms.Label lblMOSLandxloc; + } } diff --git a/PROMS/VEPROMS User Interface/frmVersionsProperties.cs b/PROMS/VEPROMS User Interface/frmVersionsProperties.cs index 0a16b657..4de193d2 100644 --- a/PROMS/VEPROMS User Interface/frmVersionsProperties.cs +++ b/PROMS/VEPROMS User Interface/frmVersionsProperties.cs @@ -245,6 +245,10 @@ namespace VEPROMS _DocVersionConfig.Print_MergedPdfsPageNumLocX = float.Parse(tbxMOSxloc.Text); _DocVersionConfig.Print_MergedPdfsPageNumLocY = float.Parse(tbxMOSyloc.Text); _DocVersionConfig.Print_MergedPdfsPageNumCorner = (MergedPdfsPageNumCorner)ppCmbxMOScornerLoc.SelectedIndex; + // C2021-047: Allow for setting of Merged Pdf Landscape Page Number Location + _DocVersionConfig.Print_MergedPdfsLandPageNumLocX = float.Parse(tbxMOSLandxloc.Text); + _DocVersionConfig.Print_MergedPdfsLandPageNumLocY = float.Parse(tbxMOSLandyloc.Text); + _DocVersionConfig.Print_MergedPdfsLandPageNumCorner = (MergedPdfsPageNumCorner)ppCmbxMOSLandcornerLoc.SelectedIndex; _DocVersionConfig.Print_MergedPdfsViewAfter = ppChbxMOSview.Checked; //docVersionConfigBindingSource.EndEdit(); @@ -452,6 +456,12 @@ namespace VEPROMS ppCmbxMOScornerLoc.ValueMember = "EValue"; ppCmbxMOScornerLoc.SelectedIndex = -1; + // C2021-047: Allow for setting of Merged Pdf Landscape Page Number Location + ppCmbxMOSLandcornerLoc.DataSource = EnumDetail.Details(); + ppCmbxMOSLandcornerLoc.DisplayMember = "Description"; + ppCmbxMOSLandcornerLoc.ValueMember = "EValue"; + ppCmbxMOSLandcornerLoc.SelectedIndex = -1; + // check active format to see if the unit number text box on the format tab is visible. if (_DocVersionConfig.MyDocVersion.MyDocVersionInfo.ActiveFormat.PlantFormat.FormatData.PrintData.UnitNumber) { @@ -529,8 +539,16 @@ namespace VEPROMS btnUnlinkDocVersion.Visible = false; InitEnhanced(); - // set the merge pdf settings: - ppCmbxMOSformat.SelectedIndex = (int)_DocVersionConfig.Print_MergedPdfsPageOf; + // set the merge pdf settings: (moved to own method for C2021-047) + InitMergePdfSettings(); + + _Initializing = false; + } + + private void InitMergePdfSettings() + { + // Page Settings + ppCmbxMOSformat.SelectedIndex = (int)_DocVersionConfig.Print_MergedPdfsPageOf; if (_DocVersionConfig.Print_MergedPdfsPageOf == MergedPdfsPageOf.Other) { tbxMOSother.Text = _DocVersionConfig.Print_MergedPdfsPageNumFormatOther; @@ -540,9 +558,6 @@ namespace VEPROMS tbxMOSother.Enabled = false; tbxMOSother.Text = _DocVersionConfig.Print_MergedPdfsPageNumFormatOther; tbxMOSfontSz.Text = _DocVersionConfig.Print_MergedPdfsPageNumFontSize; - tbxMOSxloc.Text = _DocVersionConfig.Print_MergedPdfsPageNumLocX.ToString(); - tbxMOSyloc.Text = _DocVersionConfig.Print_MergedPdfsPageNumLocY.ToString(); - ppCmbxMOScornerLoc.SelectedIndex = (int)_DocVersionConfig.Print_MergedPdfsPageNumCorner; ppCmbxMOSfontName.DataSource = FontFamily.Families; ppCmbxMOSfontName.DisplayMember = "Name"; if (_DocVersionConfig.Print_MergedPdfsPageNumFont == null || _DocVersionConfig.Print_MergedPdfsPageNumFont == "") @@ -551,7 +566,15 @@ namespace VEPROMS ppCmbxMOSfontName.SelectedValue = _DocVersionConfig.Print_MergedPdfsPageNumFont; ppChbxMOSview.Checked = _DocVersionConfig.Print_MergedPdfsViewAfter; - _Initializing = false; + // Portrait Specific Settings + tbxMOSxloc.Text = _DocVersionConfig.Print_MergedPdfsPageNumLocX.ToString(); + tbxMOSyloc.Text = _DocVersionConfig.Print_MergedPdfsPageNumLocY.ToString(); + ppCmbxMOScornerLoc.SelectedIndex = (int)_DocVersionConfig.Print_MergedPdfsPageNumCorner; + + // Landscape Settings for C2021-047: Allow for setting of Merged Pdf Landscape Page Number Location + tbxMOSLandxloc.Text = _DocVersionConfig.Print_MergedPdfsLandPageNumLocX.ToString(); + tbxMOSLandyloc.Text = _DocVersionConfig.Print_MergedPdfsLandPageNumLocY.ToString(); + ppCmbxMOSLandcornerLoc.SelectedIndex = (int)_DocVersionConfig.Print_MergedPdfsLandPageNumCorner; } private void InitEnhanced() { diff --git a/PROMS/VEPROMS User Interface/frmVersionsProperties.resx b/PROMS/VEPROMS User Interface/frmVersionsProperties.resx index c319fae5..e37237c8 100644 --- a/PROMS/VEPROMS User Interface/frmVersionsProperties.resx +++ b/PROMS/VEPROMS User Interface/frmVersionsProperties.resx @@ -112,15 +112,15 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + 643, 17 - + 415, 17 @@ -153,10 +153,10 @@ Check "Show Default Settings" to display the "default" Change Bar Custom Message Check "Show Default Settings" to display the "default" Change Bar Custom Message (below the Line One selection box). - + 789, 65 - + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6 @@ -186,7 +186,7 @@ Check "Show Default Settings" to display the "default" duplexing setting (below - Type in your own text to be placed next to the change bars. - + 17, 113 @@ -204,31 +204,31 @@ Check "Show Default Settings" to display the "default" duplexing setting (below XGtms0VvnMN33d/0BT2uV/xhsykSbLz4v4D8ATko6xzt+1ySAAAAAElFTkSuQmCC - + 17, 65 - + 817, 17 - + 118, 17 - + 17, 17 - + 181, 113 - + 238, 17 - + 213, 65 - + 495, 65 - + 118 \ No newline at end of file diff --git a/PROMS/VEPROMS.CSLA.Library/Config/DocVersionConfig.cs b/PROMS/VEPROMS.CSLA.Library/Config/DocVersionConfig.cs index 3fb5da71..0a01be7a 100644 --- a/PROMS/VEPROMS.CSLA.Library/Config/DocVersionConfig.cs +++ b/PROMS/VEPROMS.CSLA.Library/Config/DocVersionConfig.cs @@ -1353,6 +1353,92 @@ namespace VEPROMS.CSLA.Library } } } + // C2021-047: Allow for setting of Merged Pdf Landscape Page Number Location (X, Y & corner) + [Category("Print Settings")] + [DisplayName("MergedPdfsLandPageNumLocX")] + [RefreshProperties(RefreshProperties.All)] + [Description("Merged Pdfs Landscape Page Num Loc X")] + public float? Print_MergedPdfsLandPageNumLocX + { + get + { + string s = _Xp["PrintSettings", "MergedPdfsLandPageNumLocX"]; + if (s == string.Empty) return Print_MergedPdfsPageNumLocX; + float test = 0; + try + { + test = float.Parse(s); + } + catch (Exception ex) + { + return 0.5f; + } + return float.Parse(s); + } + set + { + string s = _Xp["PrintSettings", "MergedPdfsLandPageNumLocX"]; + float orig = (s == string.Empty) ? (float) Print_MergedPdfsPageNumLocX : float.Parse(s); + if (orig == value) return; + _Xp["PrintSettings", "MergedPdfsLandPageNumLocX"] = value.ToString(); + OnPropertyChanged("MergedPdfsLandPageNumLocX"); + } + } + [Category("Print Settings")] + [DisplayName("MergedPdfsLandPageNumLocY")] + [RefreshProperties(RefreshProperties.All)] + [Description("Merged Pdfs Landscape Page Num Loc Y")] + public float? Print_MergedPdfsLandPageNumLocY + { + get + { + string s = _Xp["PrintSettings", "MergedPdfsLandPageNumLocY"]; + if (s == string.Empty) return Print_MergedPdfsPageNumLocY; + float test = 0; + try + { + test = float.Parse(s); + } + catch (Exception ex) + { + return 0.5f; + } + return float.Parse(s); + } + set + { + string s = _Xp["PrintSettings", "MergedPdfsLandPageNumLocY"]; + float orig = (s == string.Empty) ? (float)Print_MergedPdfsPageNumLocY : float.Parse(s); + if (orig == value) return; + _Xp["PrintSettings", "MergedPdfsLandPageNumLocY"] = value.ToString(); + OnPropertyChanged("MergedPdfsLandPageNumLocY"); + } + } + [Category("Print Settings")] + [DisplayName("MergedPdfsLandPageNumCorner")] + [RefreshProperties(RefreshProperties.All)] + [Description("Merged Pdf Landscape Page Number Corner")] + public MergedPdfsPageNumCorner Print_MergedPdfsLandPageNumCorner + { + get + { + string s = _Xp["PrintSettings", "MergedPdfsLandPageNumCorner"]; + if (s == string.Empty) + return Print_MergedPdfsPageNumCorner; + return (MergedPdfsPageNumCorner)int.Parse(s); + } + set + { + if (_SaveChangesToDocVersionConfig) + { + string s = _Xp["PrintSettings", "MergedPdfsLandPageNumCorner"]; // get the original value to see if a change + MergedPdfsPageNumCorner original = (s == string.Empty) ? Print_MergedPdfsPageNumCorner : (MergedPdfsPageNumCorner)int.Parse(s); + if (original == value) return; // no change. + _Xp["PrintSettings", "MergedPdfsLandPageNumCorner"] = ((int)value).ToString(); // save selected value + OnPropertyChanged("Print_MergedPdfsLandPageNumCorner"); + } + } + } [Category("Print Settings")] [DisplayName("MergedPdfsViewAfter")] [RefreshProperties(RefreshProperties.All)] diff --git a/PROMS/Volian.Print.Library/MergedPdf.cs b/PROMS/Volian.Print.Library/MergedPdf.cs index e990b243..5a466fd5 100644 --- a/PROMS/Volian.Print.Library/MergedPdf.cs +++ b/PROMS/Volian.Print.Library/MergedPdf.cs @@ -73,6 +73,10 @@ namespace Volian.Print.Library private MergedPdfsPageNumCorner _corner; private float _xloc = 0; private float _yloc = 0; + // C2021-047: Allow for setting of Merged Pdf Landscape Page Number Location + private MergedPdfsPageNumCorner _landcorner; + private float _landxloc = 0; + private float _landyloc = 0; // the following constructs the class that contains data for merging a group of pdfs. public MergedPdf(string folder, DocVersionInfo dvi) { @@ -182,6 +186,7 @@ namespace Volian.Print.Library float pgleft = page.BoundingBox.Left; float pgtop = page.BoundingBox.Top; float pgbot = page.BoundingBox.Bottom; + MergedPdfsPageNumCorner cnr = _corner; // C2021-047: Allow for setting of Merged Pdf Landscape Page Number Location // B2019-152: Landscape page numbers when merging if (landscape) { @@ -189,6 +194,7 @@ namespace Volian.Print.Library pgleft = page.BoundingBox.Bottom; pgtop = page.BoundingBox.Right; pgbot = page.BoundingBox.Left; + cnr = _landcorner; // C2021-047: Allow for setting of Merged Pdf Landscape Page Number Location } Phrase ph = new Phrase(); Chunk chk = new Chunk(outputpage, _itextFont); @@ -196,7 +202,7 @@ namespace Volian.Print.Library Paragraph pg = new Paragraph(ph); ColumnText columnText = new ColumnText(cb); cb.SaveState(); - switch (_corner) + switch (cnr) { case MergedPdfsPageNumCorner.TopRight: columnText.Alignment = Element.ALIGN_RIGHT; @@ -204,7 +210,7 @@ namespace Volian.Print.Library { System.Drawing.Drawing2D.Matrix myMatrix1 = new System.Drawing.Drawing2D.Matrix(0, 1, -1, 0, cb.PdfDocument.PageSize.Height, 0); cb.Transform(myMatrix1); - columnText.SetSimpleColumn(0, pgright - _yloc, pgright - _xloc, 0); + columnText.SetSimpleColumn(0, pgright - _landyloc, pgright - _landxloc, 0); // C2021-047: use landscape x & y } else columnText.SetSimpleColumn(0, pgtop - _yloc, pgright - _xloc, 0); @@ -215,7 +221,7 @@ namespace Volian.Print.Library { System.Drawing.Drawing2D.Matrix myMatrix2 = new System.Drawing.Drawing2D.Matrix(0, 1, -1, 0, cb.PdfDocument.PageSize.Width, 0); cb.Transform(myMatrix2); - columnText.SetSimpleColumn(0, _yloc, pgright - _xloc, 0); + columnText.SetSimpleColumn(0, _landyloc, pgright - _landxloc, 0); // C2021-047: use landscape x & y } else columnText.SetSimpleColumn(0, _yloc, pgright - _xloc, 0); @@ -225,7 +231,7 @@ namespace Volian.Print.Library { System.Drawing.Drawing2D.Matrix myMatrix3 = new System.Drawing.Drawing2D.Matrix(0, 1, -1, 0, cb.PdfDocument.PageSize.Height, 0); cb.Transform(myMatrix3); - columnText.SetSimpleColumn(_xloc, pgright - _yloc, pgright - _xloc, 0); + columnText.SetSimpleColumn(_xloc, pgright - _landyloc, pgright - _landxloc, 0); // C2021-047: use landscape x & y } else { @@ -237,7 +243,7 @@ namespace Volian.Print.Library { System.Drawing.Drawing2D.Matrix myMatrix4 = new System.Drawing.Drawing2D.Matrix(0, 1, -1, 0, cb.PdfDocument.PageSize.Width, 0); cb.Transform(myMatrix4); - columnText.SetSimpleColumn(_xloc, _yloc, pgright - _xloc, 0); + columnText.SetSimpleColumn(_xloc, _landyloc, pgright - _landxloc, 0); // C2021-047: use landscape x & y } else { @@ -284,6 +290,10 @@ namespace Volian.Print.Library _xloc = (float)dvc.Print_MergedPdfsPageNumLocX * 72; _yloc = (float)dvc.Print_MergedPdfsPageNumLocY * 72; _corner = dvc.Print_MergedPdfsPageNumCorner; + // C2021-047: Allow for setting of Merged Pdf Landscape Page Number Location + _landxloc = (float)dvc.Print_MergedPdfsLandPageNumLocX * 72; + _landyloc = (float)dvc.Print_MergedPdfsLandPageNumLocY * 72; + _landcorner = dvc.Print_MergedPdfsLandPageNumCorner; return true; }