C2024-002-Print-Section

This commit is contained in:
Paul Larsen 2024-01-25 09:18:48 -05:00
parent 9b59810c89
commit 0095b2883b
6 changed files with 278 additions and 197 deletions

View File

@ -59,6 +59,13 @@ namespace VEPROMS
get { return _Automatic; }
set { _Automatic = value; }
}
private int _pntSectID = -1;
public int PntSectID
{
get { return _pntSectID; }
set { _pntSectID = value; }
}
// C2018-033 Used to turn off using the date/time PDF file prefix and suffix when doing batch file autmatic baseline print testing (frmVEPROMS.cs RunAutomatic())
// This is needed so the the automatic baselines can compare results from different runs of PROMS
@ -851,6 +858,7 @@ namespace VEPROMS
cbxOrPgBrk.Checked, cbxOpenAfterCreate2.Checked, cbxOverwritePDF2.Checked, GetMultiunitPDFPath(), cbd, txbPDFName.Text,
new Point(Left, Bottom - 50), swtbtnBlankPgsForDuplex.Value, _AllProcedures || Automatic, Prefix, SaveLinks, RemoveTrailingHardReturnsAndManualPageBreaks, swtbtnPROMSVersion.Value, true, tbBlankPage.Text, _MergedPfd, watermarkColor)) // ;//C2018-009 print PROMS version
{
frmStatus.PntSectID = PntSectID;
frmStatus.CloseWhenDone = true;
Application.DoEvents();
frmStatus.CancelStop = true;

View File

@ -91,6 +91,12 @@ namespace VEPROMS
get { return _DidAll; }
set { _DidAll = value; }
}
private int _pntSectID = -1;
public int PntSectID
{
get { return _pntSectID; }
set { _pntSectID = value; }
}
public frmPDFStatusForm(ItemInfo myItem, string rev, string watermark, bool debugOutput, bool origPgBrk, bool openPDF, bool overWrite, string pdfPath, ChangeBarDefinition cbd, string pdfFile, Point newLocation, bool insertBlankPages, bool allOrAuto, string prefix, bool saveLinks, int removeTrailingHardReturnsAndManualPageBreaks, bool showPROMSVer, bool didAll, string blankPageText, MergedPdf mergedPdf, string watermarkColor)
{
// B2021-088 moved this if/else from CreatePDF() so that the Approval logic will have access to this logic

View File

@ -514,6 +514,7 @@ namespace VEPROMS
ItemInfo.ItemDeleted += new ItemInfoEvent(RefreshDisplayHistory);
tv.PrintProcedure += new vlnTreeViewEvent(tv_PrintProcedure);
tv.PrintSection += new vlnTreeViewEvent(tv_PrintSection);
tv.QPrintProcedure += new vlnTreeViewEvent(tv_QPrintProcedure);
tv.PrintAllProcedures += new vlnTreeViewEvent(tv_PrintAllProcedures);
tv.ApproveProcedure += new vlnTreeViewEvent(tv_ApproveProcedure);
@ -1189,6 +1190,45 @@ namespace VEPROMS
}
void tv_PrintSection(object sender, vlnTreeEventArgs args) // Quick Print right click menu on Procedure name.
{
try
{
//args.Node.Parent.
SectionInfo si2 = (args.Node as VETreeNode).VEObject as SectionInfo;
int _pntSectID = si2.ItemID;
if (si2 == null) return;
tc.SaveCurrentEditItem(si2.MyProcedure);
si2.MyDocVersion.DocVersionConfig.SelectedSlave = args.UnitIndex;
using (DlgPrintProcedure prnDlg = new DlgPrintProcedure(si2.MyProcedure))
{
prnDlg.PntSectID = _pntSectID;
prnDlg.SelectedSlave = args.UnitIndex;
prnDlg.MySessionInfo = MySessionInfo;
prnDlg.SetupForProcedure(); // Setup filename
prnDlg.QPCreatePDF(); // Create Print report
si2.MyProcedure.MyDocVersion.DocVersionConfig.SelectedSlave = 0;
}
}
catch (Exception ex)
{
StringBuilder sb = new StringBuilder();
sb.AppendLine("Could not create PDF Print");
sb.AppendLine();
MessageBox.Show(sb.ToString(), "Error when creating PDF Print", MessageBoxButtons.OK, MessageBoxIcon.Warning);
_MyLog.Warn("Failed to create PDF print", ex);
}
}
void tv_CreateContinuousActionSummary(object sender, vlnTreeEventArgs args)
{
DialogResult dr = System.Windows.Forms.DialogResult.Yes;

View File

@ -1,36 +1,36 @@
namespace Volian.Controls.Library
{
partial class vlnTreeView
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
partial class vlnTreeView
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
components = new System.ComponentModel.Container();
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
components = new System.ComponentModel.Container();
}
#endregion
}
#endregion
}
}

