C2022-004 Logic to print a Unit Designator Watermark

C2022-004 added Unit Designator Watermark option
C2022-004 added format xml structure for Unit Designator Watermark and a flag to use it on Approval PDFs
This commit is contained in:
2022-02-23 21:01:33 +00:00
parent 4e2b669199
commit b1a39f4a21
4 changed files with 149 additions and 23 deletions

View File

@@ -462,8 +462,16 @@ namespace VEPROMS
cbxWaterMark.DataSource = EnumDetail<PrintDlgWatermarkList>.Details();
cbxWaterMark.ValueMember = "EValue";
PrintWatermark pw = _DocVersionConfig.Print_Watermark; // MyProcedure.ProcedureConfig.Print_Watermark;
if (!pw.ToString().ToUpper().Equals("NONE")) //B2019-044 check setting from folder level
cbxWaterMark.Text = pw.ToString(); // position print dialog list to setting from folder level
string pwstr = pw.ToString().ToUpper();
if (!pwstr.Equals("NONE")) //B2019-044 check setting from folder level
{
if (pwstr.Equals("INFORMATIONONLY"))
cbxWaterMark.Text = "Information Only";
else if (pwstr.Equals("UNITDESIGNATOR"))// C2022-004 unit designator option
cbxWaterMark.Text = "Unit Designator";
else
cbxWaterMark.Text = pw.ToString(); // position print dialog list to setting from folder level
}
else
swtbtnWaterMark.Value = false; // set to None at folder level so set Watermark switch to the off position
@@ -695,7 +703,8 @@ namespace VEPROMS
// If file exists, determine if overwrite checkbox allows overwrite, if not prompt.
Volian.Print.Library.Rtf2Pdf.PdfDebug = cbxDebug.Checked;
// B2019-128: The combo box list did not include the 'None' option so the selected value was not the correct watermark (had to add 1 to the selected index)
string waterMarkText = (swtbtnWaterMark.Value) ? cbxWaterMark.Text : "None"; // C2021-019
string waterMarkText = (swtbtnWaterMark.Value) ? cbxWaterMark.Text : "None"; // C2021-019
string watermarkColor = "Blue"; // this is the default watermark color
// Determine change bar settings. First get from config & then see if override from dialog.
// Also check that format allows override.
ChangeBarDefinition cbd = DetermineChangeBarSettings();
@@ -709,6 +718,7 @@ namespace VEPROMS
{
string locpdfname = null; // get pdf file name for later merge code
MyProcedure = myProc;
frmPDFStatusForm.SetUnitWatermark(MyProcedure, ref waterMarkText, ref watermarkColor); //C2022-004 Unit Designator watermark
// C2021-019: Override Watermark Text, 'waterMarkText' will have whatever watermark text should be printed
ProcedureConfig procConfig = MyProcedure.MyConfig as ProcedureConfig;
string waterMarkTextOverride = "";
@@ -746,7 +756,7 @@ namespace VEPROMS
// B2021-102 put in the using for better memory management
using (frmPDFStatusForm frmStatus = new frmPDFStatusForm(MyProcedure, RevNumAndDate, waterMarkText, cbxDebug.Checked, cbxOrPgBrk.Checked,
cbxOpenAfterCreate2.Checked, cbxOverwritePDF2.Checked, myPDFPath, cbd, txbPDFName.Text, new Point(Left, Bottom - 50),
swtbtnBlankPgsForDuplex.Value, _AllProcedures || Automatic, Prefix, SaveLinks, RemoveTrailingHardReturnsAndManualPageBreaks, swtbtnPROMSVersion.Value, true, tbBlankPage.Text, _MergedPfd))//;//C2018-009 print PROMS version
swtbtnBlankPgsForDuplex.Value, _AllProcedures || Automatic, Prefix, SaveLinks, RemoveTrailingHardReturnsAndManualPageBreaks, swtbtnPROMSVersion.Value, true, tbBlankPage.Text, _MergedPfd, watermarkColor))//;//C2018-009 print PROMS version
{
frmStatus.CloseWhenDone = true;
Application.DoEvents();
@@ -783,7 +793,7 @@ namespace VEPROMS
// B2021-102 put in the using for better memory management
using (frmPDFStatusForm frmStatus = new frmPDFStatusForm(MyProcedure, RevNumAndDate, waterMarkText, cbxDebug.Checked, cbxOrPgBrk.Checked,
cbxOpenAfterCreate2.Checked, cbxOverwritePDF2.Checked, GetMultiunitPDFPath(), cbd, txbPDFName.Text, new Point(Left, Bottom - 50),
swtbtnBlankPgsForDuplex.Value, _AllProcedures || Automatic, Prefix, SaveLinks, RemoveTrailingHardReturnsAndManualPageBreaks, swtbtnPROMSVersion.Value, true, tbBlankPage.Text, _MergedPfd)) // ;//C2018-009 print PROMS version
swtbtnBlankPgsForDuplex.Value, _AllProcedures || Automatic, Prefix, SaveLinks, RemoveTrailingHardReturnsAndManualPageBreaks, swtbtnPROMSVersion.Value, true, tbBlankPage.Text, _MergedPfd, watermarkColor)) // ;//C2018-009 print PROMS version
{
frmStatus.CloseWhenDone = true;
Application.DoEvents();
@@ -819,7 +829,7 @@ namespace VEPROMS
// B2016-249 Output Procedure to folder associated with Parent Child
using (frmPDFStatusForm frmStatus = new frmPDFStatusForm(MyProcedure, RevNumAndDate, waterMarkText, cbxDebug.Checked,
cbxOrPgBrk.Checked, cbxOpenAfterCreate2.Checked, cbxOverwritePDF2.Checked, GetMultiunitPDFPath(), cbd, txbPDFName.Text,
new Point(Left, Bottom - 50), swtbtnBlankPgsForDuplex.Value, _AllProcedures || Automatic, Prefix, SaveLinks, RemoveTrailingHardReturnsAndManualPageBreaks, swtbtnPROMSVersion.Value, true, tbBlankPage.Text, _MergedPfd)) // ;//C2018-009 print PROMS version
new Point(Left, Bottom - 50), swtbtnBlankPgsForDuplex.Value, _AllProcedures || Automatic, Prefix, SaveLinks, RemoveTrailingHardReturnsAndManualPageBreaks, swtbtnPROMSVersion.Value, true, tbBlankPage.Text, _MergedPfd, watermarkColor)) // ;//C2018-009 print PROMS version
{
frmStatus.CloseWhenDone = true;
Application.DoEvents();
@@ -843,7 +853,6 @@ namespace VEPROMS
VEPROMS.CSLA.Library.Database.ShowDBTracking("DBTracking.txt");
}
}
private void AddToMergeList(ProcedureInfo myProc, string locpdfname)
{
// if doing a merge and this procedure should be included, add it to _MergedPdf:
@@ -940,6 +949,8 @@ namespace VEPROMS
// B2019-044 don't print the watermark if the watermark switch on the print dialog is turned off
cbxWaterMark.Visible = true;
string waterMarkText = (swtbtnWaterMark.Value) ? cbxWaterMark.Text : "None" ; // B2018-124 use text of watermark form drop down list instead of enum value
string watermarkColor = "Blue"; // this is the default watermark color
frmPDFStatusForm.SetUnitWatermark(MyProcedure, ref waterMarkText, ref watermarkColor); //C2022-004 Unit Designator Watermark
ProcedureConfig procConfig = MyProcedure.MyConfig as ProcedureConfig;
string waterMarkTextOverride = "";
if (procConfig != null) waterMarkTextOverride = procConfig.GetValue("PSI", "WATERMARKOVERRIDE"); // C2021-019: override watermark text
@@ -964,7 +975,7 @@ namespace VEPROMS
// B2018-124 use text of watermark form drop down list instead of enum value
using (frmPDFStatusForm frmStatus = new frmPDFStatusForm(MyProcedure, RevNumAndDate, waterMarkText, cbxDebug.Checked, cbxOrPgBrk.Checked,
cbxOpenAfterCreate2.Checked, cbxOverwritePDF2.Checked, GetMultiunitPDFPath(), cbd, txbPDFName.Text, new Point(Left, Bottom - 50),
swtbtnBlankPgsForDuplex.Value, _AllProcedures || Automatic, Prefix, SaveLinks, RemoveTrailingHardReturnsAndManualPageBreaks, swtbtnPROMSVersion.Value, false, tbBlankPage.Text, _MergedPfd))//; //C2018-009 print PROMS version
swtbtnBlankPgsForDuplex.Value, _AllProcedures || Automatic, Prefix, SaveLinks, RemoveTrailingHardReturnsAndManualPageBreaks, swtbtnPROMSVersion.Value, false, tbBlankPage.Text, _MergedPfd, watermarkColor))//; //C2018-009 print PROMS version
{
frmStatus.MakePlaceKeeper = swtbtnGeneratePlacekeeper.Value;
frmStatus.MakeContinuousActionSummary = cbxGenerateConActSum.Checked;