This commit is contained in:
parent
591f3df242
commit
7f58611e6b
@ -214,7 +214,8 @@ namespace VEPROMS.CSLA.Library
|
|||||||
|
|
||||||
Partials = 0x10000, // Do replace even on partial matches
|
Partials = 0x10000, // Do replace even on partial matches
|
||||||
Plackeep = 0x20000, // Do replace in PlaceKeepers
|
Plackeep = 0x20000, // Do replace in PlaceKeepers
|
||||||
InSecTitle = 0x40000
|
InSecTitle = 0x40000,
|
||||||
|
BeforeTrans = 0x80000 // Only do replace if the string occurs immediately before a transition.
|
||||||
}
|
}
|
||||||
public enum E_ArrowKeys : uint
|
public enum E_ArrowKeys : uint
|
||||||
{
|
{
|
||||||
|
@ -5022,6 +5022,14 @@ namespace VEPROMS.CSLA.Library
|
|||||||
return LazyLoad(ref _LowerCaseStepInTran, "@LowerCaseStepInTran");
|
return LazyLoad(ref _LowerCaseStepInTran, "@LowerCaseStepInTran");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
private LazyLoad<bool> _BoldTransition;
|
||||||
|
public bool BoldTransition
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return LazyLoad(ref _BoldTransition, "@BoldTransition");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
#region TransType
|
#region TransType
|
||||||
|
@ -137,9 +137,11 @@ namespace Volian.Controls.Library
|
|||||||
// lines (the 2 spaces after the first "\par " command and 1 space before 2nd "\par"). Tried other
|
// lines (the 2 spaces after the first "\par " command and 1 space before 2nd "\par"). Tried other
|
||||||
// combinations that did not work.
|
// combinations that did not work.
|
||||||
if (_MyItemInfo.FormatStepData.Prefix != null && _MyItemInfo.FormatStepData.Prefix != "")
|
if (_MyItemInfo.FormatStepData.Prefix != null && _MyItemInfo.FormatStepData.Prefix != "")
|
||||||
text = ReplaceLinesWithUnicode(_MyItemInfo.FormatStepData.Prefix) + @"\par " + text + @"\par ";
|
text = !_MyItemInfo.FormatStepData.Font.FontIsProportional() ? ReplaceLinesWithUnicode(_MyItemInfo.FormatStepData.Prefix) + @"\par " + text + @"\par ":
|
||||||
|
@"\par " + text + @"\par ";
|
||||||
if (_MyItemInfo.FormatStepData.Suffix != null && _MyItemInfo.FormatStepData.Suffix != "")
|
if (_MyItemInfo.FormatStepData.Suffix != null && _MyItemInfo.FormatStepData.Suffix != "")
|
||||||
text = text + ReplaceLinesWithUnicode(_MyItemInfo.FormatStepData.Suffix);
|
text = text + (!_MyItemInfo.FormatStepData.Font.FontIsProportional() ? ReplaceLinesWithUnicode(_MyItemInfo.FormatStepData.Suffix) :
|
||||||
|
@"\par\par\par ");
|
||||||
}
|
}
|
||||||
text = CreateRtf(colorLinks, text, tableShouldBeOutlined, wordsShouldBeReplaced, numbersShouldBeFormated, tableHasBorder, ROsShouldBeAdjusted);
|
text = CreateRtf(colorLinks, text, tableShouldBeOutlined, wordsShouldBeReplaced, numbersShouldBeFormated, tableHasBorder, ROsShouldBeAdjusted);
|
||||||
StartText = text;
|
StartText = text;
|
||||||
@ -207,7 +209,7 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
// Adjust RO display
|
// Adjust RO display
|
||||||
if (ROsShouldBeAdjusted)
|
if (ROsShouldBeAdjusted)
|
||||||
text = DoTransitionAdjustments(text);
|
text = DoTransitionAdjustments(text, _MyItemInfo.ActiveFormat.PlantFormat.FormatData.TransData.BoldTransition);
|
||||||
// add colors around links:
|
// add colors around links:
|
||||||
if (colorLinks)
|
if (colorLinks)
|
||||||
text = DoColorLinks(text);
|
text = DoColorLinks(text);
|
||||||
@ -390,7 +392,7 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
private string DoTransitionAdjustments(string text)
|
private string DoTransitionAdjustments(string text, bool boldTran)
|
||||||
{
|
{
|
||||||
string strippedText = StaticStripRtfCommands(text);
|
string strippedText = StaticStripRtfCommands(text);
|
||||||
string lookFor = string.Format(@"<START\](\\[^v \\]+)*\\v0(\\[^v \\]+)* (.*?)(\\[^v \\]+)*\\v(\\[^v \\]+)* #Link:(ReferencedObject|Transition[^:]*?):[0-9]* ([0-9]*).*?\[END>");
|
string lookFor = string.Format(@"<START\](\\[^v \\]+)*\\v0(\\[^v \\]+)* (.*?)(\\[^v \\]+)*\\v(\\[^v \\]+)* #Link:(ReferencedObject|Transition[^:]*?):[0-9]* ([0-9]*).*?\[END>");
|
||||||
@ -411,16 +413,22 @@ namespace Volian.Controls.Library
|
|||||||
System.Text.RegularExpressions.Group g = m.Groups[3];
|
System.Text.RegularExpressions.Group g = m.Groups[3];
|
||||||
string beforeTran = retstr.Substring(0, g.Index);
|
string beforeTran = retstr.Substring(0, g.Index);
|
||||||
string afterTran = retstr.Substring(g.Index + g.Length);
|
string afterTran = retstr.Substring(g.Index + g.Length);
|
||||||
|
|
||||||
|
// if replacing text in the 'beforeTran' string, then do it here,
|
||||||
|
// i.e. there is a format flag 'BeforeTrans' that bolds text before the transition
|
||||||
|
// (in wst formats).
|
||||||
|
beforeTran = DoBeforeTransFlagSupport(beforeTran, _MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.ReplaceStrList);
|
||||||
|
|
||||||
string newvalue = g.ToString();
|
string newvalue = g.ToString();
|
||||||
int indexLastSpace = newvalue.LastIndexOf(' ');
|
int indexLastSpace = newvalue.LastIndexOf(' ');
|
||||||
if (indexLastSpace >= 0)
|
if (indexLastSpace >= 0)
|
||||||
// Use a "\x1" as a token to replace later. Insert the unicode char, whose length is
|
// Use a "\x1" as a token to replace later. Insert the unicode char, whose length is
|
||||||
// more than 1 character was throwing of the regexp Matches index, so that the resulting
|
// more than 1 character was throwing of the regexp Matches index, so that the resulting
|
||||||
// string may have been incorrect.
|
// string may have been incorrect.
|
||||||
retstr = beforeTran + newvalue.Substring(0, indexLastSpace) + "\x1" + newvalue.Substring(indexLastSpace + 1) + afterTran;
|
retstr = beforeTran + (boldTran ? @"\b " : null) + newvalue.Substring(0, indexLastSpace) + "\x1" + newvalue.Substring(indexLastSpace + 1) + (boldTran ? @"\b0" : null) + afterTran;
|
||||||
else
|
else
|
||||||
if (beforeTran.EndsWith(" ") )
|
if (beforeTran.EndsWith(" ") )
|
||||||
retstr = ReplaceLastSpaceWithHardSpace(beforeTran) + newvalue + afterTran;
|
retstr = ReplaceLastSpaceWithHardSpace(beforeTran) + (boldTran ? @"\b " : null) + newvalue + (boldTran ? @"\b0" : null) + afterTran;
|
||||||
else
|
else
|
||||||
Console.Write("");// Don't know where to put the Hard Space
|
Console.Write("");// Don't know where to put the Hard Space
|
||||||
}
|
}
|
||||||
@ -428,6 +436,31 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
return retstr.Replace("\x1", @"\u160?");
|
return retstr.Replace("\x1", @"\u160?");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private string DoBeforeTransFlagSupport(string beforeTran, ReplaceStrList replaceStrList)
|
||||||
|
{
|
||||||
|
foreach (ReplaceStr repstr in replaceStrList)
|
||||||
|
{
|
||||||
|
if ((repstr.Flag & E_ReplaceFlags.BeforeTrans) > 0)
|
||||||
|
{
|
||||||
|
// the beforeTran string ends with the string that starts the transition comment, i.e.
|
||||||
|
// '\\v <START] \\v0 '. The replace word string needs to be before this:
|
||||||
|
int indx = beforeTran.LastIndexOf(@"\v <START]\v0");
|
||||||
|
if (indx > -1)
|
||||||
|
{
|
||||||
|
string findit = beforeTran.Substring(0, beforeTran.LastIndexOf(@"\v <START]\v0"));
|
||||||
|
if (findit != null && findit.Trim().ToUpper().EndsWith(repstr.ReplaceWord.ToUpper()))
|
||||||
|
{
|
||||||
|
int rindx = findit.Trim().ToUpper().IndexOf(repstr.ReplaceWord.ToUpper());
|
||||||
|
// don't replace string because case of words may be match replace with string.
|
||||||
|
beforeTran = findit.Substring(0, rindx) + @"\b " + findit.Substring(rindx) + @"\b0" + beforeTran.Substring(indx);
|
||||||
|
return beforeTran;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return beforeTran;
|
||||||
|
}
|
||||||
private string ReplaceLastSpaceWithHardSpace(string str)
|
private string ReplaceLastSpaceWithHardSpace(string str)
|
||||||
{
|
{
|
||||||
int ind =str.LastIndexOf("<START]");
|
int ind =str.LastIndexOf("<START]");
|
||||||
|
@ -177,13 +177,13 @@ namespace Volian.Print.Library
|
|||||||
if (doprint)retval = DrawText(cb, ref yPageStart, yTopMargin, yBottomMargin, ref yLocation);
|
if (doprint)retval = DrawText(cb, ref yPageStart, yTopMargin, yBottomMargin, ref yLocation);
|
||||||
if (MyItemInfo.IsHigh)
|
if (MyItemInfo.IsHigh)
|
||||||
{
|
{
|
||||||
MyPageHelper.PageBookmarks.Add(MyItemInfo, MyItemInfo.MyTab.CleanText + " " + MyItemInfo.DisplayText,
|
MyPageHelper.PageBookmarks.Add(MyItemInfo, (MyItemInfo.MyTab == null)?"":MyItemInfo.MyTab.CleanText + " " + MyItemInfo.DisplayText,
|
||||||
new PdfDestination(PdfDestination.FITBH, yLocation + YVeryTop - YTopMost + SixLinesPerInch));
|
new PdfDestination(PdfDestination.FITBH, yLocation + YVeryTop - YTopMost + SixLinesPerInch));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.WolfcreekCKLFormat)
|
if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.WolfcreekCKLFormat)
|
||||||
{
|
{
|
||||||
WCN_DrawBoxLines(cb, MyItemInfo, yPageStart, yTopMargin, yBottomMargin, yLocation);
|
DrawChkOrValveTableLines(cb, MyItemInfo, yPageStart, yTopMargin, yBottomMargin, yLocation);
|
||||||
}
|
}
|
||||||
if (MyItemInfo.IsSection)
|
if (MyItemInfo.IsSection)
|
||||||
{
|
{
|
||||||
@ -208,18 +208,15 @@ namespace Volian.Print.Library
|
|||||||
//if (localYPageStart != yPageStart) DebugText.WriteLine("ParToPdf-yPagestartDiff:{0},{1},{2}", MyItemInfo.ItemID, localYPageStart, yPageStart);
|
//if (localYPageStart != yPageStart) DebugText.WriteLine("ParToPdf-yPagestartDiff:{0},{1},{2}", MyItemInfo.ItemID, localYPageStart, yPageStart);
|
||||||
return yPageStart;
|
return yPageStart;
|
||||||
}
|
}
|
||||||
// A few things need completed for the WCNCKL format check list boxes:
|
private void DrawChkOrValveTableLines(PdfContentByte cb, ItemInfo ii, float yPageStart, float yTopMargin, float yBottomMargin, float yLocation)
|
||||||
// 1) support pagination. This includes tacking on a continued message, breaking table where necessary
|
|
||||||
// and putting HLS on top of next page, along with its prefix/suffix.
|
|
||||||
// 2) support seven lines per inch - right now increments are hard coded at 12 = one line.
|
|
||||||
private void WCN_DrawBoxLines(PdfContentByte cb, ItemInfo ii, float yPageStart, float yTopMargin, float yBottomMargin, float yLocation)
|
|
||||||
{
|
{
|
||||||
if (!ii.IsStep || ii.IsCaution || ii.IsNote) return;
|
if (!ii.IsStep || ii.IsCaution || ii.IsNote) return;
|
||||||
|
|
||||||
|
Box bx = ii.ActiveFormat.PlantFormat.FormatData.BoxList[0];
|
||||||
float lpi = MyPageHelper.YMultiplier == 1.0 ? SixLinesPerInch : _SevenLinesPerInch;
|
float lpi = MyPageHelper.YMultiplier == 1.0 ? SixLinesPerInch : _SevenLinesPerInch;
|
||||||
bool savedebug = Rtf2Pdf.PdfDebug;
|
bool savedebug = Rtf2Pdf.PdfDebug;
|
||||||
Rtf2Pdf.PdfDebug = false;
|
Rtf2Pdf.PdfDebug = false;
|
||||||
System.Drawing.Font symbFont = new System.Drawing.Font("VESymbFix", 10);
|
System.Drawing.Font symbFont = new System.Drawing.Font("VESymbFix", (float)ii.FormatStepData.Font.Size);
|
||||||
iTextSharp.text.Font iSymblFont = Volian.Svg.Library.VolianPdf.GetFont(symbFont);
|
iTextSharp.text.Font iSymblFont = Volian.Svg.Library.VolianPdf.GetFont(symbFont);
|
||||||
iSymblFont.Color = new iTextSharp.text.Color(PrintOverride.OverrideTextColor(System.Drawing.Color.Black));
|
iSymblFont.Color = new iTextSharp.text.Color(PrintOverride.OverrideTextColor(System.Drawing.Color.Black));
|
||||||
// The vertPos array from the format defines the column locations:
|
// The vertPos array from the format defines the column locations:
|
||||||
@ -239,6 +236,87 @@ namespace Volian.Print.Library
|
|||||||
int countLine = 0;
|
int countLine = 0;
|
||||||
string preSuf_Fix = (ii.FormatStepData.Prefix != null && ii.FormatStepData.Prefix != "") ? ii.FormatStepData.Prefix : null;
|
string preSuf_Fix = (ii.FormatStepData.Prefix != null && ii.FormatStepData.Prefix != "") ? ii.FormatStepData.Prefix : null;
|
||||||
if (preSuf_Fix != null) countLine++; // account for a line of prefix (if no \par)
|
if (preSuf_Fix != null) countLine++; // account for a line of prefix (if no \par)
|
||||||
|
// if this is a proportional font, need to 'draw' the prefix/suffix. NOTE that the suffix should
|
||||||
|
// just list the headers and the prefix can be 'empty'.
|
||||||
|
if (ii.FormatStepData.Font.FontIsProportional())
|
||||||
|
{
|
||||||
|
float yLocVertLine = yLocation + (lpi/2);
|
||||||
|
// Prefix, i.e. Top line:
|
||||||
|
Paragraph topLeftLine = new Paragraph(bx.BXULC, iSymblFont);
|
||||||
|
Rtf2Pdf.TextAt(cb, topLeftLine, float.Parse(vertPos[0]) + (float)ii.MyDocStyle.Layout.LeftMargin - csize, yLocVertLine, lWidth, 100, null, yBottomMargin);
|
||||||
|
Paragraph topRightLine = new Paragraph(bx.BXURC, iSymblFont);
|
||||||
|
Rtf2Pdf.TextAt(cb, topRightLine, float.Parse(vertPos[cntVertPos - 1]) + (float)ii.MyDocStyle.Layout.LeftMargin - csize, yLocVertLine, lWidth, 100, null, yBottomMargin);
|
||||||
|
Paragraph horzLine = new Paragraph(bx.BXHorz, iSymblFont);
|
||||||
|
float thPos = float.Parse(vertPos[0]) + csize;
|
||||||
|
while (thPos < float.Parse(vertPos[cntVertPos - 1]))
|
||||||
|
{
|
||||||
|
Rtf2Pdf.TextAt(cb, horzLine, thPos + (float)ii.MyDocStyle.Layout.LeftMargin - csize, yLocVertLine, lWidth, 100, null, yBottomMargin);
|
||||||
|
thPos += csize;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Vertical Lines around HLS
|
||||||
|
//int countLine = (int)(this.Height / lpi);
|
||||||
|
yLocVertLine = yLocation - (lpi / 2);
|
||||||
|
for (int i = 0; i < 1; i++)
|
||||||
|
{
|
||||||
|
Rtf2Pdf.TextAt(cb, paraVertLine, float.Parse(vertPos[0]) + (float)ii.MyDocStyle.Layout.LeftMargin - csize, yLocVertLine, lWidth, 100, null, yBottomMargin);
|
||||||
|
Rtf2Pdf.TextAt(cb, paraVertLine, float.Parse(vertPos[cntVertPos - 1]) + (float)ii.MyDocStyle.Layout.LeftMargin - csize, yLocVertLine, lWidth, 100, null, yBottomMargin);
|
||||||
|
yLocVertLine -= lpi;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Suffix, i.e. Column headers.
|
||||||
|
// first do left/right side chars above and below column headers
|
||||||
|
//countLine = (int)(this.Height / lpi);
|
||||||
|
Paragraph sideLeftLine = new Paragraph(bx.BXMLS, iSymblFont);
|
||||||
|
Rtf2Pdf.TextAt(cb, sideLeftLine, float.Parse(vertPos[0]) + (float)ii.MyDocStyle.Layout.LeftMargin - csize, yLocVertLine, lWidth, 100, null, yBottomMargin);
|
||||||
|
Rtf2Pdf.TextAt(cb, sideLeftLine, float.Parse(vertPos[0]) + (float)ii.MyDocStyle.Layout.LeftMargin - csize, yLocVertLine-(2*lpi), lWidth, 100, null, yBottomMargin);
|
||||||
|
Paragraph sideRightLine = new Paragraph(bx.BXMRS, iSymblFont);
|
||||||
|
Rtf2Pdf.TextAt(cb, sideRightLine, float.Parse(vertPos[6]) + (float)ii.MyDocStyle.Layout.LeftMargin - csize, yLocVertLine, lWidth, 100, null, yBottomMargin);
|
||||||
|
Rtf2Pdf.TextAt(cb, sideRightLine, float.Parse(vertPos[6]) + (float)ii.MyDocStyle.Layout.LeftMargin - csize, yLocVertLine - (2 * lpi), lWidth, 100, null, yBottomMargin);
|
||||||
|
|
||||||
|
// now do the lines with the 'T' type lines for top/bottom of vertical lines.
|
||||||
|
thPos = float.Parse(vertPos[0]) + csize;
|
||||||
|
while (thPos < float.Parse(vertPos[cntVertPos - 1]))
|
||||||
|
{
|
||||||
|
Rtf2Pdf.TextAt(cb, horzLine, thPos + (float)ii.MyDocStyle.Layout.LeftMargin - csize, yLocVertLine, lWidth, 100, null, yBottomMargin);
|
||||||
|
Rtf2Pdf.TextAt(cb, horzLine, thPos + (float)ii.MyDocStyle.Layout.LeftMargin - csize, yLocVertLine - (2 * lpi), lWidth, 100, null, yBottomMargin);
|
||||||
|
thPos += csize;
|
||||||
|
}
|
||||||
|
|
||||||
|
// now do the vertical bar between header words and the column header words.
|
||||||
|
yLocVertLine -= lpi;
|
||||||
|
string [] colHdrs = _MyItemInfo.FormatStepData.Suffix.Substring(_MyItemInfo.FormatStepData.Suffix.IndexOf(";")+1).Split(",".ToCharArray());
|
||||||
|
iTextSharp.text.Font iHdrFont = Volian.Svg.Library.VolianPdf.GetFont(_MyItemInfo.FormatStepData.Font.WindowsFont);
|
||||||
|
iHdrFont.Color = new iTextSharp.text.Color(PrintOverride.OverrideTextColor(System.Drawing.Color.Black));
|
||||||
|
|
||||||
|
Paragraph topT = new Paragraph(bx.BXUMID, iSymblFont);
|
||||||
|
Paragraph crossT = new Paragraph(bx.BXMID, iSymblFont);
|
||||||
|
|
||||||
|
for (int i = 0; i < cntVertPos; i++)
|
||||||
|
{
|
||||||
|
// do vertical line:
|
||||||
|
Rtf2Pdf.TextAt(cb, paraVertLine, float.Parse(vertPos[i]) + (float)ii.MyDocStyle.Layout.LeftMargin - csize, yLocVertLine, lWidth, 100, null, yBottomMargin);
|
||||||
|
// do the column header text - center it:
|
||||||
|
if (i<colHdrs.Length)
|
||||||
|
{
|
||||||
|
Paragraph parColHdr = new Paragraph(colHdrs[i], iHdrFont);
|
||||||
|
// find the center point of column header and subtract 1/2 width of the text to locate the text.
|
||||||
|
float hloc = (float.Parse(vertPos[i]) + ((float.Parse(vertPos[i + 1]) - float.Parse(vertPos[i])) / 2));
|
||||||
|
Chunk chk = (Chunk)parColHdr.Chunks[0];
|
||||||
|
hloc = hloc - (chk.GetWidthPoint() / 2);
|
||||||
|
Rtf2Pdf.TextAt(cb, parColHdr, hloc + (float)ii.MyDocStyle.Layout.LeftMargin, yLocVertLine, lWidth, 100, null, yBottomMargin);
|
||||||
|
}
|
||||||
|
// Do the crosswise table characters, i.e. T and +
|
||||||
|
if (i > 0 && i < colHdrs.Length)
|
||||||
|
{
|
||||||
|
Rtf2Pdf.TextAt(cb, topT, float.Parse(vertPos[i]) + (float)ii.MyDocStyle.Layout.LeftMargin - csize, yLocVertLine + lpi, lWidth, 100, null, yBottomMargin);
|
||||||
|
Rtf2Pdf.TextAt(cb, crossT, float.Parse(vertPos[i]) + (float)ii.MyDocStyle.Layout.LeftMargin - csize, yLocVertLine - lpi, lWidth, 100, null, yBottomMargin);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
#region OriginalHLS
|
||||||
|
{
|
||||||
int hIndx = preSuf_Fix.IndexOf(@"{\par}");
|
int hIndx = preSuf_Fix.IndexOf(@"{\par}");
|
||||||
while (preSuf_Fix != null && hIndx >= 0)
|
while (preSuf_Fix != null && hIndx >= 0)
|
||||||
{
|
{
|
||||||
@ -256,7 +334,7 @@ namespace Volian.Print.Library
|
|||||||
// get first and last vertpos for location of lines:
|
// get first and last vertpos for location of lines:
|
||||||
// for each line of text, draw the start & end box line:
|
// for each line of text, draw the start & end box line:
|
||||||
countLine = (int)(this.Height / lpi) - countLine;
|
countLine = (int)(this.Height / lpi) - countLine;
|
||||||
float yLocVertLine = yLocation - lpi/2;
|
float yLocVertLine = yLocation - lpi / 2;
|
||||||
for (int i = 0; i < countLine; i++)
|
for (int i = 0; i < countLine; i++)
|
||||||
{
|
{
|
||||||
Rtf2Pdf.TextAt(cb, paraVertLine, float.Parse(vertPos[0]) + (float)ii.MyDocStyle.Layout.LeftMargin - csize, yLocVertLine, lWidth, 100, null, yBottomMargin);
|
Rtf2Pdf.TextAt(cb, paraVertLine, float.Parse(vertPos[0]) + (float)ii.MyDocStyle.Layout.LeftMargin - csize, yLocVertLine, lWidth, 100, null, yBottomMargin);
|
||||||
@ -264,12 +342,14 @@ namespace Volian.Print.Library
|
|||||||
yLocVertLine -= lpi;
|
yLocVertLine -= lpi;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endregion OriginalHLS
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// This section of code draws the lines around the substeps (the actual table part)
|
||||||
Paragraph horzLine = new Paragraph(ii.ActiveFormat.PlantFormat.FormatData.BoxList[0].BXHorz, iSymblFont);
|
Paragraph horzLine = new Paragraph(ii.ActiveFormat.PlantFormat.FormatData.BoxList[0].BXHorz, iSymblFont);
|
||||||
bool bottomOfTable = (ii.NextItem == null || ii.NextItemCount == 0) ||
|
bool bottomOfTable = (ii.NextItem == null || ii.NextItemCount == 0) ||
|
||||||
(MyPageHelper.ParaBreaks.Count > 0 && MyPageHelper.ParaBreaks[0].MyItemInfo.ItemID == ii.NextItem.ItemID);
|
(MyPageHelper.ParaBreaks.Count > 0 && MyPageHelper.ParaBreaks[0].MyItemInfo.ItemID == ii.NextItem.ItemID);
|
||||||
Box bx = ii.ActiveFormat.PlantFormat.FormatData.BoxList[0];
|
|
||||||
// if bottom of table use different cross/beg/end chars than if in middle of table.
|
// if bottom of table use different cross/beg/end chars than if in middle of table.
|
||||||
Paragraph leftLine = new Paragraph(bottomOfTable ? bx.BXLLC : bx.BXMLS, iSymblFont);
|
Paragraph leftLine = new Paragraph(bottomOfTable ? bx.BXLLC : bx.BXMLS, iSymblFont);
|
||||||
Paragraph rightLine = new Paragraph(bottomOfTable ? bx.BXLRC : bx.BXMRS, iSymblFont);
|
Paragraph rightLine = new Paragraph(bottomOfTable ? bx.BXLRC : bx.BXMRS, iSymblFont);
|
||||||
@ -360,7 +440,10 @@ namespace Volian.Print.Library
|
|||||||
// multiplier accounts for both.
|
// multiplier accounts for both.
|
||||||
if (!MyItemInfo.IsStepSection && MyItemInfo.FormatStepData.CenterOneLineOnly && MyItemInfo.MyPrevious == null && MyItemInfo.NextItem == null && Height < (1.2F * IParagraph.Leading))
|
if (!MyItemInfo.IsStepSection && MyItemInfo.FormatStepData.CenterOneLineOnly && MyItemInfo.MyPrevious == null && MyItemInfo.NextItem == null && Height < (1.2F * IParagraph.Leading))
|
||||||
IParagraph.Alignment = Element.ALIGN_CENTER;
|
IParagraph.Alignment = Element.ALIGN_CENTER;
|
||||||
if (!MyItemInfo.IsStepSection && MyItemInfo.FormatStepData.StepPrintData.Justify == "Center")
|
// if this step is centered, but not part of the checklist or valvelist format, use itextsharp to center it.
|
||||||
|
// if it was part of the checklist or valvelist, then the centering is based on the column definitions for the table and
|
||||||
|
// was calculated when the paragraph was made.
|
||||||
|
if (!MyItemInfo.IsStepSection && MyItemInfo.FormatStepData.StepPrintData.Justify == "Center" && !MyItemInfo.FormatStepData.StepLayoutData.AlignWithParentTab)
|
||||||
IParagraph.Alignment = Element.ALIGN_CENTER;
|
IParagraph.Alignment = Element.ALIGN_CENTER;
|
||||||
retval = Rtf2Pdf.TextAt(cb, IParagraph, XOffset, yLocation, Width, 100, DebugInfo, yBottomMargin);
|
retval = Rtf2Pdf.TextAt(cb, IParagraph, XOffset, yLocation, Width, 100, DebugInfo, yBottomMargin);
|
||||||
if (retval == 0) // problem occurred - paragraph was not able to be printed on page
|
if (retval == 0) // problem occurred - paragraph was not able to be printed on page
|
||||||
@ -1080,9 +1163,20 @@ namespace Volian.Print.Library
|
|||||||
{
|
{
|
||||||
int stplevl = TheStepLevel(itemInfo);
|
int stplevl = TheStepLevel(itemInfo);
|
||||||
if (stplevl >= 0 && MyItemInfo.MyHLS.FormatStepData.VertPos[stplevl] > 0)
|
if (stplevl >= 0 && MyItemInfo.MyHLS.FormatStepData.VertPos[stplevl] > 0)
|
||||||
|
{
|
||||||
|
if (MyItemInfo.FormatStepData.StepPrintData.Justify == "Center")
|
||||||
|
{
|
||||||
|
string[] vertPos = MyItemInfo.MyHLS.FormatStepData.VertPos.Split(",".ToCharArray());
|
||||||
|
float hloc = (float.Parse(vertPos[stplevl]) + ((float.Parse(vertPos[stplevl + 1]) - float.Parse(vertPos[stplevl])) / 2));
|
||||||
|
Chunk chk = (Chunk)IParagraph.Chunks[0];
|
||||||
|
hloc = hloc - (chk.GetWidthPoint() / 2);
|
||||||
|
XOffset = hloc + (float)itemInfo.MyDocStyle.Layout.LeftMargin;
|
||||||
|
}
|
||||||
|
else
|
||||||
XOffset = float.Parse(MyItemInfo.MyHLS.FormatStepData.VertPos.Split(",".ToCharArray())[stplevl]) + (float)itemInfo.MyDocStyle.Layout.LeftMargin;
|
XOffset = float.Parse(MyItemInfo.MyHLS.FormatStepData.VertPos.Split(",".ToCharArray())[stplevl]) + (float)itemInfo.MyDocStyle.Layout.LeftMargin;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (itemInfo.IsTablePart) // Not for grid, this is for old-style tables.
|
if (itemInfo.IsTablePart) // Not for grid, this is for old-style tables.
|
||||||
{
|
{
|
||||||
Width = GetTableWidth(cb, IParagraph, MyItemInfo.MyDocStyle.Layout.PageWidth);
|
Width = GetTableWidth(cb, IParagraph, MyItemInfo.MyDocStyle.Layout.PageWidth);
|
||||||
@ -2079,6 +2173,11 @@ namespace Volian.Print.Library
|
|||||||
Width = ToInt(formatInfo.MyStepSectionLayoutData.WidSTablePrint, maxRNO);
|
Width = ToInt(formatInfo.MyStepSectionLayoutData.WidSTablePrint, maxRNO);
|
||||||
Width += _WidthAdjust;
|
Width += _WidthAdjust;
|
||||||
Width += adjwidth;
|
Width += adjwidth;
|
||||||
|
|
||||||
|
// if AlignHLSTabWithSect is set, we moved the starting x location of the HLS, and following steps
|
||||||
|
// to be under section header. Adjust the width accordingly, or the text may go out of the margin.
|
||||||
|
if (itemInfo.MyDocStyle.AlignHLSTabWithSect)
|
||||||
|
Width = Width - (float)formatInfo.PlantFormat.FormatData.SectData.SectionHeader.Pos;
|
||||||
}
|
}
|
||||||
else if (itemInfo.IsCaution || itemInfo.IsNote)
|
else if (itemInfo.IsCaution || itemInfo.IsNote)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user