diff --git a/PROMS/Volian.Svg.Library/iTextSharp.cs b/PROMS/Volian.Svg.Library/iTextSharp.cs index 8ce39fbb..378ca4b5 100644 --- a/PROMS/Volian.Svg.Library/iTextSharp.cs +++ b/PROMS/Volian.Svg.Library/iTextSharp.cs @@ -816,6 +816,12 @@ namespace Volian.Svg.Library } public class SvgPageHelper : PdfPageEventHelper { + private bool _IsLandscape; + public bool IsLandscape + { + get { return _IsLandscape; } + set { _IsLandscape = value; } + } private List _AllowedWatermarks = new List(); public List AllowedWatermarks { @@ -941,8 +947,7 @@ namespace Volian.Svg.Library { get { - // If no background treat as if it were created with 32 Bit PROMS - if (BackgroundReader == null) return true; + if (BackgroundReader == null) return false; return BackgroundReader.Info["Producer"].ToString().StartsWith("iTextSharp"); } } @@ -1016,6 +1021,22 @@ namespace Volian.Svg.Library cb.SaveState(); if (_PageListLayer != null) cb.BeginLayer(_PageListLayer); // Do anything needed to finish off the page + //System.Drawing.Drawing2D.Matrix myMatrix = new System.Drawing.Drawing2D.Matrix(); + //myMatrix.Rotate(90); // Rotate the Pagelist items by 90 Degrees. + //// Translate by the Height of the page. + //myMatrix.Translate(cb.PdfDocument.PageSize.Height, 0, System.Drawing.Drawing2D.MatrixOrder.Append); + //// This was for fun + //// myMatrix.Scale(.75F, .75F, System.Drawing.Drawing2D.MatrixOrder.Append); + //cb.Transform(myMatrix); + //// You can look at the value of the Matrix at this point, to create the matrix directly like I did below + //OR + // Rotate 90 Degrees and Translate by the Height of the Page + + if (IsLandscape) + { + System.Drawing.Drawing2D.Matrix myMatrix = new System.Drawing.Drawing2D.Matrix(0, 1, -1, 0, cb.PdfDocument.PageSize.Height, 0); + cb.Transform(myMatrix); + } _MySvg.Draw(cb); if (_PageListLayer != null) cb.EndLayer(); cb.RestoreState();