View File

@ -506,6 +506,11 @@ namespace Volian.Controls.Library
{
if (QPrintProcedure != null) QPrintProcedure(sender, args);
}
public event vlnTreeViewEvent PrintSection;
private void OnPrintSection(object sender, vlnTreeEventArgs args)
{
if (PrintSection != null) PrintSection(sender, args);
}
public event vlnTreeViewEvent PrintAllProcedures;
private void OnPrintAllProcedures(object sender, vlnTreeEventArgs args)
{
@ -962,7 +967,13 @@ namespace Volian.Controls.Library
}
#endregion
//_MyLog.WarnFormat("Context Menu 2 - {0}", GC.GetTotalMemory(true));
#region Print_Section
if (!tn.IsExpanded && tn.VEObject as SectionInfo != null)
{
SectionInfo si = tn.VEObject as SectionInfo;
if (si.IsStepSection) cm.MenuItems.Add("Print Section", new EventHandler(mi_Click));
}
#endregion
#region Menu_Open
if (!tn.IsExpanded && tn.VEObject as SectionInfo != null)
{
@ -1880,6 +1891,13 @@ namespace Volian.Controls.Library
}
switch (mi.Text)
{
case "Print Section":
VETreeNode tn2 = SelectedNode as VETreeNode;
//ProcedureInfo pi2 = tn2.VEObject as ProcedureInfo;
//SectionInfo sectInfo = tn2.VEObject as SectionInfo;
//OnPrintSection(this, new vlnTreeEventArgs(sectInfo as SectionInfo, null, 0));
OnPrintSection(this, new vlnTreeEventArgs(tn2 as VETreeNode, null, 0));
break;
case "Open":
OpenNode();
break;

View File

@ -179,6 +179,12 @@ namespace Volian.Print.Library
get { return _PDFFile; }
set { _PDFFile = value; }
}
private int _pntSectID = -1;
public int PntSectID
{
get { return _pntSectID; }
set { _pntSectID = value; }
}
private bool _DebugOutput;
public bool DebugOutput
{
@ -942,190 +948,193 @@ namespace Volian.Print.Library
}
foreach (SectionInfo mySection in myProcedure.Sections)
{
// B2020-115 Calculate maximum available space on a page for figures
vlnParagraph.hMax = ((float)mySection.MyDocStyle.Layout.PageLength);
vlnParagraph.wMax = ((float)mySection.MyDocStyle.Layout.PageWidth) - ((float)mySection.MyDocStyle.Layout.LeftMargin - 12);
NeedSupInfoBreak = true;
bool isFoldoutSection = (mySection.MyConfig as SectionConfig).Section_IsFoldout == "Y"; //C2019-042 Section_IsFoldout checks Section Number, Section Title, and use of check box
if (((isFoldoutSection && myProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.SectionLevelFoldouts)
|| (myProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.AlternateFloatingFoldout && isFoldoutSection))
!= doingFoldout) continue;
if (myFoldoutSection != null && myFoldoutSection.ItemID != mySection.ItemID) continue;
PrintOverride.CompressSuper = mySection.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.CompressHPSuper;
PrintOverride.CompressSub = mySection.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.CompressHPSub;
PrintOverride.CompressPropSubSup = mySection.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.CompressPropSubSup;
if(PntSectID == -1 || (PntSectID > -1 && mySection.ItemID == PntSectID) )
{
// B2020-115 Calculate maximum available space on a page for figures
vlnParagraph.hMax = ((float)mySection.MyDocStyle.Layout.PageLength);
vlnParagraph.wMax = ((float)mySection.MyDocStyle.Layout.PageWidth) - ((float)mySection.MyDocStyle.Layout.LeftMargin - 12);
NeedSupInfoBreak = true;
bool isFoldoutSection = (mySection.MyConfig as SectionConfig).Section_IsFoldout == "Y"; //C2019-042 Section_IsFoldout checks Section Number, Section Title, and use of check box
if (((isFoldoutSection && myProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.SectionLevelFoldouts)
|| (myProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.AlternateFloatingFoldout && isFoldoutSection))
!= doingFoldout) continue;
if (myFoldoutSection != null && myFoldoutSection.ItemID != mySection.ItemID) continue;
PrintOverride.CompressSuper = mySection.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.CompressHPSuper;
PrintOverride.CompressSub = mySection.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.CompressHPSub;
PrintOverride.CompressPropSubSup = mySection.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.CompressPropSubSup;
OnStatusChanged((mySection.DisplayNumber ?? "") == "" ? mySection.DisplayText : mySection.DisplayNumber, PromsPrinterStatusType.Progress, progress++);
// Set up Helper for the particular Section
if (_MyHelper == null)
{
LastFmtName = mySection.ActiveFormat.Name;
lastDocStyle = (int)mySection.MyDocStyle.Index;
string hlsText = "";
int hlsItemId = 0;
if (mySection.IsStepSection && mySection.Steps != null && mySection.Steps.Count > 0)
OnStatusChanged((mySection.DisplayNumber ?? "") == "" ? mySection.DisplayText : mySection.DisplayNumber, PromsPrinterStatusType.Progress, progress++);
// Set up Helper for the particular Section
if (_MyHelper == null)
{
hlsItemId = mySection.Steps[0].ItemID;
hlsText = mySection.Steps[0].DisplayText; // save the High level step text for use in the page list
}
cb.PdfWriter.PageEvent = _MyHelper = new VlnSvgPageHelper(mySection, this, hlsText, hlsItemId);
_MyHelper.AllowAllWatermarks = AllowAllWatermarks;
_MyHelper.MyPdfWriter = cb.PdfWriter;
_MyHelper.CreatingFoldoutPage = doingFoldout;
_MyHelper.CreatingSupInfoPage = false;
_MyHelper.MyPdfContentByte = cb;
if (!mySection.IsStepSection) _MyHelper.PageBookmarks.Add((ItemInfo)mySection, ((mySection.DisplayNumber ?? "") == "" ? "" : mySection.DisplayNumber + " - ") + mySection.DisplayText, null);
if (DebugOutput)
{
// 16-bit background
string procedureFileName = BackgroundFolder + "\\" + PDFFile.Trim();//CreateFileName(myProcedure.DisplayNumber);
FileInfo VEPromsFile = new FileInfo(procedureFileName);
if (VEPromsFile.Exists && !doingFoldout)
{
_MyHelper.BackgroundFile = procedureFileName;
float x = 0;
float y = 0;
if (!(mySection.ActiveFormat.Name.ToUpper().StartsWith("WST") || _MyHelper.Back32BitPROMS)) // compare folder contains PROMS generated PDF
{
// X value below = 16-bit pdf OverrideLeftMargin = -2 characters at the plant format's default Font's
// characters per inch.
// 16bit OverrideLeftMargin, defined as -2 in driver\drvin.rtf, - override took 2 characters out, so we're adding it back in:
// These values adjust if overlay is 16bit versus 32bit. This is
// used so that the comparison is an exact match. Use 0,0 if comparing to another 32bit
// pdf, i.e. won't process the following 2 lines of code.
x = 2 * 72F / (float)myProcedure.ActiveFormat.PlantFormat.FormatData.Font.CPI;
y = -9.5F;
}
x += 72F * VlnSettings.GetCommandFloat("X", 0);
y -= 72F * VlnSettings.GetCommandFloat("Y", 0);
_MyHelper.BackgroundOffset = new PointF(x, y);
_MyHelper.BackgroundPageOffset = 0;
}
_MyHelper.WatermarkLayer = _WatermarkLayer;
_MyHelper.PageListLayer = _PagelistLayer;
_MyHelper.TextLayer = _TextLayer;
_MyHelper.BackgroundLayer = _BackgroundLayer;
_MyHelper.DebugLayer = _DebugLayer;
_MyHelper.PROMSVersionLayer = _PROMSVersionLayer; //C2018-009 print PROMS version
}
_MyHelper.Rev = _Rev;
_MyHelper.Watermark = _Watermark;
// C2019-039 Remove automatic zoom on Overlay PDFs
//_MyHelper.DoZoomOMatic = DebugOutput;
_MyHelper.OriginalPageBreak = OriginalPageBreak;
_MyHelper.PROMSVersion = _PromsVersion; //C2018-009 print PROMS version
_MyHelper.WatermarkColor = WatermarkOverrideColor; // C2021-019: save the override for the watermark color
OnStatusChanged("After Set PageEvent", PromsPrinterStatusType.SetPageEvent);
}
else
{
//added by jcb to reset mygaps when changing a section. found old section gaps were carrying over to new section
_MyHelper.MyGaps.Clear();
//Console.WriteLine("'{0}' PromsPrinter", mySection.DisplayText);
// if pagination is separate or we've changed the format, we have not done the first page
// (if this format has the useonfirst page docstyle flag)
if (LastFmtName != mySection.ActiveFormat.Name || lastDocStyle != (int)mySection.MyDocStyle.Index || mySection.SectionConfig.Section_Pagination == SectionConfig.SectionPagination.Separate)
{
_MyHelper.DidFirstPageDocStyle = false;
lastDocStyle = (int)mySection.MyDocStyle.Index;
LastFmtName = mySection.ActiveFormat.Name;
}
if (!mySection.IsStepSection) _MyHelper.PageBookmarks.Add((ItemInfo)mySection, ((mySection.DisplayNumber ?? "") == "" ? "" : mySection.DisplayNumber + " - ") + mySection.DisplayText, null);
_MyHelper.MySection = mySection;
//OnStatusChanged("After Set Svg", PromsPrinterStatusType.SetSVG);
}
// if this format uses phonelists, see if this section has one. We need to know the number
//of lines to adjust the pagelength for pagination and printing.
_MyHelper.PhoneListHeight = 0;
if (mySection.ActiveFormat.PlantFormat.FormatData.SectData.PrintPhoneList)
{
// get config for section
SectionConfig sc = mySection.MyConfig as SectionConfig;
if (sc.Section_PhoneList != null && sc.Section_PhoneList == "Y")
{
DocVersionConfig dvc = mySection.MyDocVersion.MyConfig as DocVersionConfig;
if (dvc != null)
lastDocStyle = (int)mySection.MyDocStyle.Index;
string hlsText = "";
int hlsItemId = 0;
if (mySection.IsStepSection && mySection.Steps != null && mySection.Steps.Count > 0)
{
string phlist = dvc.Print_PhoneList;
if (phlist != null && phlist != "")
{
// count lines:
int cl = 0;
int indx = phlist.IndexOf("\n");
while (indx > 0)
{
cl++;
if (indx + 1 > phlist.Length)
indx = -1;
else
indx = phlist.IndexOf("\n", indx + 1);
}
if (cl == 0) cl = 1; // phone list is a single line without an ending newline
_MyHelper.PhoneListHeight = cl * vlnPrintObject.SixLinesPerInch;
}
hlsItemId = mySection.Steps[0].ItemID;
hlsText = mySection.Steps[0].DisplayText; // save the High level step text for use in the page list
}
}
}
_MyHelper.FinalMessageSectionID = finalMessageSectionID; // set VlnSvgPageHelper with the finalMessageSectionID
cb.PdfWriter.PageEvent = _MyHelper = new VlnSvgPageHelper(mySection, this, hlsText, hlsItemId);
_MyHelper.AllowAllWatermarks = AllowAllWatermarks;
_MyHelper.MyPdfWriter = cb.PdfWriter;
_MyHelper.CreatingFoldoutPage = doingFoldout;
_MyHelper.CreatingSupInfoPage = false;
_MyHelper.MyPdfContentByte = cb;
if (mySection.IsAutoTOCSection)
{
if (((cb.PdfWriter.CurrentPageNumber % 2 == 0 && !_MyHelper.CreatingFoldoutPage) || myProcedure.ProcHasSupInfoData) && InsertBlankPages) // Bug Fix: B2016-181 - add blank page if page count is even
{
InsertBlankPage(cb);
}
GenerateTOC(mySection, myProcedure, cb, _TextLayer);
// B2020-102: extra page printing after auto TOC for summer. Retested for Farley and was successful also
// F2018-033: Farley Auto TOC. If doing foldouts or supinfo facing pages, add a blank page after also:
//if (myProcedure.ProcHasSupInfoData && InsertBlankPages) // Bug Fix: B2016-181 - add blank page if page count is even
//{
// InsertBlankPage(cb);
//}
}
else
{
if (mySection.IsStepSection)
{
if (mySection.Steps != null && mySection.Steps.Count > 0)
if (!mySection.IsStepSection) _MyHelper.PageBookmarks.Add((ItemInfo)mySection, ((mySection.DisplayNumber ?? "") == "" ? "" : mySection.DisplayNumber + " - ") + mySection.DisplayText, null);
if (DebugOutput)
{
// get first step to send to floating foldout indx.&& MyItemInfo.FoldoutIndex>-1)
ItemInfo firstStep = mySection.Steps[0];
// B2019-165 Don't print the duplex foldout (on the back of the page) if the Don't Include Duplex Foldout check box was checked in section properties
if (firstStep.FoldoutIndex() > -1 && (mySection.MyPrevious == null || !((mySection.MyPrevious.MyConfig as SectionConfig).Section_DontIncludeDuplexFoldout)))
DoFoldoutPage(cb, "Beginning of Step Section", _TextLayer, _MyHelper, firstStep.FoldoutIndex(), InsertBlankPages);
else if (!_MyHelper.CreatingFoldoutPage && _MyFoldoutReader.Count > 0 && InsertBlankPages)
// 16-bit background
string procedureFileName = BackgroundFolder + "\\" + PDFFile.Trim();//CreateFileName(myProcedure.DisplayNumber);
FileInfo VEPromsFile = new FileInfo(procedureFileName);
if (VEPromsFile.Exists && !doingFoldout)
{
// if it is continuous pagination, don't do blank page - not sure if this is correct place for this:
// C2023-001 if the previous section has the flag to not insert blank pages,
// then don't insert a blank page between the previous section and this one
if (mySection.SectionConfig.Section_Pagination == SectionConfig.SectionPagination.Separate && !mySection.SearchPrev.MyDocStyle.DontInsertBlankPages)
_MyHelper.BackgroundFile = procedureFileName;
float x = 0;
float y = 0;
if (!(mySection.ActiveFormat.Name.ToUpper().StartsWith("WST") || _MyHelper.Back32BitPROMS)) // compare folder contains PROMS generated PDF
{
// only insert a blank page if this section does not have a foldout (but the procedure as a whole does)
// and the checkbox on the print dialog to add blank pages is checked
InsertBlankPage(cb);
//_MyLog.InfoFormat("NewPage Begin Step Sect blank {0}", cb.PdfWriter.CurrentPageNumber);
}
}
else
{
// If the procedure has supplemental facing pages, but this section does not & it's the first section,
// need a blank 'facing page'. Sections after the first will get blank 'facing page' in print's pagination logic
if (SupInfoPrintType == E_SupInfoPrintType.Merge && !mySection.HasSupInfoSteps && firstStepSec && InsertBlankPages)
{
InsertBlankPage(cb);
// X value below = 16-bit pdf OverrideLeftMargin = -2 characters at the plant format's default Font's
// characters per inch.
// 16bit OverrideLeftMargin, defined as -2 in driver\drvin.rtf, - override took 2 characters out, so we're adding it back in:
// These values adjust if overlay is 16bit versus 32bit. This is
// used so that the comparison is an exact match. Use 0,0 if comparing to another 32bit
// pdf, i.e. won't process the following 2 lines of code.
x = 2 * 72F / (float)myProcedure.ActiveFormat.PlantFormat.FormatData.Font.CPI;
y = -9.5F;
}
x += 72F * VlnSettings.GetCommandFloat("X", 0);
y -= 72F * VlnSettings.GetCommandFloat("Y", 0);
_MyHelper.BackgroundOffset = new PointF(x, y);
_MyHelper.BackgroundPageOffset = 0;
}
_MyHelper.WatermarkLayer = _WatermarkLayer;
_MyHelper.PageListLayer = _PagelistLayer;
_MyHelper.TextLayer = _TextLayer;
_MyHelper.BackgroundLayer = _BackgroundLayer;
_MyHelper.DebugLayer = _DebugLayer;
_MyHelper.PROMSVersionLayer = _PROMSVersionLayer; //C2018-009 print PROMS version
}
firstStepSec = false;
CreateStepPdf(mySection, cb);
_MyHelper.Rev = _Rev;
_MyHelper.Watermark = _Watermark;
// C2019-039 Remove automatic zoom on Overlay PDFs
//_MyHelper.DoZoomOMatic = DebugOutput;
_MyHelper.OriginalPageBreak = OriginalPageBreak;
_MyHelper.PROMSVersion = _PromsVersion; //C2018-009 print PROMS version
_MyHelper.WatermarkColor = WatermarkOverrideColor; // C2021-019: save the override for the watermark color
OnStatusChanged("After Set PageEvent", PromsPrinterStatusType.SetPageEvent);
}
else
{
CreateWordDocPdf(cb, mySection);
//added by jcb to reset mygaps when changing a section. found old section gaps were carrying over to new section
_MyHelper.MyGaps.Clear();
//Console.WriteLine("'{0}' PromsPrinter", mySection.DisplayText);
// if pagination is separate or we've changed the format, we have not done the first page
// (if this format has the useonfirst page docstyle flag)
if (LastFmtName != mySection.ActiveFormat.Name || lastDocStyle != (int)mySection.MyDocStyle.Index || mySection.SectionConfig.Section_Pagination == SectionConfig.SectionPagination.Separate)
{
_MyHelper.DidFirstPageDocStyle = false;
lastDocStyle = (int)mySection.MyDocStyle.Index;
LastFmtName = mySection.ActiveFormat.Name;
}
if (!mySection.IsStepSection) _MyHelper.PageBookmarks.Add((ItemInfo)mySection, ((mySection.DisplayNumber ?? "") == "" ? "" : mySection.DisplayNumber + " - ") + mySection.DisplayText, null);
_MyHelper.MySection = mySection;
//OnStatusChanged("After Set Svg", PromsPrinterStatusType.SetSVG);
}
// if this format uses phonelists, see if this section has one. We need to know the number
//of lines to adjust the pagelength for pagination and printing.
_MyHelper.PhoneListHeight = 0;
if (mySection.ActiveFormat.PlantFormat.FormatData.SectData.PrintPhoneList)
{
// get config for section
SectionConfig sc = mySection.MyConfig as SectionConfig;
if (sc.Section_PhoneList != null && sc.Section_PhoneList == "Y")
{
DocVersionConfig dvc = mySection.MyDocVersion.MyConfig as DocVersionConfig;
if (dvc != null)
{
string phlist = dvc.Print_PhoneList;
if (phlist != null && phlist != "")
{
// count lines:
int cl = 0;
int indx = phlist.IndexOf("\n");
while (indx > 0)
{
cl++;
if (indx + 1 > phlist.Length)
indx = -1;
else
indx = phlist.IndexOf("\n", indx + 1);
}
if (cl == 0) cl = 1; // phone list is a single line without an ending newline
_MyHelper.PhoneListHeight = cl * vlnPrintObject.SixLinesPerInch;
}
}
}
}
_MyHelper.FinalMessageSectionID = finalMessageSectionID; // set VlnSvgPageHelper with the finalMessageSectionID
if (mySection.IsAutoTOCSection)
{
if (((cb.PdfWriter.CurrentPageNumber % 2 == 0 && !_MyHelper.CreatingFoldoutPage) || myProcedure.ProcHasSupInfoData) && InsertBlankPages) // Bug Fix: B2016-181 - add blank page if page count is even
{
InsertBlankPage(cb);
}
GenerateTOC(mySection, myProcedure, cb, _TextLayer);
// B2020-102: extra page printing after auto TOC for summer. Retested for Farley and was successful also
// F2018-033: Farley Auto TOC. If doing foldouts or supinfo facing pages, add a blank page after also:
//if (myProcedure.ProcHasSupInfoData && InsertBlankPages) // Bug Fix: B2016-181 - add blank page if page count is even
//{
// InsertBlankPage(cb);
//}
}
else
{
if (mySection.IsStepSection)
{
if (mySection.Steps != null && mySection.Steps.Count > 0)
{
// get first step to send to floating foldout indx.&& MyItemInfo.FoldoutIndex>-1)
ItemInfo firstStep = mySection.Steps[0];
// B2019-165 Don't print the duplex foldout (on the back of the page) if the Don't Include Duplex Foldout check box was checked in section properties
if (firstStep.FoldoutIndex() > -1 && (mySection.MyPrevious == null || !((mySection.MyPrevious.MyConfig as SectionConfig).Section_DontIncludeDuplexFoldout)))
DoFoldoutPage(cb, "Beginning of Step Section", _TextLayer, _MyHelper, firstStep.FoldoutIndex(), InsertBlankPages);
else if (!_MyHelper.CreatingFoldoutPage && _MyFoldoutReader.Count > 0 && InsertBlankPages)
{
// if it is continuous pagination, don't do blank page - not sure if this is correct place for this:
// C2023-001 if the previous section has the flag to not insert blank pages,
// then don't insert a blank page between the previous section and this one
if (mySection.SectionConfig.Section_Pagination == SectionConfig.SectionPagination.Separate && !mySection.SearchPrev.MyDocStyle.DontInsertBlankPages)
{
// only insert a blank page if this section does not have a foldout (but the procedure as a whole does)
// and the checkbox on the print dialog to add blank pages is checked
InsertBlankPage(cb);
//_MyLog.InfoFormat("NewPage Begin Step Sect blank {0}", cb.PdfWriter.CurrentPageNumber);
}
}
else
{
// If the procedure has supplemental facing pages, but this section does not & it's the first section,
// need a blank 'facing page'. Sections after the first will get blank 'facing page' in print's pagination logic
if (SupInfoPrintType == E_SupInfoPrintType.Merge && !mySection.HasSupInfoSteps && firstStepSec && InsertBlankPages)
{
InsertBlankPage(cb);
}
}
}
firstStepSec = false;
CreateStepPdf(mySection, cb);
}
else
{
CreateWordDocPdf(cb, mySection);
}
}
_MyHelper.PrintedSectionPage = 0;
}
_MyHelper.PrintedSectionPage = 0;
}
if (_MyHelper != null && _MyHelper.BackgroundFile != null)
{