increase PSI labels width

Add argument to fmrPDFStatusForm call for pagenum transition processing (B2015-053)
Add argument for pagenum transition processing (B2015-053)
Add panel/scroll bar for PSI that has many fields (on larger font display, could not access bottommost) (B2015-051)
Add property for tracking of pagenum transitions (B2015-053)
For section list, use section default (procedure steps) if transition format has user interface of ‘SectDefault’. (B2015-052)
Pagenum transition processing – add 3rd pass for fix. (B2015-053)
This commit is contained in:
Kathy Ruffing 2015-04-24 13:13:47 +00:00
parent 029fcd03f4
commit 45d311bdfe
16 changed files with 114 additions and 27 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -557,7 +557,7 @@ namespace VEPROMS
MyProcedure = ProcedureInfo.GetItemAndChildrenByUnit(MyProcedure.ItemID, 0, MyProcedure.MyDocVersion.DocVersionConfig.SelectedSlave); MyProcedure = ProcedureInfo.GetItemAndChildrenByUnit(MyProcedure.ItemID, 0, MyProcedure.MyDocVersion.DocVersionConfig.SelectedSlave);
string myPDFPath = GetMultiunitPDFPath(); string myPDFPath = GetMultiunitPDFPath();
// RHM 20120925 Overlay the bottom of the dialog so that cancel button is covered. // RHM 20120925 Overlay the bottom of the dialog so that cancel button is covered.
frmPDFStatusForm frmStatus = new frmPDFStatusForm(MyProcedure, RevNumAndDate, pw.ToString(), cbxDebug.Checked, cbxOrPgBrk.Checked, cbxOpenAfterCreate2.Checked, cbxOverwritePDF2.Checked, myPDFPath, cbd, txbPDFName.Text, new Point(Left, Bottom - 50),cbxBlankPgsForDuplex.Checked); frmPDFStatusForm frmStatus = new frmPDFStatusForm(MyProcedure, RevNumAndDate, pw.ToString(), cbxDebug.Checked, cbxOrPgBrk.Checked, cbxOpenAfterCreate2.Checked, cbxOverwritePDF2.Checked, myPDFPath, cbd, txbPDFName.Text, new Point(Left, Bottom - 50),cbxBlankPgsForDuplex.Checked, _AllProcedures||Automatic);
frmStatus.CloseWhenDone = true; frmStatus.CloseWhenDone = true;
Application.DoEvents(); Application.DoEvents();
frmStatus.CancelStop = true; frmStatus.CancelStop = true;
@ -577,7 +577,7 @@ namespace VEPROMS
// this.Text = string.Format("Create PDF for {0} ({1} of {2})", myProc.DisplayNumber, ++i, n); // this.Text = string.Format("Create PDF for {0} ({1} of {2})", myProc.DisplayNumber, ++i, n);
MyProcedure = ProcedureInfo.GetItemAndChildrenByUnit(MyProcedure.ItemID, 0, MyProcedure.MyDocVersion.DocVersionConfig.SelectedSlave); MyProcedure = ProcedureInfo.GetItemAndChildrenByUnit(MyProcedure.ItemID, 0, MyProcedure.MyDocVersion.DocVersionConfig.SelectedSlave);
// RHM 20120925 Overlay the bottom of the dialog so that cancel button is covered. // RHM 20120925 Overlay the bottom of the dialog so that cancel button is covered.
frmPDFStatusForm frmStatus = new frmPDFStatusForm(MyProcedure, RevNumAndDate, pw.ToString(), cbxDebug.Checked, cbxOrPgBrk.Checked, cbxOpenAfterCreate2.Checked, cbxOverwritePDF2.Checked, PDFPath, cbd, txbPDFName.Text, new Point(Left, Bottom - 50), cbxBlankPgsForDuplex.Checked); frmPDFStatusForm frmStatus = new frmPDFStatusForm(MyProcedure, RevNumAndDate, pw.ToString(), cbxDebug.Checked, cbxOrPgBrk.Checked, cbxOpenAfterCreate2.Checked, cbxOverwritePDF2.Checked, PDFPath, cbd, txbPDFName.Text, new Point(Left, Bottom - 50), cbxBlankPgsForDuplex.Checked, _AllProcedures || Automatic);
frmStatus.CloseWhenDone = true; frmStatus.CloseWhenDone = true;
Application.DoEvents(); Application.DoEvents();
frmStatus.CancelStop = true; frmStatus.CancelStop = true;
@ -600,7 +600,7 @@ namespace VEPROMS
else else
MyProcedure = ProcedureInfo.GetItemAndChildren(MyProcedure.ItemID); MyProcedure = ProcedureInfo.GetItemAndChildren(MyProcedure.ItemID);
ProfileTimer.Pop(profileDepth1); ProfileTimer.Pop(profileDepth1);
frmPDFStatusForm frmStatus = new frmPDFStatusForm(MyProcedure, RevNumAndDate, pw.ToString(), cbxDebug.Checked, cbxOrPgBrk.Checked, cbxOpenAfterCreate2.Checked, cbxOverwritePDF2.Checked, PDFPath, cbd, txbPDFName.Text, new Point(Left, Bottom - 50), cbxBlankPgsForDuplex.Checked); frmPDFStatusForm frmStatus = new frmPDFStatusForm(MyProcedure, RevNumAndDate, pw.ToString(), cbxDebug.Checked, cbxOrPgBrk.Checked, cbxOpenAfterCreate2.Checked, cbxOverwritePDF2.Checked, PDFPath, cbd, txbPDFName.Text, new Point(Left, Bottom - 50), cbxBlankPgsForDuplex.Checked, _AllProcedures || Automatic);
frmStatus.CloseWhenDone = true; frmStatus.CloseWhenDone = true;
Application.DoEvents(); Application.DoEvents();
frmStatus.CancelStop = true; frmStatus.CancelStop = true;
@ -680,7 +680,7 @@ namespace VEPROMS
MyProcedure = ProcedureInfo.GetItemAndChildren(MyProcedure.ItemID); MyProcedure = ProcedureInfo.GetItemAndChildren(MyProcedure.ItemID);
// RHM 20120925 Overlay the bottom of the dialog so that cancel button is covered. // RHM 20120925 Overlay the bottom of the dialog so that cancel button is covered.
ProfileTimer.Pop(profileDepth2); ProfileTimer.Pop(profileDepth2);
frmPDFStatusForm frmStatus = new frmPDFStatusForm(MyProcedure, RevNumAndDate, pw.ToString(), cbxDebug.Checked, cbxOrPgBrk.Checked, cbxOpenAfterCreate2.Checked, cbxOverwritePDF2.Checked, PDFPath, cbd, txbPDFName.Text, new Point(Left, Bottom - 50), cbxBlankPgsForDuplex.Checked); frmPDFStatusForm frmStatus = new frmPDFStatusForm(MyProcedure, RevNumAndDate, pw.ToString(), cbxDebug.Checked, cbxOrPgBrk.Checked, cbxOpenAfterCreate2.Checked, cbxOverwritePDF2.Checked, PDFPath, cbd, txbPDFName.Text, new Point(Left, Bottom - 50), cbxBlankPgsForDuplex.Checked, _AllProcedures || Automatic);
frmStatus.MakePlaceKeeper = cbxGeneratePlacekeeper.Checked; frmStatus.MakePlaceKeeper = cbxGeneratePlacekeeper.Checked;
int profileDepth3 = ProfileTimer.Push(">>>> frmStatus"); int profileDepth3 = ProfileTimer.Push(">>>> frmStatus");
frmStatus.ShowDialog(); frmStatus.ShowDialog();

