Add text to checkbox for blank page printing
Improve pagination for SAMG facing page print
This commit is contained in:
parent
d8f00ec197
commit
bbbcdf946a
@ -1153,7 +1153,7 @@ namespace VEPROMS
|
||||
this.cbxBlankPgsForDuplex.Name = "cbxBlankPgsForDuplex";
|
||||
this.cbxBlankPgsForDuplex.Size = new System.Drawing.Size(323, 19);
|
||||
this.cbxBlankPgsForDuplex.TabIndex = 101;
|
||||
this.cbxBlankPgsForDuplex.Text = "Add Blank Pages When Using Duplex Foldouts";
|
||||
this.cbxBlankPgsForDuplex.Text = "Add Blank Pages For Duplex Foldouts or SAMG Facing Pages";
|
||||
this.cbxBlankPgsForDuplex.UseVisualStyleBackColor = false;
|
||||
//
|
||||
// cbxGeneratePlacekeeper
|
||||
|
@ -6885,6 +6885,14 @@ namespace VEPROMS.CSLA.Library
|
||||
[Serializable()]
|
||||
public partial class SectionInfo : ItemInfo, IVEDrillDownReadOnly
|
||||
{
|
||||
// Keeps track of itemids for supplemental info steps where their associated steps would have page breaks.
|
||||
private List<int> _StepSectPageBreaksForSupInfo = null;
|
||||
public List<int> StepSectPageBreaksForSupInfo
|
||||
{
|
||||
get { return _StepSectPageBreaksForSupInfo; }
|
||||
set { _StepSectPageBreaksForSupInfo = value; }
|
||||
}
|
||||
|
||||
// Determine if this section contains any Supplemental information steps. This is used for print to determine
|
||||
// whether some of the supinfo processing needs to occur.
|
||||
private bool? _HasSupInfoSteps = null;
|
||||
|
@ -240,5 +240,11 @@ namespace VEPROMS.CSLA.Library
|
||||
CtrlRight = 7,
|
||||
CtrlLeft = 8
|
||||
}
|
||||
public enum E_SupInfoPrintType : uint
|
||||
{
|
||||
None = 0,
|
||||
DoPageBreaks = 1,
|
||||
Merge = 2
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
@ -78,13 +78,13 @@ namespace Volian.Print.Library
|
||||
ShowPageBreak(1, "Page Break before empty section", "Yes", YSize, yPageSize, yWithinMargins, ManualPageBreak);
|
||||
return 1;
|
||||
}
|
||||
// If printing a supinfo part, add an entry to the dictionary that says what page I am on.
|
||||
if (MyPageHelper.PrintingSupplmentalInformation)
|
||||
// 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
|
||||
if (MyPromsPrinter.SupInfoPrintType == E_SupInfoPrintType.Merge && MyPageHelper.CreatingSupInfoPage)
|
||||
{
|
||||
int retval = 0;
|
||||
// came across a user defined preferred page break, increment the page count for the supplemental info pdf & return 1 to break the page.
|
||||
// the PrefPageBreak is set when creating the paragraphs (see vlnParagraph constructor)
|
||||
if (PrefPageBreak)
|
||||
SectionInfo supInfoSect = MyItemInfo.MyActiveSection as SectionInfo;
|
||||
if (supInfoSect.StepSectPageBreaksForSupInfo != null && supInfoSect.StepSectPageBreaksForSupInfo.Contains(MyItemInfo.ItemID))
|
||||
{
|
||||
MyPromsPrinter.SupInfoPdfPageCount++;
|
||||
retval = 1;
|
||||
@ -99,6 +99,7 @@ namespace Volian.Print.Library
|
||||
}
|
||||
else if (MyItemInfo.MyDocStyle.SupplementalInformation && MyItemInfo.IsStep)
|
||||
{
|
||||
if (MyItemInfo.IsHigh && MyItemInfo.MyPrevious == null) return 1;
|
||||
StepConfig sci = MyItemInfo.MyConfig as StepConfig;
|
||||
if (sci.Step_PreferredPagebreak)
|
||||
{
|
||||
|
@ -87,6 +87,8 @@ namespace Volian.Print.Library
|
||||
}
|
||||
public class PromsPrinter
|
||||
{
|
||||
public bool NeedSupInfoBreak = false;
|
||||
public E_SupInfoPrintType SupInfoPrintType = E_SupInfoPrintType.None;
|
||||
// used to link supinfo steps in pdf
|
||||
public int SupInfoPdfPageCount = -1;
|
||||
private Dictionary<int, int> _SupInfoPdfPage;
|
||||
@ -95,6 +97,12 @@ namespace Volian.Print.Library
|
||||
get { return _SupInfoPdfPage; }
|
||||
set { _SupInfoPdfPage = value; }
|
||||
}
|
||||
private bool _DoingFacingPage = false; // used to flag actual pdf generation of facing page within final print (so no section titles get printed)
|
||||
public bool DoingFacingPage
|
||||
{
|
||||
get { return _DoingFacingPage; }
|
||||
set { _DoingFacingPage = value; }
|
||||
}
|
||||
// used to save word sections with resolved ROs (for export file generated from approve)
|
||||
private Dictionary<int, byte[]> _DocReplace;
|
||||
public Dictionary<int, byte[]> DocReplace
|
||||
@ -268,7 +276,20 @@ namespace Volian.Print.Library
|
||||
{
|
||||
if (_MyItem is ProcedureInfo)
|
||||
{
|
||||
if (!(_MyItem.ActiveFormat.PlantFormat.FormatData.TransData.UseTransitionModifier ||
|
||||
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 ||
|
||||
_MyItem.ActiveFormat.PlantFormat.FormatData.TransData.UseSpecificTransitionModifier))
|
||||
return Print(_MyItem as ProcedureInfo, pdfFolder, makePlacekeeper, makeContinuousActionSummary);
|
||||
else
|
||||
@ -286,7 +307,7 @@ namespace Volian.Print.Library
|
||||
retstr = Print(_MyItem as ProcedureInfo, pdfFolder, makePlacekeeper, makeContinuousActionSummary);
|
||||
if (TransPageNumProblems.Count > 0)
|
||||
{
|
||||
if (BatchPrint || ( MessageBox.Show("Page Number Transitions may be fixed if a second pass is performed. Do you want to perform a second pass?", "Page Number Transition Errors", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes))
|
||||
if (BatchPrint || (MessageBox.Show("Page Number Transitions may be fixed if a second pass is performed. Do you want to perform a second pass?", "Page Number Transition Errors", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes))
|
||||
{
|
||||
DirectoryInfo di1 = new DirectoryInfo(pdfFolder + @"\PageNumberPass2");
|
||||
if (!di1.Exists) di1.Create();
|
||||
@ -297,7 +318,7 @@ namespace Volian.Print.Library
|
||||
{
|
||||
fi.MoveTo(di1.FullName + @"\" + fi.Name);
|
||||
}
|
||||
catch(Exception ex)
|
||||
catch (Exception ex)
|
||||
{
|
||||
_MyLog.ErrorFormat("{0} During Save {1}", ex.GetType().FullName, ex.Message);
|
||||
}
|
||||
@ -698,6 +719,7 @@ namespace Volian.Print.Library
|
||||
bool firstStepSec = true;
|
||||
foreach (SectionInfo mySection in myProcedure.Sections)
|
||||
{
|
||||
NeedSupInfoBreak = true;
|
||||
if (((mySection.MyContent.Number.ToUpper() == "FOLDOUT" && myProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.SectionLevelFoldouts)
|
||||
|| (myProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.AlternateFloatingFoldout && mySection.MyContent.Text.ToUpper().Contains("FOLDOUT")))
|
||||
!= doingFoldout) continue;
|
||||
@ -853,7 +875,7 @@ namespace Volian.Print.Library
|
||||
{
|
||||
// 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 (myProcedure.ProcHasSupInfoData && !mySection.HasSupInfoSteps && firstStepSec && InsertBlankPages)
|
||||
if (SupInfoPrintType==E_SupInfoPrintType.Merge && !mySection.HasSupInfoSteps && firstStepSec && InsertBlankPages)
|
||||
{
|
||||
_MyHelper.OnBlankPage = true;
|
||||
cb.PdfDocument.Add(new iTextSharp.text.Table(1));
|
||||
@ -1586,6 +1608,11 @@ namespace Volian.Print.Library
|
||||
//PrintTimer pt = new PrintTimer();
|
||||
iTextSharp.text.pdf.PdfWriter writer = cb.PdfWriter;
|
||||
ItemInfo myItemInfo = section as ItemInfo;
|
||||
if (SupInfoPrintType == E_SupInfoPrintType.DoPageBreaks)
|
||||
{
|
||||
if (section.StepSectPageBreaksForSupInfo == null) section.StepSectPageBreaksForSupInfo = new List<int>();
|
||||
else section.StepSectPageBreaksForSupInfo.Clear();
|
||||
}
|
||||
// 792: 72 * 11 inches - TopRow - Top is high value
|
||||
float _PointsPerPage = 792;
|
||||
float yTopMargin = _PointsPerPage - (float)myItemInfo.MyDocStyle.Layout.TopMargin;
|
||||
@ -1607,7 +1634,7 @@ namespace Volian.Print.Library
|
||||
_MyHelper.IsLandscape = false;
|
||||
_MyHelper.ChangeBarDefinition = MyChangeBarDefinition;
|
||||
//pt.Description = "vlnParagrph";
|
||||
vlnParagraph myParagraph = new vlnParagraph(null, cb, myItemInfo, (float)myItemInfo.MyDocStyle.Layout.LeftMargin, _NoBreakYOffset, 0, myItemInfo.ColumnMode, myItemInfo.ActiveFormat, null, null, 0,true,this);
|
||||
vlnParagraph myParagraph = new vlnParagraph(null, cb, myItemInfo, (float)myItemInfo.MyDocStyle.Layout.LeftMargin, _NoBreakYOffset, 0, myItemInfo.ColumnMode, myItemInfo.ActiveFormat, null, null, 0, true, this);
|
||||
//pt.Description = "After vlnParagrph";
|
||||
//if (myParagraph.MyItemInfo.InList(15906))
|
||||
//{
|
||||
@ -1620,7 +1647,7 @@ namespace Volian.Print.Library
|
||||
{
|
||||
// if there is supplemental information associated with this section... generate the pdf. This pdf will be used to place
|
||||
// supplemental information on facing pages
|
||||
if (myParagraph.SupInfoSection != null && myParagraph.SupInfoSection.ChildrenBelow != null && myParagraph.SupInfoSection.ChildrenBelow.Count > 0)
|
||||
if (SupInfoPrintType == E_SupInfoPrintType.Merge && myParagraph.SupInfoSection != null && myParagraph.SupInfoSection.ChildrenBelow != null && myParagraph.SupInfoSection.ChildrenBelow.Count > 0)
|
||||
GenerateSuppInfoPdf(myParagraph.SupInfoSection, yTopMargin, yBottomMargin);
|
||||
localYPageStart = myParagraph.ToPdf(cb, yPageStart, ref yTopMargin, ref yBottomMargin);
|
||||
if (myParagraph.MyPlaceKeeper != null)
|
||||
@ -1706,7 +1733,6 @@ namespace Volian.Print.Library
|
||||
myPageHealper.CreatingSupInfoPage = true;
|
||||
myPageHealper.MyPdfContentByte = cb;
|
||||
myPageHealper.ChangeBarDefinition = MyChangeBarDefinition;
|
||||
myPageHealper.PrintingSupplmentalInformation = true;
|
||||
float yPageStart = yTopMargin;
|
||||
vlnParagraph._yPageStartForSupInfo = yTopMargin;
|
||||
vlnParagraph.ToPdf(cb, yPageStart, ref yTopMargin, ref yBottomMargin);
|
||||
@ -1743,7 +1769,11 @@ namespace Volian.Print.Library
|
||||
PdfReader pdfreader = new PdfReader(SupInfoPdfName);
|
||||
sipage = cb.PdfWriter.GetImportedPage(pdfreader, getpage+1);
|
||||
AddImportedPageToLayer(cb.PdfWriter.DirectContent, textLayer, sipage, 0, 0);
|
||||
DoingFacingPage = true;
|
||||
myPageHelper.ResetSvg();
|
||||
NewPage();
|
||||
DoingFacingPage = false;
|
||||
myPageHelper.ResetSvg();
|
||||
pdfreader.Close();
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
@ -222,13 +222,6 @@ namespace Volian.Print.Library
|
||||
get { return _PrintedSectionPage; }
|
||||
set { _PrintedSectionPage = value; }
|
||||
}
|
||||
private bool _PrintingSupplmentalInformation = false;
|
||||
public bool PrintingSupplmentalInformation
|
||||
{
|
||||
get { return _PrintingSupplmentalInformation; }
|
||||
set { _PrintingSupplmentalInformation = value; }
|
||||
}
|
||||
|
||||
//private bool _AddBlankPagesForDuplexPrinting = false;
|
||||
//public bool AddBlankPagesForDuplexPrinting // Tells us if a the option to add a blank page is turn on (for procedures with duplex foldouts)
|
||||
//{
|
||||
@ -987,8 +980,8 @@ namespace Volian.Print.Library
|
||||
{
|
||||
HLSText = hlsText;
|
||||
HasHLSTextId = hlsItemId;
|
||||
MySection = mySection;
|
||||
MyPromsPrinter = myPromsPrinter;
|
||||
MySection = mySection;
|
||||
}
|
||||
private Volian.Svg.Library.Svg BuildSvg(VEPROMS.CSLA.Library.SectionInfo mySection, bool forceLoad)
|
||||
{
|
||||
@ -1657,6 +1650,7 @@ namespace Volian.Print.Library
|
||||
{
|
||||
if (section.DisplayText.ToUpper().Contains("<NO TITLE>") && !section.ActiveFormat.PlantFormat.FormatData.ProcData.PrintNoTitle) printsectlevel = false;
|
||||
}
|
||||
if (MyPromsPrinter.DoingFacingPage) printsectlevel = false; // don't put out section title/number if doing SAMG facing pages
|
||||
if (printsectlevel)
|
||||
{
|
||||
string stitle = section.DisplayText;
|
||||
@ -1690,8 +1684,14 @@ namespace Volian.Print.Library
|
||||
break;
|
||||
case "{SECTIONLEVELNUMBER}":
|
||||
case "[SECTIONLEVELNUMBER]":
|
||||
plstr = plstr.Replace(token, section.DisplayNumber);
|
||||
_sectLevelNumTtlDiff = (int)pageItem.Row;
|
||||
// don't put out section title/number if doing SAMG facing pages
|
||||
if (!MyPromsPrinter.DoingFacingPage)
|
||||
{
|
||||
plstr = plstr.Replace(token, section.DisplayNumber);
|
||||
_sectLevelNumTtlDiff = (int)pageItem.Row;
|
||||
}
|
||||
else
|
||||
plstr = plstr.Replace(token, "");
|
||||
//svgGroup.Add(PageItemToSvgText(pageItem, pageItem.Token.Replace(token, section.DisplayNumber)));
|
||||
break;
|
||||
case "{METASECTIONNUMBER}": // This will print the top level section number
|
||||
|
@ -1532,6 +1532,15 @@ namespace Volian.Print.Library
|
||||
bool firstHighLevelStep = MyItemInfo.IsHigh && (MyItemInfo.MyPrevious == null);
|
||||
bool doSectionTitleContinued = false; // will add " Continued" to the section title if format flag is set
|
||||
DocStyle docstyle = null;
|
||||
// If SAMG facing page print & doing first pass to generate page break list of supplemental info and
|
||||
// there was a page break in the step section, but not an associated supinfo item, do the page break when the
|
||||
// next supinfo item is found:
|
||||
SectionInfo supInfoSect = MyItemInfo.MyActiveSection as SectionInfo;
|
||||
if (MyPromsPrinter.SupInfoPrintType == E_SupInfoPrintType.DoPageBreaks && MyPromsPrinter.NeedSupInfoBreak && MyItemInfo.SupInfos != null && MyItemInfo.SupInfos.Count > 0)
|
||||
{
|
||||
supInfoSect.StepSectPageBreaksForSupInfo.Add(MyItemInfo.SupInfos[0].ItemID);
|
||||
MyPromsPrinter.NeedSupInfoBreak = false;
|
||||
}
|
||||
switch (paginate)
|
||||
{
|
||||
// .oooooo. .oooo.
|
||||
@ -1555,6 +1564,21 @@ namespace Volian.Print.Library
|
||||
yPageStart = _yPageStartForSupInfo - SixLinesPerInch;
|
||||
yLocation = yPageStart - YTopMost;
|
||||
}
|
||||
// printing a procedure with section(s) that have supplemental information - determine facing page needed to be merged in:
|
||||
if (MyPromsPrinter.SupInfoPrintType == E_SupInfoPrintType.Merge && !MyItemInfo.IsSection && MyItemInfo.IsHigh && MyItemInfo.MyPrevious == null && !MyItemInfo.IsInSupInfo && (MyItemInfo.MyActiveSection as SectionInfo).HasSupInfoSteps)
|
||||
{
|
||||
int sid = GetIdThatHasSupInfoItems(MyItemInfo, MyItemInfo.ItemID);
|
||||
if (sid != -1)
|
||||
{
|
||||
MyPromsPrinter.DoSupInfoPage(cb, "TEMP", MyPageHelper.TextLayer, MyPageHelper, sid, true);
|
||||
}
|
||||
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))
|
||||
yPageStart -= SixLinesPerInch;
|
||||
if (MyPageHelper.ParaBreaks.Count > 0 && MyPageHelper.ParaBreaks[0].CompressFirstPartOfStep)
|
||||
@ -1573,6 +1597,14 @@ namespace Volian.Print.Library
|
||||
//`88b ooo d8( 888 o. )88b 888 .o 888
|
||||
// `Y8bood8P' `Y888""8o 8""888P' `Y8bod8P' o888o
|
||||
case 1: // Break on High Level Step
|
||||
if (MyPromsPrinter.SupInfoPrintType == E_SupInfoPrintType.DoPageBreaks)
|
||||
{
|
||||
// page break here, determine if there is caution/note above where the page break actually needs to go:
|
||||
int aboveSupinfoId = ChildrenAboveHaveSupInfo();
|
||||
if (MyItemInfo.SupInfos != null && MyItemInfo.SupInfos.Count > 0 && aboveSupinfoId > 0) supInfoSect.StepSectPageBreaksForSupInfo.Add(aboveSupinfoId);
|
||||
else if (MyItemInfo.SupInfos != null && MyItemInfo.SupInfos.Count > 0) supInfoSect.StepSectPageBreaksForSupInfo.Add(MyItemInfo.SupInfos[0].ItemID);
|
||||
else MyPromsPrinter.NeedSupInfoBreak = true;
|
||||
}
|
||||
YTopMost=OutputOtherPageSteps(cb, YTopMost, yPageStart, yTopMargin, yBottomMargin);
|
||||
docstyle = MyItemInfo.MyDocStyle;
|
||||
if (MyPageHelper.NotesToFootNotes != null && MyPageHelper.NotesToFootNotes.Count > 0) MyPageHelper.NotesToFootNotesYoffset = CalculateYLocation(yLocation, yTopMargin);
|
||||
@ -1619,7 +1651,7 @@ namespace Volian.Print.Library
|
||||
// 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. If there is one,
|
||||
// use DoSupInfoPage to put out the page, otherwise do a blank page.
|
||||
if (!MyItemInfo.IsSection && !MyItemInfo.IsInSupInfo && (MyItemInfo.MyActiveSection as SectionInfo).HasSupInfoSteps)
|
||||
if (MyPromsPrinter.SupInfoPrintType==E_SupInfoPrintType.Merge && !MyItemInfo.IsSection && !MyItemInfo.IsInSupInfo && (MyItemInfo.MyActiveSection as SectionInfo).HasSupInfoSteps)
|
||||
{
|
||||
int sid = GetIdThatHasSupInfoItems(MyItemInfo, MyItemInfo.ItemID);
|
||||
if (sid != -1)
|
||||
@ -1662,7 +1694,12 @@ namespace Volian.Print.Library
|
||||
// 888 .oP"888 `"Y88b. 888ooo888 .dP'
|
||||
// `88b ooo d8( 888 o. )88b 888 .o .oP .o
|
||||
// `Y8bood8P' `Y888""8o 8""888P' `Y8bod8P' 8888888888
|
||||
case 2: // Break within a Step
|
||||
case 2: // Break within a Step'
|
||||
if (MyPromsPrinter.SupInfoPrintType == E_SupInfoPrintType.DoPageBreaks)
|
||||
{
|
||||
if (MyItemInfo.SupInfos != null && MyItemInfo.SupInfos.Count > 0) supInfoSect.StepSectPageBreaksForSupInfo.Add(MyItemInfo.SupInfos[0].ItemID);
|
||||
else MyPromsPrinter.NeedSupInfoBreak = true;
|
||||
}
|
||||
YTopMost=OutputOtherPageSteps(cb, YTopMost, yPageStart, yTopMargin, yBottomMargin);
|
||||
docstyle = MyItemInfo.MyDocStyle;
|
||||
bool doAlarmBox = false;
|
||||
@ -1848,6 +1885,11 @@ namespace Volian.Print.Library
|
||||
// `88b ooo d8( 888 o. )88b 888 .o o. .88P
|
||||
// `Y8bood8P' `Y888""8o 8""888P' `Y8bod8P' `8bd88P'
|
||||
case 3: // Break on High Level Step (SevenLinesPerInch)
|
||||
if (MyPromsPrinter.SupInfoPrintType == E_SupInfoPrintType.DoPageBreaks)
|
||||
{
|
||||
if (MyItemInfo.SupInfos != null && MyItemInfo.SupInfos.Count > 0) supInfoSect.StepSectPageBreaksForSupInfo.Add(MyItemInfo.SupInfos[0].ItemID);
|
||||
else MyPromsPrinter.NeedSupInfoBreak = true;
|
||||
}
|
||||
if (!firstHighLevelStep)
|
||||
{
|
||||
YTopMost=OutputOtherPageSteps(cb, YTopMost, yPageStart, yTopMargin, yBottomMargin);
|
||||
@ -1874,6 +1916,23 @@ namespace Volian.Print.Library
|
||||
MyPromsPrinter.NewPage();
|
||||
//_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
|
||||
// so that it can be retrieved from the pdf for the supinfos for this section. If there is one,
|
||||
// use DoSupInfoPage to put out the page, otherwise do a blank page.
|
||||
if (MyPromsPrinter.SupInfoPrintType == E_SupInfoPrintType.Merge && !MyItemInfo.IsSection && !MyItemInfo.IsInSupInfo && (MyItemInfo.MyActiveSection as SectionInfo).HasSupInfoSteps)
|
||||
{
|
||||
int sid = GetIdThatHasSupInfoItems(MyItemInfo, MyItemInfo.ItemID);
|
||||
if (sid != -1)
|
||||
{
|
||||
MyPromsPrinter.DoSupInfoPage(cb, "TEMP", MyPageHelper.TextLayer, MyPageHelper, sid, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
MyPageHelper.OnBlankPage = true;
|
||||
cb.PdfDocument.Add(new iTextSharp.text.Table(1));
|
||||
MyPromsPrinter.NewPage();
|
||||
}
|
||||
}
|
||||
if (MyItemInfo.MyDocStyle.LandscapePageList)
|
||||
{
|
||||
System.Drawing.Drawing2D.Matrix myMatrix = new System.Drawing.Drawing2D.Matrix(0, 1, -1, 0, cb.PdfDocument.PageSize.Height, 0);
|
||||
@ -2092,6 +2151,16 @@ namespace Volian.Print.Library
|
||||
ProfileTimer.Pop(profileDepth);
|
||||
return yPageStart;
|
||||
}
|
||||
|
||||
private int ChildrenAboveHaveSupInfo()
|
||||
{
|
||||
if (ChildrenAbove == null || ChildrenAbove.Count < 1) return -1;
|
||||
foreach (vlnParagraph p in ChildrenAbove)
|
||||
{
|
||||
if (p.MyItemInfo.SupInfos != null && p.MyItemInfo.SupInfos.Count > 0) return p.MyItemInfo.SupInfos[0].ItemID;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
// Find the step that has supplemental information from this step down page until a preferred page break is found.
|
||||
// It is used to determine whether there is a supinfo facing page or if there should be a blank page.
|
||||
private int GetIdThatHasSupInfoItems(ItemInfo ii, int startid)
|
||||
@ -2980,7 +3049,6 @@ namespace Volian.Print.Library
|
||||
|
||||
// Save step text information to be used to create a Continuous Action Summary
|
||||
BuildContinuousActionSummary(parent, itemInfo);
|
||||
|
||||
if (itemInfo.ActiveFormat.MyStepSectionLayoutData.BoxLeftAdj != null)
|
||||
_MyBoxLeftAdj = float.Parse(itemInfo.ActiveFormat.MyStepSectionLayoutData.BoxLeftAdj);
|
||||
ShowSectionTitles = formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ShowSectionTitles || itemInfo.MyDocStyle.ShowSectionTitles;
|
||||
@ -3082,7 +3150,7 @@ namespace Volian.Print.Library
|
||||
doprint = false;
|
||||
}
|
||||
// if printing the supplemental info facing page, don't put out the section title. ToPdf will put out 'Supplemental Information' title.
|
||||
if (MyPageHelper.CreatingSupInfoPage && itemInfo.IsSection) doprint = false;
|
||||
if (MyPromsPrinter.SupInfoPrintType == E_SupInfoPrintType.Merge && MyPageHelper.CreatingSupInfoPage && itemInfo.IsSection) doprint = false;
|
||||
if (doprint && itemInfo.IsSection && !itemInfo.MyDocStyle.CancelSectTitle && itemInfo.MyTab.Text.ToUpper() != "FOLDOUT")
|
||||
{
|
||||
doSectTab = true;
|
||||
@ -3163,14 +3231,7 @@ namespace Volian.Print.Library
|
||||
if (!itemInfo.IsSection || doSectTab)
|
||||
{
|
||||
if (itemInfo.IsSupInfoPart) // get combined tab if on a supinfo facing page:
|
||||
{
|
||||
string strmytab = null;
|
||||
if (itemInfo.MyParent.IsHigh)
|
||||
strmytab = itemInfo.MyTab.CleanText;
|
||||
else
|
||||
strmytab = ItemInfo.GetCombinedTab(itemInfo.MyParent, itemInfo.MyParent.MyParent.CombinedTab);
|
||||
mytab = new vlnTab(cb, this, strmytab, strmytab, localXOffset, yoff, itemInfo.MyTab.MyFont, doSectTab, StepRTB.MySymbolFontName, itemInfo.MyTab.RemovedStyleUnderline);
|
||||
}
|
||||
mytab = GetSupInfoTab(cb, itemInfo, yoff, mytab, doSectTab, localXOffset);
|
||||
else if (itemInfo.MyTab.AltPrintTab != null)
|
||||
mytab = new vlnTab(cb, this, itemInfo.MyTab.AltPrintTab, itemInfo.MyTab.AltPrintTab, localXOffset, yoff, itemInfo.MyTab.MyFont, doSectTab, StepRTB.MySymbolFontName, itemInfo.MyTab.RemovedStyleUnderline);
|
||||
else
|
||||
@ -3179,6 +3240,11 @@ namespace Volian.Print.Library
|
||||
if (mytab.MyMacro != null) PartsLeft.Add(mytab.MyMacro);
|
||||
}
|
||||
}
|
||||
else if (itemInfo.IsSupInfoPart) // if it was an empty tab - it may have been a caution/note
|
||||
{
|
||||
mytab = GetSupInfoTab(cb, itemInfo, yoff, mytab, doSectTab, XOffset);
|
||||
PartsLeft.Add(mytab);
|
||||
}
|
||||
// if this is the High Level RNO step (MyTopRNO) and we are numbering the RNO, adjust the xoffset to start the tab
|
||||
// at the x location rather than starting the text at the x location:
|
||||
AdjustWidth(itemInfo, maxRNO, formatInfo, mytab);
|
||||
@ -3235,7 +3301,7 @@ namespace Volian.Print.Library
|
||||
}
|
||||
}
|
||||
|
||||
if (itemInfo.IsSection && MyParent == null && itemInfo.MyDocStyle.SupplementalInformation)
|
||||
if (itemInfo.IsSection && MyParent == null && itemInfo.MyDocStyle.SupplementalInformation && MyPromsPrinter.SupInfoPrintType==E_SupInfoPrintType.Merge)
|
||||
{
|
||||
_SupInfoSection = new vlnParagraph(this, cb, itemInfo, xoff, yoff, rnoLevel, maxRNO, formatInfo, null, null, yoffRightParent, false, pp);
|
||||
MyPromsPrinter.SupInfoPdfPageCount = -1;
|
||||
@ -3314,12 +3380,11 @@ namespace Volian.Print.Library
|
||||
}
|
||||
}
|
||||
if (itemInfo is StepInfo && ((itemInfo as StepInfo).MyConfig as StepConfig).Step_PreferredPagebreak) HasPrefPageBreak = true;
|
||||
if (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[SupInfoSection.ChildrenBelow.Count - 1].PrefPageBreak = HasPrefPageBreak;
|
||||
HasPrefPageBreak = false;
|
||||
}
|
||||
|
||||
// Without the following, BGE had gaps in y-direction if the AER/RNO both had cautions/notes.
|
||||
// The only time this needs done is if caution/notes are printed in separate columns in dual
|
||||
// column mode (used the DoubleBoxHLS BGE flag for this - if another plant needs this, make it
|
||||
@ -4024,6 +4089,21 @@ namespace Volian.Print.Library
|
||||
if (XOffsetCenter != null) XOffset = (float)XOffsetCenter;
|
||||
ProfileTimer.Pop(profileDepth);
|
||||
}
|
||||
|
||||
private vlnTab GetSupInfoTab(PdfContentByte cb, ItemInfo itemInfo, float yoff, vlnTab mytab, bool doSectTab, float localXOffset)
|
||||
{
|
||||
string strmytab = null;
|
||||
if (itemInfo.MyParent.IsHigh)
|
||||
strmytab = itemInfo.MyTab.CleanText;
|
||||
else if (itemInfo.MyParent.IsCaution)
|
||||
strmytab = "Caution";
|
||||
else if (itemInfo.MyParent.IsNote)
|
||||
strmytab = "Note";
|
||||
else
|
||||
strmytab = ItemInfo.GetCombinedTab(itemInfo.MyParent, itemInfo.MyParent.MyParent.CombinedTab);
|
||||
mytab = new vlnTab(cb, this, strmytab, strmytab, localXOffset, yoff, itemInfo.MyTab.MyFont, doSectTab, StepRTB.MySymbolFontName, itemInfo.MyTab.RemovedStyleUnderline);
|
||||
return mytab;
|
||||
}
|
||||
private static VE_Font _AnnotationFont;
|
||||
public static VE_Font AnnotationFont
|
||||
{
|
||||
@ -5142,16 +5222,14 @@ namespace Volian.Print.Library
|
||||
{
|
||||
if (itemInfo.IsSupInfoPart)
|
||||
{
|
||||
int addForTab = itemInfo.MyParent.IsCaution || itemInfo.MyParent.IsNote ? 72 : 36;
|
||||
XOffset = (float)itemInfo.MyDocStyle.Layout.LeftMargin + addForTab; // add in an inch to allow for enough space for Note/Caution tab
|
||||
XOffset = (float)itemInfo.MyDocStyle.Layout.LeftMargin + 54; // add in 3/4 inch (54) to allow for enough space for Note/Caution tab
|
||||
if (myTab != null)
|
||||
{
|
||||
myTab.XOffset = XOffset - ((myTab == null) ? 0 : myTab.Width) - 12;
|
||||
if (!itemInfo.MyParent.IsHigh && !itemInfo.MyParent.IsCaution && !itemInfo.MyParent.IsNote) myTab.Width = 2 * myTab.Width;
|
||||
myTab.Width = 2.5f * myTab.Width;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
float tabWidth = (myTab == null) ? 0 : myTab.Width;
|
||||
if (itemInfo.IsStepSection)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user