This commit is contained in:
Kathy Ruffing 2012-11-06 12:00:38 +00:00
parent 06461d264e
commit a9ab86f6ae
2 changed files with 21 additions and 6 deletions

View File

@ -84,7 +84,8 @@ namespace Volian.Print.Library
{
get {return YChangeBarBottom - YExtendLine; }
}
public vlnChangeBar(PdfContentByte cb, vlnParagraph parent, float xoff, float yoff, int msgAlignment)
private bool _IsRev;
public vlnChangeBar(PdfContentByte cb, vlnParagraph parent, float xoff, float yoff, int msgAlignment, bool isRev)
{
// for grids, a y adjustment is made to match 16bit output, see the variable 'GridTopAdjust'. Take this
// adjustment into account for the change bar. 6.5 positioned the change bar to match 16bit output.
@ -93,6 +94,7 @@ namespace Volian.Print.Library
XOffset = xoff;
YOffset = yoff;
MyParent = parent;
_IsRev = isRev;
Messages = new SortedDictionary<float, vlnChangeBarMessage>();
// if there is an RNO separator, add the separator's height in too.
Height = parent.Height * MyPageHelper.YMultiplier + (parent.MyItemInfo.IsFigure?SixLinesPerInch:0);
@ -158,9 +160,10 @@ namespace Volian.Print.Library
vlnChangeBarMessage vcbm = (vlnChangeBarMessage)kvp.Value;
if (lastMsg != vcbm.Message)
{
//If change bar is on left side, subtract off size of text & some constant number
// y is yoffset - size of paragraph
iTextSharp.text.Font iFont = Volian.Svg.Library.VolianPdf.GetFont(new System.Drawing.Font("Letter Gothic", 5.5F));
// use bigger font if revnum msg
iTextSharp.text.Font iFont = _IsRev? Volian.Svg.Library.VolianPdf.GetFont(new System.Drawing.Font("Letter Gothic", 10F)):
Volian.Svg.Library.VolianPdf.GetFont(new System.Drawing.Font("Letter Gothic", 5.5F));
Chunk chk = new Chunk(vcbm.Message.IndexOf(@"\n") > -1 ? vcbm.Message.Substring(0, vcbm.Message.IndexOf(@"\n")) : vcbm.Message, iFont);
Paragraph myparagraph = new Paragraph(chk);

View File

@ -1509,7 +1509,19 @@ namespace Volian.Print.Library
cbMess = itemInfo.MyContent.UserID + @"\n" + fmtDate;
}
else if (myPageHelper.ChangeBarDefinition.MyChangeBarText == PrintChangeBarText.RevNum)
cbMess = myPageHelper.Rev;
{
string lRev = myPageHelper.Rev;
// Now check the format flags to determine if/how the Rev string should be parsed.
if ((itemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.DoRevDate && lRev.Contains("/"))
|| (itemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.RevDateWithForwardSlash && lRev.Contains("\\")))
{
int indx = lRev.IndexOf(itemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.DoRevDate ? '/' : '\\');
cbMess = lRev.Substring(0, indx>-1?indx:lRev.Length);
}
else
cbMess = lRev;
}
else if (myPageHelper.ChangeBarDefinition.MyChangeBarText == PrintChangeBarText.UserDef)
cbMess = myPageHelper.ChangeBarDefinition.MyChangeBarMessage;
@ -1519,7 +1531,7 @@ namespace Volian.Print.Library
!itemInfo.IsInRNO)) msgAlign = Element.ALIGN_RIGHT;
float coltotwips = col * itemInfo.FormatStepData.Font.CharsToTwips;
if (itemInfo.IsFigure) coltotwips = col * itemInfo.ActiveFormat.PlantFormat.FormatData.Font.CharsToTwips;
return new vlnChangeBar(cb, this, (float)itemInfo.MyDocStyle.Layout.LeftMargin + coltotwips, yoff, msgAlign);
return new vlnChangeBar(cb, this, (float)itemInfo.MyDocStyle.Layout.LeftMargin + coltotwips, yoff, msgAlign, myPageHelper.ChangeBarDefinition.MyChangeBarText == PrintChangeBarText.RevNum);
}
private int ChangeBarLocation(float c, vlnParagraph paragraph, FormatInfo formatInfo, int maxRNO)