View File

@ -1100,7 +1100,7 @@ namespace VEPROMS
//ProcedureInfo myproc = pi; //ProcedureInfo myproc = pi;
//frmPDFStatusForm frm = new frmPDFStatusForm(myproc, ap.RevNumber, /* revdate change: ap.RevDate.ToString("MM/dd/yyyy") ,*/ waterMark, false, false, ViewPDF, true, VlnSettings.TemporaryFolder, new ChangeBarDefinition(pi.MyDocVersion.MyConfig as DocVersionConfig, pi.ActiveFormat), pdfTmp, location); //frmPDFStatusForm frm = new frmPDFStatusForm(myproc, ap.RevNumber, /* revdate change: ap.RevDate.ToString("MM/dd/yyyy") ,*/ waterMark, false, false, ViewPDF, true, VlnSettings.TemporaryFolder, new ChangeBarDefinition(pi.MyDocVersion.MyConfig as DocVersionConfig, pi.ActiveFormat), pdfTmp, location);
//myproc.ChangeBarDate = myDTS; //myproc.ChangeBarDate = myDTS;
frmPDFStatusForm frm = new frmPDFStatusForm(pi, ap.RevNumAndDate, /* revdate change: ap.RevDate.ToString("MM/dd/yyyy") ,*/ waterMark, false, false, ViewPDF, true, VlnSettings.TemporaryFolder, new ChangeBarDefinition(pi.MyDocVersion.MyConfig as DocVersionConfig, pi.ActiveFormat), pdfTmp, location, pi.MyDocVersion.DocVersionConfig.Print_AddBlankPagesWhenUsingDuplexFoldouts); frmPDFStatusForm frm = new frmPDFStatusForm(pi, ap.RevNumAndDate, /* revdate change: ap.RevDate.ToString("MM/dd/yyyy") ,*/ waterMark, false, false, ViewPDF, true, VlnSettings.TemporaryFolder, new ChangeBarDefinition(pi.MyDocVersion.MyConfig as DocVersionConfig, pi.ActiveFormat), pdfTmp, location, pi.MyDocVersion.DocVersionConfig.Print_AddBlankPagesWhenUsingDuplexFoldouts, true);
frm.AllowAllWatermarks = true; frm.AllowAllWatermarks = true;
frm.CloseWhenDone = !ViewPDF; frm.CloseWhenDone = !ViewPDF;
frm.ShowDialog(); frm.ShowDialog();

