Get data into memory for approval generation so that page number transitions resolve
Fixed B2014-025:If not master/slave, load all data into memory for page number transitions. Present dialog if there are errors in page number transitions so that user can resolve. Added a property to determine if page number transition has incorrect page number caused by length of step’s text/wrapping & pagination Set property to determine if page number transition has incorrect page number caused by length of step’s text/wrapping & pagination Add tracking of inconsistent page number transitions; if pdf already open, don’t run 2nd pass for page number transitions (resulting pdf had unresolved page numbers);
This commit is contained in:
@@ -155,6 +155,26 @@ namespace Volian.Print.Library
|
||||
get { return _InsertBlankPages; }
|
||||
set { _InsertBlankPages = value; }
|
||||
}
|
||||
private static List<string> _TransPageNumProblems = null;
|
||||
public static List<string> TransPageNumProblems
|
||||
{
|
||||
get { return PromsPrinter._TransPageNumProblems; }
|
||||
set { PromsPrinter._TransPageNumProblems = value; }
|
||||
}
|
||||
public static void ClearTransPageNumProblems()
|
||||
{
|
||||
_TransPageNumProblems = null;
|
||||
}
|
||||
public static void ReportTransPageNumProblems()
|
||||
{
|
||||
if (TransPageNumProblems != null && TransPageNumProblems.Count > 0)
|
||||
{
|
||||
string pnProbl = null;
|
||||
foreach (string pstr in TransPageNumProblems)
|
||||
pnProbl = pnProbl + "\n" + pstr;
|
||||
MessageBox.Show("Review the page numbers specified on transitions that transition to the following:\n" + pnProbl, "Inconsistent transition page numbers.");
|
||||
}
|
||||
}
|
||||
public PromsPrinter(ItemInfo myItem, string rev, string watermark, bool debugOutput, bool origPgBrk, string backgroundFolder, bool openPDF, bool overWrite, ChangeBarDefinition cbd, String pdfFile, bool insertBlankPages)
|
||||
{
|
||||
_MyItem = myItem;
|
||||
@@ -180,7 +200,8 @@ namespace Volian.Print.Library
|
||||
// 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.
|
||||
Print(_MyItem as ProcedureInfo, pdfFolder);
|
||||
string retstr = Print(_MyItem as ProcedureInfo, pdfFolder);
|
||||
if (retstr == null) return null;
|
||||
ProcedureInfo.RefreshPageNumTransitions(_MyItem as ProcedureInfo);
|
||||
return Print(_MyItem as ProcedureInfo, pdfFolder);
|
||||
}
|
||||
@@ -312,12 +333,14 @@ namespace Volian.Print.Library
|
||||
private static List<SectionInfo> _MyFoldoutSection = null;
|
||||
private string Print(ProcedureInfo myProcedure, string pdfFolder)
|
||||
{
|
||||
if (_TransPageNumProblems == null) _TransPageNumProblems = new List<string>();
|
||||
|
||||
if (_MyFoldoutReader != null) _MyFoldoutReader.Clear();
|
||||
else _MyFoldoutReader = new List<PdfReader>();
|
||||
|
||||
if (_MyFoldoutSection != null) _MyFoldoutSection.Clear();
|
||||
else _MyFoldoutSection = new List<SectionInfo>();
|
||||
|
||||
|
||||
if (myProcedure.Sections != null)
|
||||
{
|
||||
int cnt = 0;
|
||||
|
@@ -313,6 +313,11 @@ namespace Volian.Print.Library
|
||||
public float ParagraphToPdf(PdfContentByte cb, float yPageStart, float yTopMargin, float yBottomMargin)
|
||||
{
|
||||
if (MyItemInfo.PageNumber == 0) MyItemInfo.PageNumber = MyPageHelper.CurrentPageNumber;
|
||||
else if (MyItemInfo.PageNumberUsed != 0 && MyItemInfo.PageNumberUsed != MyPageHelper.CurrentPageNumber)
|
||||
{
|
||||
if (PromsPrinter.TransPageNumProblems == null) PromsPrinter.TransPageNumProblems = new List<string>();
|
||||
PromsPrinter.TransPageNumProblems.Add(MyItemInfo.ShortPath);
|
||||
}
|
||||
if (Processed) return yPageStart;
|
||||
//float localYPageStart = yPageStart;
|
||||
Processed = true;
|
||||
|
Reference in New Issue
Block a user