From 27ef564484e6aa8b47a48072a2f99b17d2918130 Mon Sep 17 00:00:00 2001 From: Rich Date: Mon, 28 Aug 2017 20:13:37 +0000 Subject: [PATCH] B2017-186 - Print SAMGs with Facing Pages and Page Number Transitions --- PROMS/Volian.Print.Library/PromsPrinter.cs | 55 ++++++++++++++-------- 1 file changed, 36 insertions(+), 19 deletions(-) diff --git a/PROMS/Volian.Print.Library/PromsPrinter.cs b/PROMS/Volian.Print.Library/PromsPrinter.cs index b9bfd9b0..d4e5c861 100644 --- a/PROMS/Volian.Print.Library/PromsPrinter.cs +++ b/PROMS/Volian.Print.Library/PromsPrinter.cs @@ -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)