View File

@ -60,13 +60,13 @@ namespace VEPROMS
set { _OpenPDF = value; } set { _OpenPDF = value; }
} }
private Point _NewLocation; private Point _NewLocation;
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) 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)
{ {
OpenPDF = openPDF; OpenPDF = openPDF;
InitializeComponent(); InitializeComponent();
// if the version number of PROMS is 1.0, then we are running a Demo version. // if the version number of PROMS is 1.0, then we are running a Demo version.
// When running a Demo version, force a "Sample" watermark when printing. // When running a Demo version, force a "Sample" watermark when printing.
MyPromsPrinter = new PromsPrinter(myItem, rev, (VlnSettings.ReleaseMode.Equals("DEMO")) ? "Sample" : watermark, debugOutput, origPgBrk, pdfPath + @"\\Compare", false, overWrite, cbd, pdfFile, insertBlankPages);//openPDF); MyPromsPrinter = new PromsPrinter(myItem, rev, (VlnSettings.ReleaseMode.Equals("DEMO")) ? "Sample" : watermark, debugOutput, origPgBrk, pdfPath + @"\\Compare", false, overWrite, cbd, pdfFile, insertBlankPages, allOrAuto);
PDFPath = pdfPath; PDFPath = pdfPath;
this.Text = "Creating PDF of " + myItem.DisplayNumber; this.Text = "Creating PDF of " + myItem.DisplayNumber;
_NewLocation = newLocation; _NewLocation = newLocation;

View File

@ -30,15 +30,16 @@ namespace VEPROMS
{ {
this.btnOk = new System.Windows.Forms.Button(); this.btnOk = new System.Windows.Forms.Button();
this.btnCancel = new System.Windows.Forms.Button(); this.btnCancel = new System.Windows.Forms.Button();
this.panelPSI = new System.Windows.Forms.Panel();
this.SuspendLayout(); this.SuspendLayout();
// //
// btnOk // btnOk
// //
this.btnOk.DialogResult = System.Windows.Forms.DialogResult.OK; this.btnOk.DialogResult = System.Windows.Forms.DialogResult.OK;
this.btnOk.Location = new System.Drawing.Point(9, 180); this.btnOk.Location = new System.Drawing.Point(12, 222);
this.btnOk.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); this.btnOk.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnOk.Name = "btnOk"; this.btnOk.Name = "btnOk";
this.btnOk.Size = new System.Drawing.Size(56, 19); this.btnOk.Size = new System.Drawing.Size(75, 23);
this.btnOk.TabIndex = 0; this.btnOk.TabIndex = 0;
this.btnOk.Text = "Ok"; this.btnOk.Text = "Ok";
this.btnOk.UseVisualStyleBackColor = true; this.btnOk.UseVisualStyleBackColor = true;
@ -46,24 +47,33 @@ namespace VEPROMS
// //
// btnCancel // btnCancel
// //
this.btnCancel.Location = new System.Drawing.Point(82, 180); this.btnCancel.Location = new System.Drawing.Point(109, 222);
this.btnCancel.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); this.btnCancel.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnCancel.Name = "btnCancel"; this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(56, 19); this.btnCancel.Size = new System.Drawing.Size(75, 23);
this.btnCancel.TabIndex = 1; this.btnCancel.TabIndex = 1;
this.btnCancel.Text = "Cancel"; this.btnCancel.Text = "Cancel";
this.btnCancel.UseVisualStyleBackColor = true; this.btnCancel.UseVisualStyleBackColor = true;
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
// //
// panelPSI
//
this.panelPSI.AutoScroll = true;
this.panelPSI.Location = new System.Drawing.Point(12, 12);
this.panelPSI.Name = "panelPSI";
this.panelPSI.Size = new System.Drawing.Size(349, 205);
this.panelPSI.TabIndex = 2;
//
// frmPSI // frmPSI
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.AutoSize = true; this.AutoSize = true;
this.ClientSize = new System.Drawing.Size(280, 209); this.ClientSize = new System.Drawing.Size(373, 257);
this.Controls.Add(this.panelPSI);
this.Controls.Add(this.btnCancel); this.Controls.Add(this.btnCancel);
this.Controls.Add(this.btnOk); this.Controls.Add(this.btnOk);
this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.Name = "frmPSI"; this.Name = "frmPSI";
this.Text = "frmPSI"; this.Text = "frmPSI";
this.TopMost = true; this.TopMost = true;
@ -75,5 +85,6 @@ namespace VEPROMS
private System.Windows.Forms.Button btnOk; private System.Windows.Forms.Button btnOk;
private System.Windows.Forms.Button btnCancel; private System.Windows.Forms.Button btnCancel;
private System.Windows.Forms.Panel panelPSI;
} }
} }

