Added IsLandscape property to SvgPageHelper class

Added code to process landscape pagelist for processing VCSummer data
This commit is contained in:
Rich 2013-06-11 18:48:26 +00:00
parent 7549f62ba9
commit bf9a9bcc9e

View File

@ -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<string> _AllowedWatermarks = new List<string>();
public List<string> 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();