Use property to initialize (prevent null reference)
Added sup info pdf print to supinfo print enum Use sup info pdf print from enum fixed typo and use sup info pdf print from enum B2017-136: Support section titles in proc step sections that have SAMG facing page supplemental info
This commit is contained in:
parent
f204e513de
commit
92dfcf47ed
@ -6936,7 +6936,11 @@ namespace VEPROMS.CSLA.Library
|
|||||||
private List<int> _StepSectPageBreaksForSupInfo = null;
|
private List<int> _StepSectPageBreaksForSupInfo = null;
|
||||||
public List<int> StepSectPageBreaksForSupInfo
|
public List<int> StepSectPageBreaksForSupInfo
|
||||||
{
|
{
|
||||||
get { return _StepSectPageBreaksForSupInfo; }
|
get
|
||||||
|
{
|
||||||
|
if (_StepSectPageBreaksForSupInfo == null) _StepSectPageBreaksForSupInfo = new List<int>();
|
||||||
|
return _StepSectPageBreaksForSupInfo;
|
||||||
|
}
|
||||||
set { _StepSectPageBreaksForSupInfo = value; }
|
set { _StepSectPageBreaksForSupInfo = value; }
|
||||||
}
|
}
|
||||||
// Keeps track of step section itemids where page breaks occur
|
// Keeps track of step section itemids where page breaks occur
|
||||||
|
@ -244,7 +244,8 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
None = 0,
|
None = 0,
|
||||||
DoPageBreaks = 1,
|
DoPageBreaks = 1,
|
||||||
Merge = 2
|
SupInfoPdfPrint = 2,
|
||||||
|
Merge = 3
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
@ -80,7 +80,7 @@ namespace Volian.Print.Library
|
|||||||
}
|
}
|
||||||
// If printing a supinfo pdf, see if there is a page break at this supinfo paragraph, i.e. an entry will
|
// If printing a supinfo pdf, see if there is a page break at this supinfo paragraph, i.e. an entry will
|
||||||
// exist in the list that contains the supinfo paragraph pagebreaks that was generated in the first pagebreak pass
|
// exist in the list that contains the supinfo paragraph pagebreaks that was generated in the first pagebreak pass
|
||||||
if (MyPromsPrinter.SupInfoPrintType == E_SupInfoPrintType.Merge && MyPageHelper.CreatingSupInfoPage)
|
if (MyPromsPrinter.SupInfoPrintType == E_SupInfoPrintType.SupInfoPdfPrint)
|
||||||
{
|
{
|
||||||
int retval = 0;
|
int retval = 0;
|
||||||
SectionInfo supInfoSect = MyItemInfo.MyActiveSection as SectionInfo;
|
SectionInfo supInfoSect = MyItemInfo.MyActiveSection as SectionInfo;
|
||||||
|
@ -1621,8 +1621,7 @@ namespace Volian.Print.Library
|
|||||||
ItemInfo myItemInfo = section as ItemInfo;
|
ItemInfo myItemInfo = section as ItemInfo;
|
||||||
if (SupInfoPrintType == E_SupInfoPrintType.DoPageBreaks)
|
if (SupInfoPrintType == E_SupInfoPrintType.DoPageBreaks)
|
||||||
{
|
{
|
||||||
if (section.StepSectPageBreaksForSupInfo == null) section.StepSectPageBreaksForSupInfo = new List<int>();
|
section.StepSectPageBreaksForSupInfo.Clear();
|
||||||
else section.StepSectPageBreaksForSupInfo.Clear();
|
|
||||||
section.StepSectPageBreaks.Clear();
|
section.StepSectPageBreaks.Clear();
|
||||||
}
|
}
|
||||||
// 792: 72 * 11 inches - TopRow - Top is high value
|
// 792: 72 * 11 inches - TopRow - Top is high value
|
||||||
@ -1743,18 +1742,20 @@ namespace Volian.Print.Library
|
|||||||
string SupInfoPdfName = Volian.Base.Library.VlnSettings.TemporaryFolder + @"\SupInfo" + vlnParagraph.MyItemInfo.ItemID.ToString() + @".pdf";
|
string SupInfoPdfName = Volian.Base.Library.VlnSettings.TemporaryFolder + @"\SupInfo" + vlnParagraph.MyItemInfo.ItemID.ToString() + @".pdf";
|
||||||
PdfContentByte cb = OpenDoc(SupInfoPdfName, PageSize.LETTER);
|
PdfContentByte cb = OpenDoc(SupInfoPdfName, PageSize.LETTER);
|
||||||
if (cb == null) return;
|
if (cb == null) return;
|
||||||
VlnSvgPageHelper myPageHealper = new VlnSvgPageHelper(vlnParagraph.MyItemInfo as SectionInfo, this, null, 0);
|
VlnSvgPageHelper myPageHelper = new VlnSvgPageHelper(vlnParagraph.MyItemInfo as SectionInfo, this, null, 0);
|
||||||
cb.PdfWriter.PageEvent = myPageHealper;
|
cb.PdfWriter.PageEvent = myPageHelper;
|
||||||
myPageHealper.AllowAllWatermarks = AllowAllWatermarks;
|
myPageHelper.AllowAllWatermarks = AllowAllWatermarks;
|
||||||
myPageHealper.MyPdfWriter = cb.PdfWriter;
|
myPageHelper.MyPdfWriter = cb.PdfWriter;
|
||||||
myPageHealper.CreatingFoldoutPage = false;
|
myPageHelper.CreatingFoldoutPage = false;
|
||||||
myPageHealper.CreatingSupInfoPage = true;
|
myPageHelper.CreatingSupInfoPage = true;
|
||||||
myPageHealper.MyPdfContentByte = cb;
|
myPageHelper.MyPdfContentByte = cb;
|
||||||
myPageHealper.ChangeBarDefinition = MyChangeBarDefinition;
|
myPageHelper.ChangeBarDefinition = MyChangeBarDefinition;
|
||||||
float yPageStart = yTopMargin;
|
float yPageStart = yTopMargin;
|
||||||
vlnParagraph._yPageStartForSupInfo = yTopMargin;
|
vlnParagraph._yPageStartForSupInfo = yTopMargin;
|
||||||
SupInfoAjustGroupings(vlnParagraph,cb);
|
SupInfoAjustGroupings(vlnParagraph,cb);
|
||||||
|
SupInfoPrintType = E_SupInfoPrintType.SupInfoPdfPrint;
|
||||||
vlnParagraph.ToPdf(cb, yPageStart, ref yTopMargin, ref yBottomMargin);
|
vlnParagraph.ToPdf(cb, yPageStart, ref yTopMargin, ref yBottomMargin);
|
||||||
|
SupInfoPrintType = E_SupInfoPrintType.Merge;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
cb.PdfDocument.Close();
|
cb.PdfDocument.Close();
|
||||||
|
@ -465,6 +465,9 @@ namespace Volian.Print.Library
|
|||||||
|
|
||||||
public float ParagraphToPdf(PdfContentByte cb, float yPageStart, float yTopMargin, float yBottomMargin)
|
public float ParagraphToPdf(PdfContentByte cb, float yPageStart, float yTopMargin, float yBottomMargin)
|
||||||
{
|
{
|
||||||
|
// Don't print section titles for supplemental information because the title is 'Supplemental Information':
|
||||||
|
if (MyItemInfo.IsSection && MyPromsPrinter.SupInfoPrintType == E_SupInfoPrintType.SupInfoPdfPrint) return yPageStart;
|
||||||
|
|
||||||
//if(PartsAbove.Count > 0 && PartsAbove[0] is vlnHeader)
|
//if(PartsAbove.Count > 0 && PartsAbove[0] is vlnHeader)
|
||||||
// if (PartsLeft.Count > 0 && PartsLeft[0] is vlnTab)
|
// if (PartsLeft.Count > 0 && PartsLeft[0] is vlnTab)
|
||||||
// //if((PartsLeft[0] as vlnTab).Text[0] != '\u25CF')
|
// //if((PartsLeft[0] as vlnTab).Text[0] != '\u25CF')
|
||||||
@ -1604,13 +1607,17 @@ namespace Volian.Print.Library
|
|||||||
// printing a procedure with section(s) that have supplemental information - determine facing page needed to be merged in. For
|
// printing a procedure with section(s) that have supplemental information - determine facing page needed to be merged in. For
|
||||||
// case 0, it is typically at the beginning of the section since the page break occurred in the code that calls this.
|
// 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
|
// Note that if the procedure has any sections with supinfo, then the entire procedure will need facing pages, either blank page
|
||||||
// or supinfo steps.
|
// or supinfo steps. Also, if the section title is printed, then need to get the facing page before the section title is printed and if
|
||||||
if (MyPromsPrinter.SupInfoPrintType == E_SupInfoPrintType.Merge && !MyItemInfo.IsSection && MyItemInfo.IsHigh && MyItemInfo.MyPrevious == null && !MyItemInfo.IsInSupInfo && (MyItemInfo.MyProcedure as ProcedureInfo).ProcHasSupInfoData)
|
// this is the hls where the section title was printed, don't do the facing page.
|
||||||
|
bool titlePrinted = false;
|
||||||
|
if (MyItemInfo.IsSection || (MyItemInfo.IsHigh && MyItemInfo.MyPrevious == null))
|
||||||
{
|
{
|
||||||
// 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
|
// see if the section title is printed.
|
||||||
// printed, don't put out facing page because it will be put out when there is printable text.
|
SectionConfig sch = MyItemInfo.ActiveSection.MyConfig as SectionConfig;
|
||||||
itemIsPrinted = IsPrintedStepItemForSupInfo();
|
titlePrinted = (sch == null || sch.Section_PrintHdr == "Y") || !(MyItemInfo.MyActiveSection as SectionInfo).HasSupInfoSteps;
|
||||||
if (itemIsPrinted)
|
titlePrinted &= (ShowSectionTitles && !MyItemInfo.MyDocStyle.CancelSectTitle);
|
||||||
|
}
|
||||||
|
if (MyPromsPrinter.SupInfoPrintType == E_SupInfoPrintType.Merge && (MyItemInfo.ActiveSection as SectionInfo).HasSupInfoSteps && ((MyItemInfo.IsHigh && MyItemInfo.MyPrevious == null && !titlePrinted) || (MyItemInfo.IsStepSection && titlePrinted)) && !MyItemInfo.IsInSupInfo && (MyItemInfo.MyProcedure as ProcedureInfo).ProcHasSupInfoData)
|
||||||
{
|
{
|
||||||
// If there is supplemental information to be printed on the facing page, then get the id that has supinfo
|
// 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.
|
// so that it can be retrieved from the pdf for the supinfos for this section.
|
||||||
@ -1626,7 +1633,6 @@ namespace Volian.Print.Library
|
|||||||
MyPromsPrinter.NewPage();
|
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))
|
||||||
yPageStart -= SixLinesPerInch;
|
yPageStart -= SixLinesPerInch;
|
||||||
if (MyPageHelper.ParaBreaks.Count > 0 && MyPageHelper.ParaBreaks[0].CompressFirstPartOfStep)
|
if (MyPageHelper.ParaBreaks.Count > 0 && MyPageHelper.ParaBreaks[0].CompressFirstPartOfStep)
|
||||||
@ -1699,7 +1705,7 @@ namespace Volian.Print.Library
|
|||||||
}
|
}
|
||||||
// See comments under case 0 explaining supinfo/facing page processing.
|
// See comments under case 0 explaining supinfo/facing page processing.
|
||||||
itemIsPrinted = IsPrintedStepItemForSupInfo();
|
itemIsPrinted = IsPrintedStepItemForSupInfo();
|
||||||
if (MyPromsPrinter.SupInfoPrintType == E_SupInfoPrintType.Merge && itemIsPrinted && !MyItemInfo.IsSection && !MyItemInfo.IsInSupInfo && (MyItemInfo.MyProcedure as ProcedureInfo).ProcHasSupInfoData)
|
if (MyPromsPrinter.SupInfoPrintType == E_SupInfoPrintType.Merge && !MyPageHelper.CreatingSupInfoPage && itemIsPrinted /*&& !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)
|
||||||
@ -1809,7 +1815,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.MyProcedure as ProcedureInfo).ProcHasSupInfoData)
|
if (!MyPageHelper.CreatingSupInfoPage && !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)
|
||||||
@ -1968,7 +1974,7 @@ namespace Volian.Print.Library
|
|||||||
}
|
}
|
||||||
// See comments under case 0 explaining supinfo/facing page processing.
|
// See comments under case 0 explaining supinfo/facing page processing.
|
||||||
itemIsPrinted = IsPrintedStepItemForSupInfo();
|
itemIsPrinted = IsPrintedStepItemForSupInfo();
|
||||||
if (MyPromsPrinter.SupInfoPrintType == E_SupInfoPrintType.Merge && itemIsPrinted && !MyItemInfo.IsSection && !MyItemInfo.IsInSupInfo && (MyItemInfo.MyProcedure as ProcedureInfo).ProcHasSupInfoData)
|
if (MyPromsPrinter.SupInfoPrintType == E_SupInfoPrintType.Merge && !MyPageHelper.CreatingSupInfoPage && itemIsPrinted /*&& !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)
|
||||||
@ -3510,6 +3516,8 @@ namespace Volian.Print.Library
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (itemInfo is StepInfo && ((itemInfo as StepInfo).MyConfig as StepConfig).Step_PreferredPagebreak) HasPrefPageBreak = true;
|
if (itemInfo is StepInfo && ((itemInfo as StepInfo).MyConfig as StepConfig).Step_PreferredPagebreak) HasPrefPageBreak = true;
|
||||||
|
// The following adds supplemental information items to the SupInfoSection list off of the section level paragraph for printing
|
||||||
|
// of the sup info pdf. The SupInfoSection list is just a flat list of all supplemental information within the section.
|
||||||
if (MyPromsPrinter.SupInfoPrintType == E_SupInfoPrintType.Merge && loadChildren && itemInfo.SupInfos != null)
|
if (MyPromsPrinter.SupInfoPrintType == E_SupInfoPrintType.Merge && loadChildren && itemInfo.SupInfos != null)
|
||||||
{
|
{
|
||||||
SupInfoSection.ChildrenBelow.Add(cb, itemInfo.SupInfos, XOffset, 0, 0, rnoLevel, maxRNO, formatInfo);
|
SupInfoSection.ChildrenBelow.Add(cb, itemInfo.SupInfos, XOffset, 0, 0, rnoLevel, maxRNO, formatInfo);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user