View File

@ -33,6 +33,9 @@ namespace VEPROMS
this.Location = new Point((int)psiDialogDef.x * 2, (int)psiDialogDef.y * 2); this.Location = new Point((int)psiDialogDef.x * 2, (int)psiDialogDef.y * 2);
int maxx = 0; int maxx = 0;
int maxy = 0; int maxy = 0;
int xB4Scroll = 900;
int yB4Scroll = 630;
this.panelPSI.AutoScroll = false;
foreach (PsiLabel lbl in psiDialogDef.LabelList) foreach (PsiLabel lbl in psiDialogDef.LabelList)
{ {
Label wlbl = new Label(); Label wlbl = new Label();
@ -41,7 +44,7 @@ namespace VEPROMS
wlbl.AutoSize = true; wlbl.AutoSize = true;
//wlbl.Size = new Size((int)lbl.width * 2, (int)lbl.height * 2); //wlbl.Size = new Size((int)lbl.width * 2, (int)lbl.height * 2);
wlbl.Visible = true; wlbl.Visible = true;
this.Controls.Add(wlbl); this.panelPSI.Controls.Add(wlbl);
maxx = ((int)lbl.x * 2 + (int)lbl.width * 2) > maxx ? ((int)lbl.x * 2 + (int)lbl.width * 2) : maxx; maxx = ((int)lbl.x * 2 + (int)lbl.width * 2) > maxx ? ((int)lbl.x * 2 + (int)lbl.width * 2) : maxx;
maxy = ((int)lbl.y * 2 + (int)lbl.height * 2) > maxy ? ((int)lbl.y * 2 + (int)lbl.height * 2) : maxy; maxy = ((int)lbl.y * 2 + (int)lbl.height * 2) > maxy ? ((int)lbl.y * 2 + (int)lbl.height * 2) : maxy;
} }
@ -69,7 +72,7 @@ namespace VEPROMS
tb.Location = new Point((int)fld.x * 2, (int)fld.y * 2); tb.Location = new Point((int)fld.x * 2, (int)fld.y * 2);
tb.Size = new Size((int)fld.width * 2, (int)fld.height * 2); tb.Size = new Size((int)fld.width * 2, (int)fld.height * 2);
tb.Visible = true; tb.Visible = true;
this.Controls.Add(tb); this.panelPSI.Controls.Add(tb);
maxx = ((int)fld.x * 2 + (int)fld.width * 2) > maxx ? ((int)fld.x * 2 + (int)fld.width * 2) : maxx; maxx = ((int)fld.x * 2 + (int)fld.width * 2) > maxx ? ((int)fld.x * 2 + (int)fld.width * 2) : maxx;
maxy = ((int)fld.y * 2 + (int)fld.height * 2) > maxy ? ((int)fld.y * 2 + (int)fld.height * 2) : maxy; maxy = ((int)fld.y * 2 + (int)fld.height * 2) > maxy ? ((int)fld.y * 2 + (int)fld.height * 2) : maxy;
} }
@ -83,15 +86,31 @@ namespace VEPROMS
cb.Width = (int)fld.width * 2; cb.Width = (int)fld.width * 2;
string val = procConfig.GetValue("PSI", fld.name); string val = procConfig.GetValue("PSI", fld.name);
cb.Checked = val!=null && val!="" && val.ToUpper()[0] == 'Y' ? true : false; cb.Checked = val!=null && val!="" && val.ToUpper()[0] == 'Y' ? true : false;
this.Controls.Add(cb); this.panelPSI.Controls.Add(cb);
maxx = ((int)fld.x * 2 + (int)fld.width * 2) > maxx ? ((int)fld.x * 2 + (int)fld.width * 2) : maxx; maxx = ((int)fld.x * 2 + (int)fld.width * 2) > maxx ? ((int)fld.x * 2 + (int)fld.width * 2) : maxx;
maxy = ((int)fld.y * 2 + (int)fld.height * 2) > maxy ? ((int)fld.y * 2 + (int)fld.height * 2) : maxy; maxy = ((int)fld.y * 2 + (int)fld.height * 2) > maxy ? ((int)fld.y * 2 + (int)fld.height * 2) : maxy;
} }
} }
if (maxx > xB4Scroll)
{
maxx = xB4Scroll;
this.panelPSI.Width = xB4Scroll;
this.panelPSI.AutoScroll = true;
}
else
this.panelPSI.Width = maxx + 50;
if (maxy > yB4Scroll)
{
maxy = yB4Scroll;
this.panelPSI.Height = yB4Scroll;
this.panelPSI.AutoScroll = true;
}
else
this.panelPSI.Height = maxy + 50;
if (psiDialogDef.ButtonsOnBottom == null || psiDialogDef.ButtonsOnBottom.ToUpper() == "NO") if (psiDialogDef.ButtonsOnBottom == null || psiDialogDef.ButtonsOnBottom.ToUpper() == "NO")
{ {
btnOk.Location = new Point(maxx+20, 30); btnOk.Location = new Point(maxx+70, 30);
btnCancel.Location = new Point(maxx + 20, 60); btnCancel.Location = new Point(maxx + 70, 60);
} }
} }
private void FieldStepRTB_Enter(object sender, EventArgs e) private void FieldStepRTB_Enter(object sender, EventArgs e)

