B2017-186 - Print SAMGs with Facing Pages and Page Number Transitions

This commit is contained in:
Rich 2017-08-28 20:13:37 +00:00
parent 5e80643686
commit 27ef564484

View File

@ -284,35 +284,52 @@ namespace Volian.Print.Library
public string Print(string pdfFolder, bool makePlacekeeper, bool makeContinuousActionSummary)
{
if (_MyItem is ProcedureInfo)
{
if ((_MyItem as ProcedureInfo).ProcHasSupInfoData)
{
// Use two passes to print facing page supplemental information for SAMGs
// First pass gets pagination for the step sections and stores the associated supplemental information ids in
// the list StepSectPageBreaksForSupInfo off of the section object
// Second pass prints the supplemental information pdfs using the list generated in the first pass to know where to do the
// supplemental information page breaks & then merges in those pages when printing the step sections.
SupInfoPrintType = E_SupInfoPrintType.DoPageBreaks;
string retstr = Print(_MyItem as ProcedureInfo, pdfFolder, false, false);
if (retstr == null) return null;
SupInfoPrintType = E_SupInfoPrintType.Merge;
return Print(_MyItem as ProcedureInfo, pdfFolder, false, false);
}
else if (!(_MyItem.ActiveFormat.PlantFormat.FormatData.TransData.UseTransitionModifier ||
{ // B2017-186 First do Procedures that don't have page number transitions
if (!(_MyItem.ActiveFormat.PlantFormat.FormatData.TransData.UseTransitionModifier ||
_MyItem.ActiveFormat.PlantFormat.FormatData.TransData.UseSpecificTransitionModifier))
return Print(_MyItem as ProcedureInfo, pdfFolder, makePlacekeeper, makeContinuousActionSummary);
else
{
// B2017-186 Do Facing Page SAMGs
if ((_MyItem as ProcedureInfo).ProcHasSupInfoData)
{
// Use two passes to print facing page supplemental information for SAMGs
// First pass gets pagination for the step sections and stores the associated supplemental information ids in
// the list StepSectPageBreaksForSupInfo off of the section object
// Second pass prints the supplemental information pdfs using the list generated in the first pass to know where to do the
// supplemental information page breaks & then merges in those pages when printing the step sections.
SupInfoPrintType = E_SupInfoPrintType.DoPageBreaks;
string retstr = Print(_MyItem as ProcedureInfo, pdfFolder, false, false);
if (retstr == null) return null;
SupInfoPrintType = E_SupInfoPrintType.Merge;
return Print(_MyItem as ProcedureInfo, pdfFolder, false, false);
}
else // B2017-186 Neither Facing Pages or Page Number Transitions
return Print(_MyItem as ProcedureInfo, pdfFolder, makePlacekeeper, makeContinuousActionSummary);
}
else // B2017-186 Page Number Transitions
{
string retstr;
// if the plant uses transition modifiers and/or page num in transition format,
// need to do two passes. First pass, sets the pagenumbers for each item,
// 2nd pass fills in the page numbers in transitions.
DirectoryInfo di = new DirectoryInfo(pdfFolder + @"\PageNumberPass1");
if (!di.Exists) di.Create();
string retstr = Print(_MyItem as ProcedureInfo, pdfFolder + @"\PageNumberPass1", false, false);
if ((_MyItem as ProcedureInfo).ProcHasSupInfoData)// B2017-186 Adds Facing Page Code to Page Number Transition Code
{
// Use two passes to print facing page supplemental information for SAMGs
// First pass gets pagination for the step sections and stores the associated supplemental information ids in
// the list StepSectPageBreaksForSupInfo off of the section object
// Second pass prints the supplemental information pdfs using the list generated in the first pass to know where to do the
// supplemental information page breaks & then merges in those pages when printing the step sections.
SupInfoPrintType = E_SupInfoPrintType.DoPageBreaks;
retstr = Print(_MyItem as ProcedureInfo, pdfFolder, false, false);
if (retstr == null) return null;
SupInfoPrintType = E_SupInfoPrintType.Merge;
}
retstr = Print(_MyItem as ProcedureInfo, pdfFolder + @"\PageNumberPass1", false, false);
if (retstr == null) return null;
BeforePageNumberPdf = retstr;
BeforePageNumber2Pdf = null; // C2017-018 Initialize Pass 2 PDF Name
ProcedureInfo.RefreshPageNumTransitions(_MyItem as ProcedureInfo);
ProcedureInfo.RefreshPageNumTransitions(_MyItem as ProcedureInfo);
_MyReaderHelper = new ReaderHelper(this);
retstr = Print(_MyItem as ProcedureInfo, pdfFolder, makePlacekeeper, makeContinuousActionSummary);
if (TransPageNumProblems.Count > 0)