Use memory data rather than database for finding next item (fixes problem where next item is not ‘applicable’ for procedure being printed
Add support for Point Beach asterisk boxes (and the boxes bold font)
This commit is contained in:
parent
154dbeabb8
commit
9689726c43
@ -851,14 +851,15 @@ namespace Volian.Print.Library
|
||||
else if(!myItemInfo.MyDocStyle.OptionalSectionContent)
|
||||
PrintTextMessage(cb, "No Section Content", _TextLayer);
|
||||
SectionConfig.SectionPagination sp = SectionConfig.SectionPagination.Separate; // always the default
|
||||
if ( section.NextItemCount > 0)
|
||||
ItemInfo nxtItem = section.GetNextItem();
|
||||
if (nxtItem != null)
|
||||
{
|
||||
SectionInfo tmpii = SectionInfo.Get(section.NextItem.ItemID);
|
||||
// if this section & the next section are not accessory pages, see if there is continuous pagination,
|
||||
// i.e. no page break between them.
|
||||
if (section.IsStepSection && tmpii.IsStepSection)
|
||||
if (section.IsStepSection && nxtItem.IsStepSection)
|
||||
{
|
||||
SectionConfig sc = tmpii.SectionConfig;
|
||||
SectionInfo si = nxtItem as SectionInfo;
|
||||
SectionConfig sc = si.SectionConfig;
|
||||
try
|
||||
{
|
||||
if (sc != null) sp = sc.Section_Pagination;
|
||||
|
@ -63,6 +63,7 @@ namespace Volian.Print.Library
|
||||
const string BoxAsteriskWithSides1 = " *.* .* .* . . . *.* . .* . . "; // ip2
|
||||
const string BoxAsteriskWithSides2 = " *. *.*.*. . . *.*. . *. . "; // ip3
|
||||
const string BoxAsteriskWithSides3 = "*.*.*.*.*.*.*.*.*.*.*.*"; //byr
|
||||
const string BoxAsteriskWithSides4 = "*.*.*.*.*.*.*.*. .*. . "; // wep2
|
||||
const string BoxAsteriskTopBottom = "*.*.*. . . .*.*. .*. . "; // fnp
|
||||
const string BoxLineTopBottom = "\x2500.\x2500.\x2500. . . .\x2500.\x2500. .\x2500. . "; // fnp
|
||||
const string BoxAsteriskTopBotton2 = " .*. . . . . . . .*. . "; // Robinson (CPL)
|
||||
@ -134,7 +135,7 @@ namespace Volian.Print.Library
|
||||
case BoxAsterisk:
|
||||
case BoxAsteriskTopBottom:
|
||||
case BoxAsteriskTopBotton2:
|
||||
DrawAsteriskTopBottom(cb, yPageStart, yTopMargin, yBottomMargin, ref top, ref bottom, left);
|
||||
DrawAsteriskTopBottom(cb, yPageStart, yTopMargin, yBottomMargin, ref top, ref bottom, left, MyBox.Font);
|
||||
break;
|
||||
case BoxLineTopBottom: // fnp note box
|
||||
lineThickness = .6f;
|
||||
@ -147,8 +148,9 @@ namespace Volian.Print.Library
|
||||
case BoxAsteriskWithSides1:
|
||||
case BoxAsteriskWithSides2:
|
||||
case BoxAsteriskWithSides3:
|
||||
DrawAsteriskTopBottom(cb, yPageStart, yTopMargin, yBottomMargin, ref top, ref bottom, left);
|
||||
DrawAsteriskSide(cb, yPageStart, yTopMargin, yBottomMargin, top, bottom, left, right);
|
||||
case BoxAsteriskWithSides4:
|
||||
DrawAsteriskTopBottom(cb, yPageStart, yTopMargin, yBottomMargin, ref top, ref bottom, left, MyBox.Font);
|
||||
DrawAsteriskSide(cb, yPageStart, yTopMargin, yBottomMargin, top, bottom, left, right, MyBox.Font);
|
||||
break;
|
||||
default:
|
||||
// For other than thick, thin and double.
|
||||
@ -168,7 +170,7 @@ namespace Volian.Print.Library
|
||||
return yPageStart;
|
||||
}
|
||||
|
||||
private void DrawAsteriskTopBottom(PdfContentByte cb, float yPageStart, float yTopMargin, float yBottomMargin, ref float top, ref float bottom, float left)
|
||||
private void DrawAsteriskTopBottom(PdfContentByte cb, float yPageStart, float yTopMargin, float yBottomMargin, ref float top, ref float bottom, float left, VE_Font vef)
|
||||
{
|
||||
// this box is not drawn, it is a series of asterisks drawn above and below text.
|
||||
// For this box, there are no vertical edges (RGE uses this box type)
|
||||
@ -179,7 +181,21 @@ namespace Volian.Print.Library
|
||||
bottom = top - (Height * MyPageHelper.YMultiplier);
|
||||
|
||||
// create a new font without any styles such as underline.
|
||||
VE_Font vf = new VE_Font(MyParent.MyItemInfo.FormatStepData.Font.Family, (int)MyParent.MyItemInfo.FormatStepData.Font.Size, E_Style.None, (float)MyParent.MyItemInfo.FormatStepData.Font.CPI);
|
||||
E_Style es = ((vef.Style & E_Style.Bold) == E_Style.Bold) ? E_Style.Bold : E_Style.None;
|
||||
// if the box has a font, use it - otherwise use this item info's font
|
||||
VE_Font vf = null;
|
||||
bool UseBoxFont = false;
|
||||
try
|
||||
{
|
||||
UseBoxFont = MyParent.MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionPrintData.DiffContActBox;
|
||||
}
|
||||
catch // done this way in case one of the format properties is null in the previous statement, UseBoxFont will be false.
|
||||
{
|
||||
}
|
||||
if (UseBoxFont)
|
||||
vf = new VE_Font(vef.Family, (int)vef.Size, es, (float)MyParent.MyItemInfo.FormatStepData.Font.CPI);
|
||||
else
|
||||
vf = new VE_Font(MyParent.MyItemInfo.FormatStepData.Font.Family, (int)MyParent.MyItemInfo.FormatStepData.Font.Size, es, (float)MyParent.MyItemInfo.FormatStepData.Font.CPI);
|
||||
|
||||
// To find the length of the line, account for the length of the upper right corner also (BXURC)
|
||||
int urcLen = MyBox.BXHorz[MyBox.BXHorz.Length - 1] == ' ' && MyBox.BXURC[0] == ' ' ? 1 : MyBox.BXURC.Length;
|
||||
@ -258,7 +274,7 @@ namespace Volian.Print.Library
|
||||
return w;
|
||||
}
|
||||
|
||||
private void DrawAsteriskSide(PdfContentByte cb, float yPageStart, float yTopMargin, float yBottomMargin, float top, float bottom, float left, float right)
|
||||
private void DrawAsteriskSide(PdfContentByte cb, float yPageStart, float yTopMargin, float yBottomMargin, float top, float bottom, float left, float right, VE_Font vef)
|
||||
{
|
||||
// set the top & bottom of sides. If there is a page break in the middle of box, adjust these.
|
||||
// The vlnBox property, ContainsPageBreak, flags that a break occurred.
|
||||
@ -280,7 +296,23 @@ namespace Volian.Print.Library
|
||||
if (bottom < yBottomMargin) bottom = yBottomMargin;
|
||||
|
||||
float height = (SixLinesPerInch * MyPageHelper.YMultiplier) + 4; // just add a little on so that height is a little bigger than character
|
||||
VE_Font vf = new VE_Font(MyParent.MyItemInfo.FormatStepData.Font.Family, (int)MyParent.MyItemInfo.FormatStepData.Font.Size, E_Style.None, (float)MyParent.MyItemInfo.FormatStepData.Font.CPI);
|
||||
|
||||
// create a new font without any styles such as underline.
|
||||
E_Style es = ((vef.Style & E_Style.Bold) == E_Style.Bold) ? E_Style.Bold : E_Style.None;
|
||||
// if the box has a font, use it - otherwise use this item info's font
|
||||
VE_Font vf = null;
|
||||
bool UseBoxFont = false;
|
||||
try
|
||||
{
|
||||
UseBoxFont = MyParent.MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionPrintData.DiffContActBox;
|
||||
}
|
||||
catch // done this way in case one of the format properties is null in the previous statement, UseBoxFont will be false.
|
||||
{
|
||||
}
|
||||
if (UseBoxFont)
|
||||
vf = new VE_Font(vef.Family, (int)vef.Size, es, (float)MyParent.MyItemInfo.FormatStepData.Font.CPI);
|
||||
else
|
||||
vf = new VE_Font(MyParent.MyItemInfo.FormatStepData.Font.Family, (int)MyParent.MyItemInfo.FormatStepData.Font.Size, es, (float)MyParent.MyItemInfo.FormatStepData.Font.CPI);
|
||||
|
||||
// Left side first:
|
||||
Rtf = GetRtf(MyBox.BXVert, vf);
|
||||
|
Loading…
x
Reference in New Issue
Block a user