View File

@ -937,6 +937,12 @@ namespace VEPROMS.CSLA.Library
get { return _PageNumberUsed; } get { return _PageNumberUsed; }
set { _PageNumberUsed = value; } set { _PageNumberUsed = value; }
} }
private int _PageNumberNextPass = 0;
public int PageNumberNextPass
{
get { return _PageNumberNextPass; }
set { _PageNumberNextPass = value; }
}
private float _MSWordPageCount = 0; private float _MSWordPageCount = 0;
public float MSWordPageCount public float MSWordPageCount
{ {

View File

@ -162,7 +162,17 @@ namespace Volian.Controls.Library
cbTranProcsFillIn(_CurrentProcedure); cbTranProcsFillIn(_CurrentProcedure);
if (_CurrentProcedure.Sections != null) if (_CurrentProcedure.Sections != null)
{ {
cbTranSectsFillIn(secitm, secitm == null ? -1 : secitm.ItemID, true); // if the selected format is using section default, initialize with the section default (find it),
// otherwise use current section item.
int secStartId = secitm.ItemID;
E_TransUI etm = (E_TransUI)_CurrentProcedure.ActiveFormat.PlantFormat.FormatData.TransData.TransTypeList[_TranFmtIndx].TransUI;
if ((etm & E_TransUI.SectDefault) == E_TransUI.SectDefault)
{
secStartId = FindSectionStart(_CurrentProcedure);
secitm = ItemInfo.Get(secStartId);
selitm = (secitm.Steps.Count > 0) ? secitm.Steps[0] : null;
}
cbTranSectsFillIn(secitm, secitm == null ? -1 : secStartId, true);
// Fill step items, passing in the active step to the selected item, or the first // Fill step items, passing in the active step to the selected item, or the first
// step if the selection was not at the step level. // step if the selection was not at the step level.
ItemInfo stpitm = null; ItemInfo stpitm = null;

View File

@ -165,6 +165,12 @@ namespace Volian.Print.Library
get { return _InsertBlankPages; } get { return _InsertBlankPages; }
set { _InsertBlankPages = value; } set { _InsertBlankPages = value; }
} }
private bool _BatchPrint = true; // flags that a batch-type print is occurring, i.e. AllProcedures or Automatic testing
public bool BatchPrint
{
get { return _BatchPrint; }
set { _BatchPrint = value; }
}
private static List<string> _TransPageNumProblems = null; private static List<string> _TransPageNumProblems = null;
public static List<string> TransPageNumProblems public static List<string> TransPageNumProblems
{ {
@ -197,7 +203,7 @@ namespace Volian.Print.Library
get { return _MyReaderHelper; } get { return _MyReaderHelper; }
set { _MyReaderHelper = value; } set { _MyReaderHelper = value; }
} }
public PromsPrinter(ItemInfo myItem, string rev, string watermark, bool debugOutput, bool origPgBrk, string backgroundFolder, bool openPDF, bool overWrite, ChangeBarDefinition cbd, String pdfFile, bool insertBlankPages) public PromsPrinter(ItemInfo myItem, string rev, string watermark, bool debugOutput, bool origPgBrk, string backgroundFolder, bool openPDF, bool overWrite, ChangeBarDefinition cbd, String pdfFile, bool insertBlankPages, bool batchPrint)
{ {
_MyItem = myItem; _MyItem = myItem;
_Rev = rev; _Rev = rev;
@ -210,6 +216,7 @@ namespace Volian.Print.Library
_PDFFile = pdfFile; _PDFFile = pdfFile;
_OriginalPageBreak = origPgBrk; _OriginalPageBreak = origPgBrk;
_InsertBlankPages = insertBlankPages; _InsertBlankPages = insertBlankPages;
_BatchPrint = batchPrint;
_MyReaderHelper = new ReaderHelper(this); _MyReaderHelper = new ReaderHelper(this);
//_MyReaderHelper.LoadTree(myItem); //_MyReaderHelper.LoadTree(myItem);
} }
@ -231,18 +238,50 @@ namespace Volian.Print.Library
// if the plant uses transition modifiers and/or page num in transition format, // 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, // need to do two passes. First pass, sets the pagenumbers for each item,
// 2nd pass fills in the page numbers in transitions. // 2nd pass fills in the page numbers in transitions.
DirectoryInfo di = new DirectoryInfo(pdfFolder + @"\BeforePageNumber"); DirectoryInfo di = new DirectoryInfo(pdfFolder + @"\PageNumberPass1");
if (!di.Exists) di.Create(); if (!di.Exists) di.Create();
string retstr = Print(_MyItem as ProcedureInfo, pdfFolder + @"\BeforePageNumber", false); string retstr = Print(_MyItem as ProcedureInfo, pdfFolder + @"\PageNumberPass1", false);
if (retstr == null) return null; if (retstr == null) return null;
BeforePageNumberPdf = retstr; BeforePageNumberPdf = retstr;
ProcedureInfo.RefreshPageNumTransitions(_MyItem as ProcedureInfo); ProcedureInfo.RefreshPageNumTransitions(_MyItem as ProcedureInfo);
_MyReaderHelper = new ReaderHelper(this); _MyReaderHelper = new ReaderHelper(this);
return Print(_MyItem as ProcedureInfo, pdfFolder, makePlacekeeper); retstr = Print(_MyItem as ProcedureInfo, pdfFolder, makePlacekeeper);
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))
{
DirectoryInfo di1 = new DirectoryInfo(pdfFolder + @"\PageNumberPass2");
if (!di1.Exists) di1.Create();
FileInfo fi = new FileInfo(retstr);
FileInfo fidest = new FileInfo(di1.FullName + @"\" + fi.Name);
if (fidest.Exists) fidest.Delete();
fi.MoveTo(di1.FullName + @"\" + fi.Name);
ClearTransPageNumProblems();
RefreshPageNumber(_MyItem);
ProcedureInfo.RefreshPageNumTransitions(_MyItem as ProcedureInfo);
_MyReaderHelper = new ReaderHelper(this);
retstr = Print(_MyItem as ProcedureInfo, pdfFolder, makePlacekeeper);
}
}
return retstr;
} }
} }
return ""; return "";
} }
private void RefreshPageNumber(ItemInfo _MyItem)
{
// set all page numbers for all items under the passed in procedure item
_MyItem.PageNumber = _MyItem.PageNumberNextPass;
if (_MyItem.MyContent.ContentPartCount > 0)
{
foreach (PartInfo pi in _MyItem.MyContent.ContentParts)
{
foreach (ItemInfo ii in pi.MyItems)
RefreshPageNumber(ii);
}
}
}
internal string BuildMSWordPDF(SectionInfo section) internal string BuildMSWordPDF(SectionInfo section)
{ {
DateTime tStart = DateTime.Now; DateTime tStart = DateTime.Now;

View File

@ -470,8 +470,10 @@ namespace Volian.Print.Library
else if (MyItemInfo.PageNumberUsed != 0 && MyItemInfo.PageNumberUsed != pagenumTran) else if (MyItemInfo.PageNumberUsed != 0 && MyItemInfo.PageNumberUsed != pagenumTran)
{ {
if (PromsPrinter.TransPageNumProblems == null) PromsPrinter.TransPageNumProblems = new List<string>(); if (PromsPrinter.TransPageNumProblems == null) PromsPrinter.TransPageNumProblems = new List<string>();
PromsPrinter.TransPageNumProblems.Add(MyItemInfo.ShortPath); string pnErr = string.Format("{0} {1} {2} {3}", MyItemInfo.ItemID, MyItemInfo.ShortPath, MyItemInfo.PageNumberUsed, pagenumTran);
PromsPrinter.TransPageNumProblems.Add(pnErr);
} }
MyItemInfo.PageNumberNextPass = pagenumTran;
if (Processed) return yPageStart; if (Processed) return yPageStart;
//float localYPageStart = yPageStart; //float localYPageStart = yPageStart;
Processed = true; Processed = true;