F2017-042: handle samg supinfo facing page for section titles
This commit is contained in:
parent
28a7d8e8ed
commit
1315645a85
@ -1577,6 +1577,7 @@ namespace Volian.Print.Library
|
|||||||
supInfoSect.StepSectPageBreaksForSupInfo.Add(aboveSupinfoId!=-1?aboveSupinfoId:MyItemInfo.SupInfos[0].ItemID);
|
supInfoSect.StepSectPageBreaksForSupInfo.Add(aboveSupinfoId!=-1?aboveSupinfoId:MyItemInfo.SupInfos[0].ItemID);
|
||||||
MyPromsPrinter.NeedSupInfoBreak = false;
|
MyPromsPrinter.NeedSupInfoBreak = false;
|
||||||
}
|
}
|
||||||
|
bool itemIsPrinted = false;
|
||||||
switch (paginate)
|
switch (paginate)
|
||||||
{
|
{
|
||||||
// .oooooo. .oooo.
|
// .oooooo. .oooo.
|
||||||
@ -1600,19 +1601,30 @@ namespace Volian.Print.Library
|
|||||||
yPageStart = _yPageStartForSupInfo - SixLinesPerInch;
|
yPageStart = _yPageStartForSupInfo - SixLinesPerInch;
|
||||||
yLocation = yPageStart - YTopMost;
|
yLocation = yPageStart - YTopMost;
|
||||||
}
|
}
|
||||||
// printing a procedure with section(s) that have supplemental information - determine facing page needed to be merged in:
|
// printing a procedure with section(s) that have supplemental information - determine facing page needed to be merged in. For
|
||||||
if (MyPromsPrinter.SupInfoPrintType == E_SupInfoPrintType.Merge && !MyItemInfo.IsSection && MyItemInfo.IsHigh && MyItemInfo.MyPrevious == null && !MyItemInfo.IsInSupInfo && (MyItemInfo.MyActiveSection as SectionInfo).HasSupInfoSteps)
|
// case 0, it is typically at the beginning of the section since the page break occurred in the code that calls this.
|
||||||
|
// Note that if the procedure has any sections with supinfo, then the entire procedure will need facing pages, either blank page
|
||||||
|
// or supinfo steps.
|
||||||
|
if (MyPromsPrinter.SupInfoPrintType == E_SupInfoPrintType.Merge && !MyItemInfo.IsSection && MyItemInfo.IsHigh && MyItemInfo.MyPrevious == null && !MyItemInfo.IsInSupInfo && (MyItemInfo.MyProcedure as ProcedureInfo).ProcHasSupInfoData)
|
||||||
{
|
{
|
||||||
int sid = GetIdThatHasSupInfoItems(MyItemInfo, MyItemInfo.ItemID);
|
// check if the item is printed, a step is always printed but a section title may or may not based on format flags. if it is not
|
||||||
if (sid != -1)
|
// printed, don't put out facing page because it will be put out when there is printable text.
|
||||||
|
itemIsPrinted = IsPrintedStepItemForSupInfo();
|
||||||
|
if (itemIsPrinted)
|
||||||
{
|
{
|
||||||
MyPromsPrinter.DoSupInfoPage(cb, "TEMP", MyPageHelper.TextLayer, MyPageHelper, sid, true);
|
// If there is supplemental information to be printed on the facing page, then get the id that has supinfo
|
||||||
}
|
// so that it can be retrieved from the pdf for the supinfos for this section.
|
||||||
else
|
int sid = GetIdThatHasSupInfoItems(MyItemInfo, MyItemInfo.ItemID);
|
||||||
{
|
if (sid != -1)
|
||||||
MyPageHelper.OnBlankPage = true;
|
{
|
||||||
cb.PdfDocument.Add(new iTextSharp.text.Table(1));
|
MyPromsPrinter.DoSupInfoPage(cb, "TEMP", MyPageHelper.TextLayer, MyPageHelper, sid, true);
|
||||||
MyPromsPrinter.NewPage();
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MyPageHelper.OnBlankPage = true;
|
||||||
|
cb.PdfDocument.Add(new iTextSharp.text.Table(1));
|
||||||
|
MyPromsPrinter.NewPage();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (MyItemInfo.IsHigh && MyItemInfo.MyPrevious != null && ((MyItemInfo.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DoubleBoxHLS) == E_DocStructStyle.DoubleBoxHLS))
|
if (MyItemInfo.IsHigh && MyItemInfo.MyPrevious != null && ((MyItemInfo.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DoubleBoxHLS) == E_DocStructStyle.DoubleBoxHLS))
|
||||||
@ -1685,10 +1697,9 @@ namespace Volian.Print.Library
|
|||||||
//_MyLog.InfoFormat("NewPage 10 blank {0}", cb.PdfWriter.CurrentPageNumber);
|
//_MyLog.InfoFormat("NewPage 10 blank {0}", cb.PdfWriter.CurrentPageNumber);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// If there is supplemental information to be printed on the facing page, then get the id that has supinfo
|
// See comments under case 0 explaining supinfo/facing page processing.
|
||||||
// so that it can be retrieved from the pdf for the supinfos for this section. If there is one,
|
itemIsPrinted = IsPrintedStepItemForSupInfo();
|
||||||
// use DoSupInfoPage to put out the page, otherwise do a blank page.
|
if (MyPromsPrinter.SupInfoPrintType == E_SupInfoPrintType.Merge && itemIsPrinted && !MyItemInfo.IsSection && !MyItemInfo.IsInSupInfo && (MyItemInfo.MyProcedure as ProcedureInfo).ProcHasSupInfoData)
|
||||||
if (MyPromsPrinter.SupInfoPrintType==E_SupInfoPrintType.Merge && !MyItemInfo.IsSection && !MyItemInfo.IsInSupInfo && (MyItemInfo.MyActiveSection as SectionInfo).HasSupInfoSteps)
|
|
||||||
{
|
{
|
||||||
int sid = GetIdThatHasSupInfoItems(MyItemInfo, MyItemInfo.ItemID);
|
int sid = GetIdThatHasSupInfoItems(MyItemInfo, MyItemInfo.ItemID);
|
||||||
if (sid != -1)
|
if (sid != -1)
|
||||||
@ -1798,7 +1809,7 @@ namespace Volian.Print.Library
|
|||||||
MyPromsPrinter.NewPage();
|
MyPromsPrinter.NewPage();
|
||||||
_MyLog.InfoFormat("NewPage Break within step blank {0}", cb.PdfWriter.CurrentPageNumber);
|
_MyLog.InfoFormat("NewPage Break within step blank {0}", cb.PdfWriter.CurrentPageNumber);
|
||||||
}
|
}
|
||||||
if (!MyItemInfo.IsSection && !MyItemInfo.IsInSupInfo && (MyItemInfo.MyActiveSection as SectionInfo).HasSupInfoSteps)
|
if (!MyItemInfo.IsSection && !MyItemInfo.IsInSupInfo && (MyItemInfo.MyProcedure as ProcedureInfo).ProcHasSupInfoData)
|
||||||
{
|
{
|
||||||
int sid = GetIdThatHasSupInfoItems(MyItemInfo, MyItemInfo.ItemID);
|
int sid = GetIdThatHasSupInfoItems(MyItemInfo, MyItemInfo.ItemID);
|
||||||
if (sid != -1)
|
if (sid != -1)
|
||||||
@ -1955,10 +1966,9 @@ namespace Volian.Print.Library
|
|||||||
MyPromsPrinter.NewPage();
|
MyPromsPrinter.NewPage();
|
||||||
//_MyLog.InfoFormat("NewPage 12 lpi blank {0}", cb.PdfWriter.CurrentPageNumber);
|
//_MyLog.InfoFormat("NewPage 12 lpi blank {0}", cb.PdfWriter.CurrentPageNumber);
|
||||||
}
|
}
|
||||||
// If there is supplemental information to be printed on the facing page, then get the id that has supinfo
|
// See comments under case 0 explaining supinfo/facing page processing.
|
||||||
// so that it can be retrieved from the pdf for the supinfos for this section. If there is one,
|
itemIsPrinted = IsPrintedStepItemForSupInfo();
|
||||||
// use DoSupInfoPage to put out the page, otherwise do a blank page.
|
if (MyPromsPrinter.SupInfoPrintType == E_SupInfoPrintType.Merge && itemIsPrinted && !MyItemInfo.IsSection && !MyItemInfo.IsInSupInfo && (MyItemInfo.MyProcedure as ProcedureInfo).ProcHasSupInfoData)
|
||||||
if (MyPromsPrinter.SupInfoPrintType == E_SupInfoPrintType.Merge && !MyItemInfo.IsSection && !MyItemInfo.IsInSupInfo && (MyItemInfo.MyActiveSection as SectionInfo).HasSupInfoSteps)
|
|
||||||
{
|
{
|
||||||
int sid = GetIdThatHasSupInfoItems(MyItemInfo, MyItemInfo.ItemID);
|
int sid = GetIdThatHasSupInfoItems(MyItemInfo, MyItemInfo.ItemID);
|
||||||
if (sid != -1)
|
if (sid != -1)
|
||||||
@ -2199,7 +2209,18 @@ namespace Volian.Print.Library
|
|||||||
ProfileTimer.Pop(profileDepth);
|
ProfileTimer.Pop(profileDepth);
|
||||||
return yPageStart;
|
return yPageStart;
|
||||||
}
|
}
|
||||||
|
private bool IsPrintedStepItemForSupInfo()
|
||||||
|
{
|
||||||
|
bool printedMySectTitle = true;
|
||||||
|
if (MyItemInfo.IsSection)
|
||||||
|
{
|
||||||
|
// see if the section title is printed.
|
||||||
|
SectionConfig sch = MyItemInfo.ActiveSection.MyConfig as SectionConfig;
|
||||||
|
printedMySectTitle = (sch == null || sch.Section_PrintHdr == "Y") || !(MyItemInfo.MyActiveSection as SectionInfo).HasSupInfoSteps;
|
||||||
|
printedMySectTitle &= (ShowSectionTitles && !MyItemInfo.MyDocStyle.CancelSectTitle);
|
||||||
|
}
|
||||||
|
return printedMySectTitle;
|
||||||
|
}
|
||||||
private int ChildrenAboveHaveSupInfo()
|
private int ChildrenAboveHaveSupInfo()
|
||||||
{
|
{
|
||||||
if (ChildrenAbove == null || ChildrenAbove.Count < 1) return -1;
|
if (ChildrenAbove == null || ChildrenAbove.Count < 1) return -1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user