Added gap in centerline for grid for processing VCSummer data
Changed how page length was determined when deciding how to paginate a procedure for processing VCSummer data Utilized FixedMessage property for processing VCSummer data Utilized DocStyle.LandscapePageList property for processing VCSummer data Added gap in centerline for boxes for processing VCSummer data Changed ToPdf method to pass yTopMargin and yBottomMargin by reference Chnaged calls to ToPdf method to pass yTopMargin and yBottomMargin by reference Changed how vlnParagraph was processed with regards to Notes and Caution boxes to support nuances in VCSummer data Added code to support macro substitutions in continue messages and end of procedure messages for processing VCSummer data Added drawing centerline and handling gaps in centerline for processing VCSummer data Added RomanNumbering of pages for processing VCSummer data Added classes Gap and Gaps for processing VCSummer data Utilized MacroTabAdjust property for processing VCSummer data Changed how vlnText width was calculated for processing VCSummer data
This commit is contained in:
parent
8f962bc778
commit
7549f62ba9
@ -125,6 +125,8 @@ namespace Volian.Print.Library
|
||||
public void ToPdf(iTextSharp.text.pdf.ColumnText myColumnText, float left, float top)
|
||||
{
|
||||
//ZoomGrid(myColumnText, left, top);
|
||||
VlnSvgPageHelper myPageHelper = myColumnText.Canvas.PdfWriter.PageEvent as VlnSvgPageHelper;
|
||||
myPageHelper.AddGap(top, top - Height, left, left + Width);
|
||||
MyCells.ToPdf(myColumnText, left, top);
|
||||
}
|
||||
private void ZoomGrid(iTextSharp.text.pdf.ColumnText myColumnText, float left, float top)
|
||||
|
@ -29,14 +29,6 @@ namespace Volian.Print.Library
|
||||
private int Paginate(float yLocation, float yTopMargin, float yBottomMargin)
|
||||
{
|
||||
float yPageSize = yTopMargin - yBottomMargin;
|
||||
// yPageSizeNextPage is the page size of the 'next' page. A format variable exists off of the docstyle
|
||||
// For UseOnFirstPage vs UseOnAllButFirstPage. If this is set for this format, and processing the FIRST
|
||||
// page, the size of next page, which may be different, is used in pagination calculationstop.
|
||||
// If this format flag is not set, or not printing the first page of the section with this flag,
|
||||
// this next page size is the same as current page size.
|
||||
float yPageSizeNextPage = yPageSize;
|
||||
if (!MyPageHelper.DidFirstPageDocStyle && (MyItemInfo.MyActiveSection.MyDocStyle.StructureStyle.Where & E_DocStyleUse.UseOnFirstPage) > 0)
|
||||
yPageSizeNextPage = GetYPageSizeUseOnAllButFirstPage();
|
||||
|
||||
// TODO: This does not account for a long step as the last step that would exceed more than one page and
|
||||
// that has an end message that needs to be accounted for in determining pagination. To do that the last
|
||||
@ -153,7 +145,6 @@ namespace Volian.Print.Library
|
||||
float ySize7LPI = YSize; // +SixLinesPerInch;
|
||||
if (_Match16BitPagination) ySize7LPI += SixLinesPerInch;
|
||||
string firstStep = "No";
|
||||
|
||||
if (MyItemInfo.IsHigh && MyItemInfo.MyPrevious == null)
|
||||
firstStep = "Yes";
|
||||
//if (!ManualPageBreak && mySize + yEndMsg <= yWithinMargins) // Don't Paginate if there is enough room, will fit on page
|
||||
@ -174,6 +165,16 @@ namespace Volian.Print.Library
|
||||
|
||||
// YSize includes a blank line after the step which we don't want to include in the page break test, thus the
|
||||
// YSize - SixLinesPerInch:
|
||||
// yPageSizeNextPage is the page size of the 'next' page. A format variable exists off of the docstyle
|
||||
// For UseOnFirstPage vs UseOnAllButFirstPage. If this is set for this format, and processing the FIRST
|
||||
// page, the size of next page, which may be different, is used in pagination calculationstop.
|
||||
// If this format flag is not set, or not printing the first page of the section with this flag,
|
||||
// this next page size is the same as current page size.
|
||||
float yPageSizeNextPage = yPageSize;
|
||||
//if (firstStep == "No")
|
||||
// ResetDocStyleAndValues(ref yTopMargin, ref yBottomMargin);
|
||||
if (MyPageHelper.DidFirstPageDocStyle && (MyItemInfo.MyActiveSection.MyDocStyle.StructureStyle.Where & E_DocStyleUse.UseOnAllButFirstPage) > 0)
|
||||
yPageSizeNextPage = GetYPageSizeUseOnAllButFirstPage();
|
||||
if (!KeepWithHeader && !KeepStepsOnPage && YSize - SixLinesPerInch + yEndMsg <= yPageSizeNextPage) // if the entire step can fit on one page, do a page break
|
||||
{
|
||||
// Don't want extra line before step
|
||||
|
@ -547,7 +547,7 @@ namespace Volian.Print.Library
|
||||
float ylocation = cb.PdfDocument.PageSize.Height - ((float)mySection.MyDocStyle.Layout.TopMargin + locEndOfWordDoc * 72); // 72 - pts per inch.
|
||||
iTextSharp.text.Font fnt = VolianPdf.GetFont(mySection.MyDocStyle.End.Font.WindowsFont);
|
||||
fnt.Color = new iTextSharp.text.Color(PrintOverride.OverrideTextColor(System.Drawing.Color.Black));
|
||||
iTextSharp.text.Paragraph para = new Paragraph(mySection.MyDocStyle.End.Message, fnt);
|
||||
iTextSharp.text.Paragraph para = new Paragraph(mySection.MyDocStyle.End.FixedMessage, fnt);
|
||||
float wtpm = (float)mySection.MyDocStyle.Layout.PageWidth - (float)mySection.MyDocStyle.Layout.LeftMargin;
|
||||
float centerpos = (float)mySection.MyDocStyle.Layout.LeftMargin + (wtpm - (mySection.MyDocStyle.End.Message.Length * mySection.MyDocStyle.End.Font.CharsToTwips)) / 2;
|
||||
float yBottomMargin = Math.Max(0, (float)mySection.MyDocStyle.Layout.TopMargin - (float)mySection.MyDocStyle.Layout.PageLength - 2 * vlnPrintObject.SixLinesPerInch);
|
||||
@ -557,11 +557,16 @@ namespace Volian.Print.Library
|
||||
OnStatusChanged("Merge MSWord", PromsPrinterStatusType.MergeMSWord);
|
||||
}
|
||||
OnStatusChanged("Before NewPage", PromsPrinterStatusType.Before);
|
||||
if (mySection.MyDocStyle.LandscapePageList)// && mySection.MyDocStyle.Layout.PageWidth > mySection.MyDocStyle.Layout.PageLength)
|
||||
_MyHelper.IsLandscape = true;
|
||||
else
|
||||
_MyHelper.IsLandscape = false;
|
||||
cb.PdfDocument.NewPage(); // Word Document
|
||||
|
||||
// if this document style has another style that is for pages other than first, we need to
|
||||
// reset the document style off of this section AND reset docstyle values used.
|
||||
_MyHelper.DidFirstPageDocStyle = true;
|
||||
DebugPagination.WriteLine("CreateWordDocPdf");
|
||||
if ((mySection.MyDocStyle.StructureStyle.Where & E_DocStyleUse.UseOnFirstPage) > 0)
|
||||
_MyHelper.MySection = mySection; // this resets the docstyle/pagestyle if pagehelper
|
||||
OnStatusChanged("After NewPage", PromsPrinterStatusType.NewPage);
|
||||
|
@ -114,11 +114,51 @@ namespace Volian.Print.Library
|
||||
}
|
||||
if (MySection.MyDocStyle.StructureStyle.Style==null || (MySection.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DontCountInTabOfCont) == 0)
|
||||
CurrentTOCPageNumber++;
|
||||
if (MySection.MyDocStyle.CenterLineX != null && MySection.ColumnMode > 0)
|
||||
DrawCenterLine(writer.DirectContent, MySection.MyDocStyle.Layout.LeftMargin + MySection.MyDocStyle.CenterLineX ?? 0, MySection.MyDocStyle.CenterLineYTop ?? 0, MySection.MyDocStyle.CenterLineYBottom ?? 0);
|
||||
PageListTopCheckOffHeader = null;
|
||||
PageListLastCheckOffHeader = null;
|
||||
YMultiplier = 1;
|
||||
|
||||
}
|
||||
private Gaps _MyGaps;
|
||||
public Gaps MyGaps
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_MyGaps == null)
|
||||
_MyGaps = new Gaps();
|
||||
return _MyGaps;
|
||||
}
|
||||
}
|
||||
public void AddGap(float top, float bottom, float left, float right)
|
||||
{
|
||||
float center = MySection.MyDocStyle.Layout.LeftMargin + MySection.MyDocStyle.CenterLineX ?? 0;
|
||||
if(center == 0) return;
|
||||
if (center > right || center < left) return;
|
||||
MyGaps.Add(top, bottom);
|
||||
}
|
||||
private void DrawCenterLine(PdfContentByte cb, float xLoc, float yTop, float yBottom)
|
||||
{
|
||||
cb.SaveState();
|
||||
if (PageListLayer != null) cb.BeginLayer(PageListLayer);
|
||||
cb.SetLineWidth(.95f);
|
||||
cb.SetColorStroke(new Color(PrintOverride.SvgColor));
|
||||
cb.MoveTo(xLoc, yTop);
|
||||
if (_MyGaps != null)
|
||||
{
|
||||
foreach (Gap gap in MyGaps)
|
||||
{
|
||||
cb.LineTo(xLoc, gap.YTop);
|
||||
cb.MoveTo(xLoc, gap.YTop - (gap.YTop - gap.YBottom) * YMultiplier);
|
||||
}
|
||||
_MyGaps = null;
|
||||
}
|
||||
cb.LineTo(xLoc, yBottom);
|
||||
cb.Stroke();
|
||||
if (PageListLayer != null) cb.EndLayer();
|
||||
cb.RestoreState();
|
||||
}
|
||||
|
||||
private void ResetDocStyleAndValues()
|
||||
{
|
||||
@ -518,6 +558,10 @@ namespace Volian.Print.Library
|
||||
MyPdfContentByte.AddTemplate(MyPageCounts.AddToTemplateList(key, MyPdfWriter, txt, args.MySvgText.Font, args.MySvgText.Align, args.MySvgText.FillColor), args.MySvgScale.X(args.MySvgText.X), args.MySvgScale.Y(MyPdfContentByte, args.MySvgText.Y));
|
||||
return string.Empty;
|
||||
}
|
||||
if (args.MyText.Contains("{ROMANPAGE}"))
|
||||
{
|
||||
return args.MyText.Replace("{ROMANPAGE}", ItemInfo.RomanNumbering(1).ToLower());
|
||||
}
|
||||
if (args.MyText.Contains("{SECONDARYPAGE}") || args.MyText.Contains("{SECONDARYOF}"))
|
||||
{
|
||||
string key = "SecondaryPage." + MySection.ItemID;
|
||||
@ -1590,4 +1634,31 @@ namespace Volian.Print.Library
|
||||
_CheckOffHeaderFont = vf;
|
||||
}
|
||||
}
|
||||
public class Gap
|
||||
{
|
||||
private float _YTop;
|
||||
public float YTop
|
||||
{
|
||||
get { return _YTop; }
|
||||
set { _YTop = value; }
|
||||
}
|
||||
private float _YBottom;
|
||||
public float YBottom
|
||||
{
|
||||
get { return _YBottom; }
|
||||
set { _YBottom = value; }
|
||||
}
|
||||
public Gap(float yTop, float yBottom)
|
||||
{
|
||||
_YTop = yTop;
|
||||
_YBottom = yBottom;
|
||||
}
|
||||
}
|
||||
public class Gaps : List<Gap>
|
||||
{
|
||||
public void Add(float yTop, float yBotttom)
|
||||
{
|
||||
this.Add(new Gap(yTop, yBotttom));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -67,6 +67,7 @@ namespace Volian.Print.Library
|
||||
float right = (float)MyParent.MyItemInfo.MyDocStyle.Layout.LeftMargin + (float)(MyBox.End ?? DefEnd);
|
||||
iTextSharp.text.Color boxColor = new iTextSharp.text.Color(PrintOverride.OverrideBoxColor(System.Drawing.Color.Black));
|
||||
cb.SetColorStroke(boxColor);
|
||||
_MyPageHelper.MyGaps.Add(top, top - Height);
|
||||
if (DefBox != null)
|
||||
{
|
||||
cb.SetLineWidth(.6F);
|
||||
@ -156,14 +157,14 @@ namespace Volian.Print.Library
|
||||
// Do the top line first:
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append(MyBox.BXULC);
|
||||
float size = (float)(MyBox.BXULC.Length * (72 / vf.CPI));
|
||||
float size = (float)(MyBox.BXULC.Length * (72/vf.CPI));
|
||||
string bxstr = null;
|
||||
if (!ContainsPageBreak) // Only do top line if there is no page break.
|
||||
{
|
||||
while (size < endHorz)
|
||||
{
|
||||
sb.Append(MyBox.BXHorz);
|
||||
size = size + (float)(MyBox.BXHorz.Length * (72 / vf.CPI));
|
||||
size = size + (float)(MyBox.BXHorz.Length * (72/vf.CPI));
|
||||
}
|
||||
// Tack on the right upper corner. For some formats, the upper right corner in the
|
||||
// had the first character as a space, this would put two spaces in a row at the
|
||||
@ -171,7 +172,7 @@ namespace Volian.Print.Library
|
||||
bxstr = sb.ToString();
|
||||
if (bxstr[bxstr.Length - 1] == ' ' && MyBox.BXURC[0] == ' ') bxstr = bxstr.TrimEnd();
|
||||
bxstr = bxstr + MyBox.BXURC;
|
||||
size = size + (float)((MyBox.BXURC.Length) * (72 / vf.CPI));
|
||||
size = size + (float)((MyBox.BXURC.Length) * (72/vf.CPI));
|
||||
Rtf = GetRtf(bxstr, vf);
|
||||
IParagraph = null; // set to null so that next access of IParagraph sets the Rtf.
|
||||
Rtf2Pdf.TextAt(cb, IParagraph, left, top, size + 10, 100, "", yBottomMargin);
|
||||
@ -189,7 +190,7 @@ namespace Volian.Print.Library
|
||||
size = size + (float)(MyBox.BXHorz.Length * (72 / vf.CPI));
|
||||
}
|
||||
bxstr = sb.ToString().TrimEnd() + MyBox.BXLRC;
|
||||
size = size + (float)((MyBox.BXLRC.Length) * (72 / vf.CPI));
|
||||
size = size + (float)((MyBox.BXLRC.Length) * (72/vf.CPI));
|
||||
Rtf = GetRtf(bxstr, vf);
|
||||
IParagraph = null; // set to null so that next access of IParagraph sets the Rtf.
|
||||
Rtf2Pdf.TextAt(cb, IParagraph, left, bottom, size + 10, 100, "", yBottomMargin);
|
||||
|
@ -50,7 +50,8 @@ namespace Volian.Print.Library
|
||||
yoff = Add(cb, childItemInfo.Notes, xoff, yoff, yoffRight, rnoLevel, maxRNO, formatInfo);
|
||||
int? bxIndx = childItemInfo.FormatStepData==null?-1:childItemInfo.FormatStepData.StepLayoutData.STBoxindex;
|
||||
bool boxHLS = false;
|
||||
if ((bxIndx != -1 && (bxIndex != bxIndx || childItemInfo.FormatStepData.BoxIt)))
|
||||
|
||||
if ((bxIndx ?? -1) != -1 && (bxIndex != bxIndx || childItemInfo.FormatStepData.BoxIt || childItemInfo.MyHeader != null))
|
||||
{
|
||||
if (childItemInfo.FormatStepData.BoxIt) // this is a boxed HLS
|
||||
{
|
||||
@ -81,7 +82,12 @@ namespace Volian.Print.Library
|
||||
{
|
||||
if (bxIndx != null)
|
||||
{
|
||||
if (box != null) box.Height = yoff - box.YOffset; // new height, with children
|
||||
if (box != null)
|
||||
{
|
||||
box.Height = yoff - box.YOffset; // new height, with children
|
||||
if (childItemInfo.MyHeader != null)
|
||||
yoff += vlnPrintObject.SixLinesPerInch * 2;
|
||||
}
|
||||
box = new vlnBox();
|
||||
box.MyBox = formatInfo.PlantFormat.FormatData.BoxList[(int)bxIndx];
|
||||
int ln = 1; // a format flag determines whether there is a space before the note/caution.
|
||||
@ -96,7 +102,6 @@ namespace Volian.Print.Library
|
||||
if (childItemInfo is SectionInfo) formatInfo = (childItemInfo as SectionInfo).LocalFormat ?? formatInfo;
|
||||
if (rnoLevel < maxRNO && childItemInfo.RNOs != null) yoff = Math.Max(yoff, yoffRight);
|
||||
vlnParagraph para = new vlnParagraph(Parent, cb, childItemInfo, xoff, yoff, rnoLevel, maxRNO, formatInfo, null, null);
|
||||
|
||||
if (box != null && box.MyParent == null)
|
||||
{
|
||||
box.MyParent = para;
|
||||
@ -134,7 +139,7 @@ namespace Volian.Print.Library
|
||||
}
|
||||
return yoff;
|
||||
}
|
||||
public float ToPdf(PdfContentByte cb, float yPageStart, float yTopMargin, float yBottomMargin)
|
||||
public float ToPdf(PdfContentByte cb, float yPageStart, ref float yTopMargin, ref float yBottomMargin)
|
||||
{
|
||||
foreach (vlnParagraph child in this)
|
||||
{
|
||||
@ -582,10 +587,8 @@ namespace Volian.Print.Library
|
||||
{
|
||||
get
|
||||
{
|
||||
return string.Format("DebugID = {0}, ID={1} Type={2} TypeName='{3}' StepLevel={4} DBSequence={5} YTopMost={6} ",
|
||||
DebugId, MyItemInfo.ItemID, MyItemInfo.FormatStepType,
|
||||
MyItemInfo.FormatStepData==null?"NoStepData":MyItemInfo.FormatStepData.Type,
|
||||
MyItemInfo.StepLevel, MyItemInfo.DBSequence,YTopMost);
|
||||
return string.Format("DebugID = {0}, ID={1} Type={2} TypeName='{3}' StepLevel={4} DBSequence={5} Width={6} Left={7}",
|
||||
DebugId, MyItemInfo.ItemID, MyItemInfo.FormatStepType, MyItemInfo.FormatStepData==null?"NoStepData":MyItemInfo.FormatStepData.Type, MyItemInfo.StepLevel, MyItemInfo.DBSequence, Width, XOffset);
|
||||
}
|
||||
}
|
||||
private void ResetDocStyleAndValues(ref float yTopMargin, ref float yBottomMargin)
|
||||
@ -606,6 +609,7 @@ namespace Volian.Print.Library
|
||||
}
|
||||
}
|
||||
MyPageHelper.DidFirstPageDocStyle = true;
|
||||
DebugPagination.WriteLine("ResetDocStyleAndValues");
|
||||
MyPageHelper.MySection = (SectionInfo)MyItemInfo.MyActiveSection;
|
||||
yTopMargin = _PointsPerPage - (float)MyItemInfo.MyActiveSection.MyDocStyle.Layout.TopMargin;
|
||||
yBottomMargin = Math.Max(0, yTopMargin - (float)MyItemInfo.MyActiveSection.MyDocStyle.Layout.PageLength);
|
||||
@ -629,7 +633,6 @@ namespace Volian.Print.Library
|
||||
DebugText.WriteLine("ToPdf1:{0},'{1}',{2},{3},{4},{5}", MyItemInfo.ItemID, MyItemInfo.ShortSearchPath, XOffset, yLocation, yPageStart, YTopMost);
|
||||
int paginate = Paginate(yLocation, yTopMargin, yBottomMargin);
|
||||
bool firstHighLevelStep = MyItemInfo.IsHigh && (MyItemInfo.MyPrevious == null);
|
||||
|
||||
switch (paginate)
|
||||
{
|
||||
case 0: // No page break
|
||||
@ -643,6 +646,7 @@ namespace Volian.Print.Library
|
||||
case 1: // Break on High Level Step
|
||||
OutputOtherPageSteps(cb, YTopMost, yPageStart, yTopMargin, yBottomMargin);
|
||||
cb.PdfDocument.NewPage();
|
||||
if(MyItemInfo.IsHigh && MyItemInfo.MyPrevious != null) //do not reset for 1st step
|
||||
ResetDocStyleAndValues(ref yTopMargin, ref yBottomMargin);
|
||||
DebugText.WriteLine("Paginate1");
|
||||
if (MyItemInfo.IsSection)
|
||||
@ -664,9 +668,9 @@ namespace Volian.Print.Library
|
||||
if (myMsg != null && myMsg != "")
|
||||
{
|
||||
if (myMsg.IndexOf(@"%d") > -1)
|
||||
myMsg = myMsg.Replace(@"%d", MyItemInfo.MyHLS.MyTab.CleanText.Trim());
|
||||
myMsg = myMsg.Replace(@"%d", MyItemInfo.MyHLS.MyTab.CleanTextNoSymbols.Trim());
|
||||
if (myMsg.IndexOf(@"%2d") > -1)
|
||||
myMsg = myMsg.Replace(@"%2d", MyItemInfo.MyHLS.MyTab.CleanText.Trim(" .".ToCharArray()).PadLeft(2));
|
||||
myMsg = myMsg.Replace(@"%2d", MyItemInfo.MyHLS.MyTab.CleanTextNoSymbols.Trim(" .".ToCharArray()).PadLeft(2));
|
||||
float msg_yLocation = 0;
|
||||
if (myMsg.Contains("{par}"))
|
||||
{
|
||||
@ -763,16 +767,16 @@ namespace Volian.Print.Library
|
||||
break;
|
||||
}
|
||||
|
||||
yPageStart = ChildrenAbove.ToPdf(cb, yPageStart, yTopMargin, yBottomMargin);
|
||||
yPageStart = ChildrenLeft.ToPdf(cb, yPageStart, yTopMargin, yBottomMargin);
|
||||
yPageStart = ChildrenAbove.ToPdf(cb, yPageStart, ref yTopMargin, ref yBottomMargin);
|
||||
yPageStart = ChildrenLeft.ToPdf(cb, yPageStart, ref yTopMargin, ref yBottomMargin);
|
||||
yPageStart = ParagraphToPdf(cb, yPageStart, yTopMargin, yBottomMargin);
|
||||
yPageStart = ChildrenRight.ToPdf(cb, yPageStart, yTopMargin, yBottomMargin);
|
||||
yPageStart = ChildrenBelow.ToPdf(cb, yPageStart, yTopMargin, yBottomMargin);
|
||||
yPageStart = ChildrenRight.ToPdf(cb, yPageStart, ref yTopMargin, ref yBottomMargin);
|
||||
yPageStart = ChildrenBelow.ToPdf(cb, yPageStart, ref yTopMargin, ref yBottomMargin);
|
||||
|
||||
if (MyItemInfo.IsHigh && MyItemInfo.NextItem == null) // last hls, add the 'end' message, if there is one
|
||||
{
|
||||
DocStyle docstyle = MyItemInfo.MyDocStyle;
|
||||
string myMsg = (docstyle.End == null) ? null : docstyle.End.Message;
|
||||
string myMsg = (docstyle.End == null) ? null : docstyle.End.FixedMessage;
|
||||
if (myMsg != null)
|
||||
{
|
||||
// If the flag is 0 or 1, just put the end message out right below this vlnParagraph:
|
||||
@ -785,11 +789,16 @@ namespace Volian.Print.Library
|
||||
}
|
||||
|
||||
if (myMsg.Contains("{Section Number}")) myMsg = myMsg.Replace("{Section Number}", MyItemInfo.ActiveSection.DisplayNumber);
|
||||
|
||||
//jcb code
|
||||
if(myMsg.Contains("%-8s"))
|
||||
myMsg = myMsg.Replace("%-8s",MyItemInfo.MyProcedure.DisplayNumber.PadRight(8));
|
||||
//end jb code
|
||||
// center the message.
|
||||
float wtpm = (float)docstyle.Layout.PageWidth - (float)docstyle.Layout.LeftMargin;
|
||||
float centerpos = XOffsetBox + (float)docstyle.Layout.LeftMargin + (wtpm - (myMsg.Length * MyItemInfo.FormatStepData.Font.CharsToTwips)) / 2;
|
||||
centerpos = Math.Max(centerpos, XOffsetBox + (float)docstyle.Layout.LeftMargin);
|
||||
MyPageHelper.BottomMessage = new vlnText(cb, this, myMsg, myMsg, centerpos, msg_yLocation, docstyle.End.Font);
|
||||
MyPageHelper.MyGaps.Add(new Gap(msg_yLocation, msg_yLocation - MyPageHelper.BottomMessage.Height));
|
||||
}
|
||||
}
|
||||
if (yLocalypagestart != yPageStart) DebugText.WriteLine("ToPdf-yPagestartDiff:{0},{1},{2},{3}", MyPageHelper.MyPdfContentByte.PdfWriter.CurrentPageNumber, MyItemInfo.ItemID, yLocalypagestart, yPageStart);
|
||||
@ -1081,15 +1090,35 @@ namespace Volian.Print.Library
|
||||
}
|
||||
// if this is the High Level RNO step (MyTopRNO) and we are numbering the RNO, adjust the xoffset to start the tab
|
||||
// at the x location rather than starting the text at the x location:
|
||||
if (!itemInfo.IsSection && itemInfo.FormatStepData.NumberHighLevel && itemInfo.IsRNOPart && itemInfo.ItemID == MyTopRNO.MyItemInfo.ItemID)
|
||||
AdjustWidth(itemInfo, maxRNO, formatInfo, mytab);
|
||||
bool adjustAgain = true;
|
||||
if (!itemInfo.IsSection && itemInfo.FormatStepData.NumberHighLevel && itemInfo.IsRNOPart && (MyTopRNO == null || itemInfo.ItemID == MyTopRNO.MyItemInfo.ItemID))
|
||||
{
|
||||
// adjust the x-offset of the RNO to include the tab.
|
||||
if (itemInfo.ActiveFormat.MyStepSectionLayoutData.RNOWidthSameAsHighParent)// && !itemInfo.MyParent.IsHigh)
|
||||
{
|
||||
vlnParagraph hls = GetHighLevelParagraph();
|
||||
float RnoOffset1 = ToInt(formatInfo.MyStepSectionLayoutData.ColRTable, maxRNO);
|
||||
float offset = hls.Width + RnoOffset1 + hls.XOffset;
|
||||
vlnTab tb = hls.PartsLeft[0] as vlnTab;
|
||||
//offset += tb.Width;
|
||||
if (MyTopRNO == null)
|
||||
Width -= (float)itemInfo.ActiveFormat.MyStepSectionLayoutData.SingleColumnRNOIndent;
|
||||
offset -= Width;
|
||||
float inc = offset - XOffset;
|
||||
if(mytab != null)
|
||||
mytab.XOffset += inc;// +(itemInfo.MyParent.IsHigh ? 6.8f : 0);
|
||||
XOffset += inc;
|
||||
adjustAgain = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
mytab.XOffset += mytab.Width;
|
||||
XOffset = mytab.XOffset + mytab.Width;
|
||||
}
|
||||
AdjustWidth(itemInfo, maxRNO, formatInfo, mytab);
|
||||
}
|
||||
if(adjustAgain)
|
||||
AdjustXOffsetForTab(itemInfo, maxRNO, formatInfo, mytab, xMetaAdj);
|
||||
|
||||
if (itemInfo.MyHeader != null && itemInfo.MyHeader.Text != null && !doSectTab)
|
||||
yoff += SetHeader(this, cb, itemInfo, formatInfo);
|
||||
float yoffLeft = yoff;
|
||||
@ -1331,8 +1360,6 @@ namespace Volian.Print.Library
|
||||
if (co != null)
|
||||
{
|
||||
float xloc_co = (float)itemInfo.MyDocStyle.Layout.LeftMargin;
|
||||
if (formatInfo.PlantFormat.FormatData.ProcData.CheckOffData.XLocation != null)
|
||||
xloc_co += (float)formatInfo.PlantFormat.FormatData.ProcData.CheckOffData.XLocation;
|
||||
// if the format has 'SkipSpaces', look at the tab, and back up the macros to the number of
|
||||
// spaces in the tab.
|
||||
if (formatInfo.PlantFormat.FormatData.ProcData.CheckOffData.SkipSpaces)
|
||||
@ -1342,6 +1369,16 @@ namespace Volian.Print.Library
|
||||
else
|
||||
xloc_co = XOffset; //there's no tab - put checkoff at step's xoff. Macro should back up from step's x.
|
||||
}
|
||||
else
|
||||
{
|
||||
if (formatInfo.PlantFormat.FormatData.ProcData.CheckOffData.XLocation != null)
|
||||
xloc_co += (float)formatInfo.PlantFormat.FormatData.ProcData.CheckOffData.XLocation;
|
||||
if (formatInfo.PlantFormat.FormatData.ProcData.CheckOffData.RelXLocation != null)
|
||||
{
|
||||
float relX = (float)formatInfo.PlantFormat.FormatData.ProcData.CheckOffData.RelXLocation;
|
||||
xloc_co = XOffset + (relX > 0 ? Width : 0) + relX;
|
||||
}
|
||||
}
|
||||
PartsRight.Add(new vlnMacro(xloc_co, yForCheckoff, co.Macro));
|
||||
}
|
||||
float yOffRight = yoff;
|
||||
@ -2048,7 +2085,7 @@ namespace Volian.Print.Library
|
||||
iilvl = iilvl.MyParent;
|
||||
}
|
||||
level = level <= 2 ? 1 : level - 1;
|
||||
if (level == 1)
|
||||
if (level==1)
|
||||
XOffset = (float)itemInfo.MyDocStyle.Layout.LeftMargin + (level * (float)formatInfo.PlantFormat.FormatData.SectData.SectionHeader.Pos);
|
||||
else
|
||||
{
|
||||
@ -2067,7 +2104,7 @@ namespace Volian.Print.Library
|
||||
{
|
||||
float x = 0;
|
||||
float xoff = 0;
|
||||
if ((colOvrd ?? 0) != 0)
|
||||
if ((colOvrd??0)!=0)
|
||||
x = (float)itemInfo.MyDocStyle.Layout.LeftMargin + (float)colOvrd;
|
||||
else
|
||||
x = (float)itemInfo.MyDocStyle.Layout.LeftMargin + (float)formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ColS;
|
||||
@ -2083,7 +2120,7 @@ namespace Volian.Print.Library
|
||||
float colsbylevel = (float)formatInfo.PlantFormat.FormatData.SectData.MetaSectionList[indxLevel % formatInfo.PlantFormat.FormatData.SectData.MetaSectionList.Count].ColSByLevel;
|
||||
float seclvlindent = colsbylevel - (float)formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ColS;
|
||||
float adjCols = (float)formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ColS + seclvlindent;
|
||||
float xtabcol = adjCols - ((myTab == null || myTab.Text == null) ? 0 : (myTab.Text.Length * 7.2f));
|
||||
float xtabcol = adjCols - ((myTab==null||myTab.Text==null)?0:(myTab.Text.Length * 7.2f));
|
||||
if (indxLevel > 1 && myTab != null) myTab.XOffset = (float)itemInfo.MyDocStyle.Layout.LeftMargin + xtabcol;
|
||||
else if (myTab != null) myTab.XOffset = (float)itemInfo.MyDocStyle.Layout.LeftMargin + colsbylevel;
|
||||
if (myTab != null)
|
||||
@ -2157,7 +2194,7 @@ namespace Volian.Print.Library
|
||||
}
|
||||
// if the step is within the rno and we're numbering the high level rno, we've got to account for the
|
||||
// indenting (increased x offset) for the top level rno's tab, if there is no top level rno:
|
||||
if (itemInfo.FormatStepData.NumberHighLevel && (itemInfo.MyHLS.RNOs == null || itemInfo.MyHLS.RNOs.Count <= 0))
|
||||
if (itemInfo.FormatStepData.NumberHighLevel && (itemInfo.MyHLS.RNOs == null || itemInfo.MyHLS.RNOs.Count<=0))
|
||||
{
|
||||
// add in the size that an RNO off HLS would take.
|
||||
XOffset += tabWidth;
|
||||
@ -2174,7 +2211,7 @@ namespace Volian.Print.Library
|
||||
// the tab. The offset of text needs to be adjusted by the 'leftjustify' format variable
|
||||
// if it existed for this level.
|
||||
myTab.XOffset += tabWidth;
|
||||
if (tableftadj != 0 && myTab.Width < tableftadj)
|
||||
if (tableftadj != 0 && myTab.Width<tableftadj)
|
||||
tabWidth = myTab.Width = tableftadj;
|
||||
XOffset += tabWidth;
|
||||
myTab.Rtf = myTab.Rtf.Replace(myTab.Text, myTab.Text.TrimStart(" ".ToCharArray()));
|
||||
@ -2328,6 +2365,9 @@ namespace Volian.Print.Library
|
||||
else
|
||||
{
|
||||
float adjwidth = 0;
|
||||
if (itemInfo.IsRNOPart && itemInfo.ActiveFormat.MyStepSectionLayoutData.RNOWidthSameAsHighParent && itemInfo.MyParent.IsHigh)
|
||||
Width = adjwidth + MyParent.Width;
|
||||
else
|
||||
Width = adjwidth + MyParent.Width - tabWidth + (myTab == null ? 0 : myTab.TabAlign);
|
||||
}
|
||||
}
|
||||
|
@ -161,7 +161,7 @@ namespace Volian.Print.Library
|
||||
// Width for placement of macro should be position in the string where the macro was located.
|
||||
float lwidth = MyFont.CharsToTwips * (origTab.Length - meindx - 1);
|
||||
MyMacro = new vlnMacro(xoffset - lwidth, yoffset, macro.Substring(2, macro.Length - 3));
|
||||
|
||||
xoffset += myparent.MyItemInfo.FormatStepData.TabData.MacroTabAdjust ?? 0;
|
||||
origTab = origTab.Replace(macro, "");
|
||||
cleanTab = origTab;
|
||||
if (CCCs != IIIs)
|
||||
@ -208,7 +208,6 @@ namespace Volian.Print.Library
|
||||
int indxC = origTab.IndexOf(":");
|
||||
origTab = @"\ul " + origTab.Substring(0, indxC) + @"\ulnone" + origTab.Substring(indxC);
|
||||
}
|
||||
|
||||
Rtf = GetRtf(origTab, vFont);
|
||||
Rtf = Rtf.Replace("\u0394", @"\f1\u916?\f0 "); // delta 0x0394
|
||||
if (ScriptCaution)
|
||||
|
@ -35,7 +35,7 @@ namespace Volian.Print.Library
|
||||
Rtf = GetRtf(origText, vFont);
|
||||
XOffset = xoffset;
|
||||
MyFont = vFont;
|
||||
Width = MyFont.CharsToTwips * (Text.Length + 2);
|
||||
Width = MyFont.CharsToTwips * (Text.Length + 5);
|
||||
}
|
||||
public vlnText()
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user