Output.PrintersEnhanced.EnhancedPrintDocument updated.
This commit is contained in:
parent
628efe83ca
commit
76a841bc84
@ -23,8 +23,11 @@ namespace Results.Output.Printers.Enhanced
|
||||
readonly int leftMargin;
|
||||
readonly int TitleX;
|
||||
readonly int TitleY; /// Depends on the size of the header
|
||||
readonly int HdrTop; /// = TitleY + 60
|
||||
readonly int CommonTop; /// = TitleY + 60
|
||||
readonly int BodyTop; /// = HdrTop + 160
|
||||
///
|
||||
int titleHeight;
|
||||
int commonHeight;
|
||||
|
||||
/// Size of the printed area without margins, after taking into account 'pageOrientation'
|
||||
int printHeight;
|
||||
@ -87,8 +90,13 @@ namespace Results.Output.Printers.Enhanced
|
||||
|
||||
TitleX = leftMargin;
|
||||
TitleY = topMargin; /// Depends on the size of the header
|
||||
HdrTop = TitleY + 60;
|
||||
BodyTop = HdrTop + 160;
|
||||
///
|
||||
int headerLinesCount = (header.Contains(Environment.NewLine)) ? 2 : 1;
|
||||
titleHeight = headerLinesCount * 30 + 20;
|
||||
CommonTop = TitleY + titleHeight;
|
||||
|
||||
commonHeight = commonItems.Count * 20 + 20;
|
||||
BodyTop = CommonTop + commonHeight;
|
||||
|
||||
DefaultPageSettings.Landscape = (pageOrientation == PageOrientation.Landscape);
|
||||
|
||||
@ -165,7 +173,7 @@ namespace Results.Output.Printers.Enhanced
|
||||
///----------
|
||||
/// Header
|
||||
///----------
|
||||
RectangleF printArea = new RectangleF(TitleX, TitleY, printWidth, 40);
|
||||
RectangleF printArea = new RectangleF(TitleX, TitleY, printWidth, titleHeight);
|
||||
e.Graphics.DrawString(header, titleFont, Brushes.Black, printArea);
|
||||
|
||||
///----------------
|
||||
@ -189,8 +197,8 @@ namespace Results.Output.Printers.Enhanced
|
||||
/// Write aligned columns
|
||||
for (int i = 0; i < Math.Min(leftColumn.Length, rightColumn.Length); i++)
|
||||
{
|
||||
PrintAt(e, leftMargin, HdrTop + SpacingOne * i, leftColumn[i]);
|
||||
PrintAt(e, 300, HdrTop + SpacingOne * i, rightColumn[i]);
|
||||
PrintAt(e, leftMargin, CommonTop + SpacingOne * i, leftColumn[i]);
|
||||
PrintAt(e, 300, CommonTop + SpacingOne * i, rightColumn[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user