diff --git a/PROMS/Volian.Print.Library/PromsPrinter.cs b/PROMS/Volian.Print.Library/PromsPrinter.cs index 66fe8d78..6126bd93 100644 --- a/PROMS/Volian.Print.Library/PromsPrinter.cs +++ b/PROMS/Volian.Print.Library/PromsPrinter.cs @@ -1397,9 +1397,11 @@ namespace Volian.Print.Library // next page - this fixes an issue where the page we inserted for the backside of the previous section was the larger page // size (11x17 vs 8x11) bool pageForNextSection = (ii == sectPageCount - 1 && !InsertBlankPages); + _MyHelper.SpecialCAS = false; if (mySection.MyDocStyle.DontInsertBlankPages && ii == sectPageCount - 1) // C2023-001 beaver valley CAS section type (has hard page break for back of page) { pageForNextSection = true; + _MyHelper.SpecialCAS = true; // B2023-005: Beaver Valley - flag to rotate watermark on 2nd CAS page } NewPage(pageForNextSection); // Word Document //_MyLog.InfoFormat("NewPage 3 {0}", cb.PdfWriter.CurrentPageNumber); diff --git a/PROMS/Volian.Svg.Library/iTextSharp.cs b/PROMS/Volian.Svg.Library/iTextSharp.cs index 1f1f943a..0be29927 100644 --- a/PROMS/Volian.Svg.Library/iTextSharp.cs +++ b/PROMS/Volian.Svg.Library/iTextSharp.cs @@ -921,6 +921,12 @@ namespace Volian.Svg.Library } public class SvgPageHelper : PdfPageEventHelper { + private bool _SpecialCAS; // B2023-005: CAS page, rotate watermark + public bool SpecialCAS + { + get { return _SpecialCAS; } + set { _SpecialCAS = value; } + } private bool _IsLandscape; public bool IsLandscape { @@ -1189,7 +1195,16 @@ namespace Volian.Svg.Library //if (!AllowAllWatermarks && !AllowedWatermarks.Contains(Watermark)) return; -- B2018-124 not needed anymore with above if statement - this does not hanle "Information Only" cb.SaveState(); if (_WatermarkLayer != null) cb.BeginLayer(_WatermarkLayer); - if (IsLandscape || IsWatermarkLandscape) // B2019-145: Added for printing landscape watermark on step section pages. + // B2023-005: Beaver Valley, second page of CAS page is a 'foldout' on large paper - need to rotate the + // watermark + if (SpecialCAS) + { + double a = -180 * (Math.PI / 180); + System.Drawing.Drawing2D.Matrix myMatrix = new System.Drawing.Drawing2D.Matrix((float)Math.Cos(a), (float)Math.Sin(a), (float)-Math.Sin(a), (float)Math.Cos(a), cb.PdfDocument.PageSize.Width, cb.PdfDocument.PageSize.Height); + cb.Transform(myMatrix); + + } + else if (IsLandscape || IsWatermarkLandscape) // B2019-145: Added for printing landscape watermark on step section pages. { // The watermark needs to be rotated back for landscape pagelist - B2016-191 //double a = -33 * (Math.PI / 180);