B2023-005: Beaver Valley CAS page, second page print of watermark is out of place

This commit is contained in:
Kathy Ruffing 2023-02-08 12:06:01 +00:00
parent ae831eac62
commit 7cf1d0e072
2 changed files with 18 additions and 1 deletions

View File

@ -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);

View File

@ -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);