This commit is contained in:
parent
a9716e1bde
commit
22ceb38325
@ -35,8 +35,8 @@ namespace Volian.Print.Library
|
|||||||
float yTop = yoff;
|
float yTop = yoff;
|
||||||
foreach (ItemInfo childItemInfo in itemInfoList)
|
foreach (ItemInfo childItemInfo in itemInfoList)
|
||||||
{
|
{
|
||||||
int? bxIndx = childItemInfo.FormatStepData.StepLayoutData.STBoxindex;
|
int? bxIndx = childItemInfo.FormatStepData==null?-1:childItemInfo.FormatStepData.StepLayoutData.STBoxindex;
|
||||||
if (bxIndex != bxIndx || childItemInfo.FormatStepData.BoxIt)
|
if (bxIndx != -1 && (bxIndex != bxIndx || childItemInfo.FormatStepData.BoxIt))
|
||||||
{
|
{
|
||||||
if (childItemInfo.FormatStepData.BoxIt) // this is a boxed HLS
|
if (childItemInfo.FormatStepData.BoxIt) // this is a boxed HLS
|
||||||
{
|
{
|
||||||
@ -81,7 +81,7 @@ namespace Volian.Print.Library
|
|||||||
Add(para);
|
Add(para);
|
||||||
// para.YBottomMost will have y for bottom of any substeps that are also enclosed in the box.
|
// para.YBottomMost will have y for bottom of any substeps that are also enclosed in the box.
|
||||||
yoff = para.YBottomMost;
|
yoff = para.YBottomMost;
|
||||||
if (childItemInfo.FormatStepData.BoxIt)
|
if (childItemInfo.FormatStepData != null && childItemInfo.FormatStepData.BoxIt)
|
||||||
{
|
{
|
||||||
box.Height = yoff - box.YOffset - (1.1F * vlnPrintObject.SixLinesPerInch);
|
box.Height = yoff - box.YOffset - (1.1F * vlnPrintObject.SixLinesPerInch);
|
||||||
box = null; // if doing boxed steps, only do single sibling at a time.
|
box = null; // if doing boxed steps, only do single sibling at a time.
|
||||||
@ -111,7 +111,7 @@ namespace Volian.Print.Library
|
|||||||
get { return _MyGrid; }
|
get { return _MyGrid; }
|
||||||
set { _MyGrid = value; }
|
set { _MyGrid = value; }
|
||||||
}
|
}
|
||||||
|
public float SectYPageStart = 0;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This variable is used to match 16 bit pagination
|
/// This variable is used to match 16 bit pagination
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -124,6 +124,7 @@ namespace Volian.Print.Library
|
|||||||
if (_PartsAbove != null && _PartsAbove.Count > 0) yPageStart = PartsAbove.ToPdf(cb, yPageStart, yTopMargin, yBottomMargin);
|
if (_PartsAbove != null && _PartsAbove.Count > 0) yPageStart = PartsAbove.ToPdf(cb, yPageStart, yTopMargin, yBottomMargin);
|
||||||
if (MyItemInfo.IsHigh && MyItemInfo.MyDocStyle.SpecialStepsFoldout) yPageStart -= SixLinesPerInch;
|
if (MyItemInfo.IsHigh && MyItemInfo.MyDocStyle.SpecialStepsFoldout) yPageStart -= SixLinesPerInch;
|
||||||
float yLocation = CalculateYOffset(yPageStart, yTopMargin);
|
float yLocation = CalculateYOffset(yPageStart, yTopMargin);
|
||||||
|
|
||||||
if (MyItemInfo.HasChangeBar && MyPageHelper.ChangeBarDefinition.MyChangeBarType != PrintChangeBar.Without) MyPageHelper.AddChangeBar(DoChangeBar(cb, MyItemInfo, MyPageHelper, XOffset, yLocation, MyPageHelper.MaxRNO, MyItemInfo.ActiveFormat), cbMess);
|
if (MyItemInfo.HasChangeBar && MyPageHelper.ChangeBarDefinition.MyChangeBarType != PrintChangeBar.Without) MyPageHelper.AddChangeBar(DoChangeBar(cb, MyItemInfo, MyPageHelper, XOffset, yLocation, MyPageHelper.MaxRNO, MyItemInfo.ActiveFormat), cbMess);
|
||||||
|
|
||||||
float retval = yLocation;
|
float retval = yLocation;
|
||||||
@ -157,7 +158,6 @@ namespace Volian.Print.Library
|
|||||||
if (_PartsBelow != null && _PartsBelow.Count > 0) yPageStart = PartsBelow.ToPdf(cb, yPageStart, yTopMargin, yBottomMargin);
|
if (_PartsBelow != null && _PartsBelow.Count > 0) yPageStart = PartsBelow.ToPdf(cb, yPageStart, yTopMargin, yBottomMargin);
|
||||||
if (_PartsContainer != null && _PartsContainer.Count > 0) yPageStart = PartsContainer.ToPdf(cb, yPageStart, yTopMargin, yBottomMargin);
|
if (_PartsContainer != null && _PartsContainer.Count > 0) yPageStart = PartsContainer.ToPdf(cb, yPageStart, yTopMargin, yBottomMargin);
|
||||||
|
|
||||||
|
|
||||||
return yPageStart;
|
return yPageStart;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -182,6 +182,7 @@ namespace Volian.Print.Library
|
|||||||
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
|
||||||
{ // pagination logic needs to be fixed.
|
{ // pagination logic needs to be fixed.
|
||||||
cb.PdfDocument.NewPage(); // pagination issue
|
cb.PdfDocument.NewPage(); // pagination issue
|
||||||
|
DebugText.WriteLine("*****PaginateError");
|
||||||
yPageStart = yTopMargin + YVeryTop;
|
yPageStart = yTopMargin + YVeryTop;
|
||||||
yLocation = yPageStart - YOffset;
|
yLocation = yPageStart - YOffset;
|
||||||
//MyItemInfo.ItemID, YSize, yPageSize, yLocation
|
//MyItemInfo.ItemID, YSize, yPageSize, yLocation
|
||||||
@ -283,7 +284,10 @@ namespace Volian.Print.Library
|
|||||||
}
|
}
|
||||||
public override float ToPdf(PdfContentByte cb, float yPageStart, float yTopMargin, float yBottomMargin)
|
public override float ToPdf(PdfContentByte cb, float yPageStart, float yTopMargin, float yBottomMargin)
|
||||||
{
|
{
|
||||||
|
float yLocalypagestart = yPageStart;
|
||||||
|
// yPageStart is offset into roll; YTopMost is offset of topmost of this paragraph.
|
||||||
float yLocation = yPageStart - YTopMost;
|
float yLocation = yPageStart - YTopMost;
|
||||||
|
DebugText.WriteLine("ToPdf1:{0},'{1}',{2},{3},{4}", MyItemInfo.ItemID, MyItemInfo.ShortSearchPath, yLocation, yPageStart, YTopMost);
|
||||||
int paginate = Paginate(yLocation, yTopMargin, yBottomMargin);
|
int paginate = Paginate(yLocation, yTopMargin, yBottomMargin);
|
||||||
bool firstHighLevelStep = MyItemInfo.IsHigh && (MyItemInfo.MyPrevious == null);
|
bool firstHighLevelStep = MyItemInfo.IsHigh && (MyItemInfo.MyPrevious == null);
|
||||||
switch (paginate)
|
switch (paginate)
|
||||||
@ -298,6 +302,7 @@ namespace Volian.Print.Library
|
|||||||
case 1: // Break on High Level Step
|
case 1: // Break on High Level Step
|
||||||
OutputOtherPageSteps(cb, YTopMost, yPageStart, yTopMargin, yBottomMargin);
|
OutputOtherPageSteps(cb, YTopMost, yPageStart, yTopMargin, yBottomMargin);
|
||||||
cb.PdfDocument.NewPage();
|
cb.PdfDocument.NewPage();
|
||||||
|
DebugText.WriteLine("Paginate1");
|
||||||
if (MyItemInfo.IsSection)
|
if (MyItemInfo.IsSection)
|
||||||
{
|
{
|
||||||
SectionInfo si = MyItemInfo as SectionInfo;
|
SectionInfo si = MyItemInfo as SectionInfo;
|
||||||
@ -337,6 +342,7 @@ namespace Volian.Print.Library
|
|||||||
MyPageHelper.BottomMessage = new vlnText(cb, this, myMsg, myMsg, docstyle.Layout.LeftMargin + XOffsetBox + docstyle.Continue.Bottom.Margin ?? 0, msg_yLocation, MyItemInfo.ActiveFormat.PlantFormat.FormatData.Font);
|
MyPageHelper.BottomMessage = new vlnText(cb, this, myMsg, myMsg, docstyle.Layout.LeftMargin + XOffsetBox + docstyle.Continue.Bottom.Margin ?? 0, msg_yLocation, MyItemInfo.ActiveFormat.PlantFormat.FormatData.Font);
|
||||||
}
|
}
|
||||||
cb.PdfDocument.NewPage();
|
cb.PdfDocument.NewPage();
|
||||||
|
DebugText.WriteLine("Paginate2");
|
||||||
if ((MyItemInfo.ActiveSection.MyDocStyle.StructureStyle.Style ?? 0 & E_DocStructStyle.UseSectionFoldout) != 0)
|
if ((MyItemInfo.ActiveSection.MyDocStyle.StructureStyle.Style ?? 0 & E_DocStructStyle.UseSectionFoldout) != 0)
|
||||||
PromsPrinter.DoFoldoutPage(cb, "Break within Step", MyPageHelper.TextLayer, MyPageHelper); // temporary foldout
|
PromsPrinter.DoFoldoutPage(cb, "Break within Step", MyPageHelper.TextLayer, MyPageHelper); // temporary foldout
|
||||||
|
|
||||||
@ -360,6 +366,7 @@ namespace Volian.Print.Library
|
|||||||
{
|
{
|
||||||
OutputOtherPageSteps(cb, YTopMost, yPageStart, yTopMargin, yBottomMargin);
|
OutputOtherPageSteps(cb, YTopMost, yPageStart, yTopMargin, yBottomMargin);
|
||||||
cb.PdfDocument.NewPage(); // HLS (7 lpi) breakif (MyItemInfo.IsSection)
|
cb.PdfDocument.NewPage(); // HLS (7 lpi) breakif (MyItemInfo.IsSection)
|
||||||
|
DebugText.WriteLine("Paginate3");
|
||||||
if (MyItemInfo.IsSection)
|
if (MyItemInfo.IsSection)
|
||||||
{
|
{
|
||||||
SectionInfo si = MyItemInfo as SectionInfo;
|
SectionInfo si = MyItemInfo as SectionInfo;
|
||||||
@ -380,9 +387,16 @@ namespace Volian.Print.Library
|
|||||||
}
|
}
|
||||||
yPageStart = ChildrenAbove.ToPdf(cb, yPageStart, yTopMargin, yBottomMargin);
|
yPageStart = ChildrenAbove.ToPdf(cb, yPageStart, yTopMargin, yBottomMargin);
|
||||||
yPageStart = ChildrenLeft.ToPdf(cb, yPageStart, yTopMargin, yBottomMargin);
|
yPageStart = ChildrenLeft.ToPdf(cb, yPageStart, yTopMargin, yBottomMargin);
|
||||||
|
DebugText.WriteLine("Left:{0},{1},{2},{3},{4}", MyItemInfo.ItemID, yLocalypagestart, yPageStart, yTopMargin, yBottomMargin);
|
||||||
yPageStart = ParagraphToPdf(cb, yPageStart, yTopMargin, yBottomMargin);
|
yPageStart = ParagraphToPdf(cb, yPageStart, yTopMargin, yBottomMargin);
|
||||||
|
DebugText.WriteLine("Self:{0},{1},{2},{3},{4}", MyItemInfo.ItemID, yLocalypagestart, yPageStart, yTopMargin, yBottomMargin);
|
||||||
|
|
||||||
yPageStart = ChildrenRight.ToPdf(cb, yPageStart, yTopMargin, yBottomMargin);
|
yPageStart = ChildrenRight.ToPdf(cb, yPageStart, yTopMargin, yBottomMargin);
|
||||||
|
DebugText.WriteLine("Right:{0},{1},{2},{3},{4}", MyItemInfo.ItemID, yLocalypagestart, yPageStart, yTopMargin, yBottomMargin);
|
||||||
|
|
||||||
yPageStart = ChildrenBelow.ToPdf(cb, yPageStart, yTopMargin, yBottomMargin);
|
yPageStart = ChildrenBelow.ToPdf(cb, yPageStart, yTopMargin, yBottomMargin);
|
||||||
|
DebugText.WriteLine("Below:{0},{1},{2},{3},{4}", MyItemInfo.ItemID, yLocalypagestart, yPageStart, yTopMargin, yBottomMargin);
|
||||||
|
|
||||||
if (MyItemInfo.IsHigh && MyItemInfo.NextItem == null) // last hls, add the 'end' message, if there is one
|
if (MyItemInfo.IsHigh && MyItemInfo.NextItem == null) // last hls, add the 'end' message, if there is one
|
||||||
{
|
{
|
||||||
DocStyle docstyle = MyItemInfo.MyDocStyle;
|
DocStyle docstyle = MyItemInfo.MyDocStyle;
|
||||||
@ -403,6 +417,7 @@ namespace Volian.Print.Library
|
|||||||
MyPageHelper.BottomMessage = new vlnText(cb, this, myMsg, myMsg, centerpos, msg_yLocation, docstyle.End.Font);
|
MyPageHelper.BottomMessage = new vlnText(cb, this, myMsg, myMsg, centerpos, msg_yLocation, docstyle.End.Font);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (yLocalypagestart != yPageStart) DebugText.WriteLine("ToPdf-yPagestartDiff:{0},{1},{2}", MyItemInfo.ItemID, yLocalypagestart, yPageStart);
|
||||||
return yPageStart;
|
return yPageStart;
|
||||||
}
|
}
|
||||||
private vlnParagraph TopMostChild
|
private vlnParagraph TopMostChild
|
||||||
@ -539,7 +554,11 @@ namespace Volian.Print.Library
|
|||||||
// add the first child's size + (the section title's size)
|
// add the first child's size + (the section title's size)
|
||||||
float ySizeIncludingFirst = firstChild.YSize + (firstChild.YTop - YTop);
|
float ySizeIncludingFirst = firstChild.YSize + (firstChild.YTop - YTop);
|
||||||
//if (ySizeIncludingFirst > (yLocation - yBottomMargin - SixLinesPerInch)) return 1;
|
//if (ySizeIncludingFirst > (yLocation - yBottomMargin - SixLinesPerInch)) return 1;
|
||||||
if (ySizeIncludingFirst > (yLocation - yBottomMargin)) return 1;
|
if (ySizeIncludingFirst > (yLocation - yBottomMargin))
|
||||||
|
{
|
||||||
|
ShowPageBreak(100, "Page Break Before Step Section", "Yes", YSize, yPageSize, yWithinMargins);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return 0; // Don't Paginate (page break) on a Step Section if it's first thing on page
|
return 0; // Don't Paginate (page break) on a Step Section if it's first thing on page
|
||||||
}
|
}
|
||||||
@ -873,6 +892,12 @@ namespace Volian.Print.Library
|
|||||||
if (itemInfo.MyHeader != null && itemInfo.MyHeader.Text != null && !doSectTab)
|
if (itemInfo.MyHeader != null && itemInfo.MyHeader.Text != null && !doSectTab)
|
||||||
yoff += SetHeader(this, cb, itemInfo, formatInfo);
|
yoff += SetHeader(this, cb, itemInfo, formatInfo);
|
||||||
YOffset = yoff;
|
YOffset = yoff;
|
||||||
|
|
||||||
|
if (itemInfo.IsRNOPart)
|
||||||
|
{
|
||||||
|
// there may be other places that double space, but this supports it for RNOs (the DoubleRNOspace flag)
|
||||||
|
if (rnoLevel > maxRNO && itemInfo.FormatStepData.DoubleSpace) yoff = YOffset = yoff + SixLinesPerInch;
|
||||||
|
}
|
||||||
AddMacros(itemInfo, mytab);
|
AddMacros(itemInfo, mytab);
|
||||||
if (mytab != null)
|
if (mytab != null)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user