Changed a variable to get a fresh SectionInfo rather than to use the value in memory. For some reason the value in memory was giving incorect results.

Added bookmarks for Word Subsections.
This commit is contained in:
Rich 2015-01-24 17:42:51 +00:00
parent 628139201d
commit 24fac1b04c

View File

@ -1102,10 +1102,14 @@ namespace Volian.Print.Library
{ {
PdfReader tmp = null; PdfReader tmp = null;
string tmpstr = null; string tmpstr = null;
//SectionInfo si = SectionInfo.Get(MyItemInfo.ItemID); SectionInfo si = SectionInfo.Get(MyItemInfo.ItemID);
SectionInfo si = MyItemInfo.GetSectionInfo(); //Changing this caused Header issues for FNP FNP-1-FRP-1.3 Attachment 3 (Word Sub-Sections)
//SectionInfo si1 = MyItemInfo.GetSectionInfo();
//CompareSectionInfo(si, si1);
cb.PdfDocument.NewPage(); cb.PdfDocument.NewPage();
//_MyLog.InfoFormat("NewPage 9 {0}", cb.PdfWriter.CurrentPageNumber); //_MyLog.InfoFormat("NewPage 9 {0}", cb.PdfWriter.CurrentPageNumber);
// Add Bookmark for Word Subsections
MyPageHelper.PageBookmarks.Add(si, ((si.DisplayNumber ?? "") == "" ? "" : si.DisplayNumber + " - ") + si.DisplayText, null);
MyPageHelper.MyPromsPrinter.CreateWordDocPdf(cb, si, ref tmp, ref tmpstr); MyPageHelper.MyPromsPrinter.CreateWordDocPdf(cb, si, ref tmp, ref tmpstr);
Processed = true; Processed = true;
{ {
@ -1585,7 +1589,21 @@ namespace Volian.Print.Library
ProfileTimer.Pop(profileDepth); ProfileTimer.Pop(profileDepth);
return yPageStart; return yPageStart;
} }
// Added to try to resolve a problem when printing FNP-1-FRP-I.3 Attachment 3 Table 1.
// May be needed to evaluate this problem in the future.
//private void CompareSectionInfo(SectionInfo si, SectionInfo si1)
//{
// if (si.ItemID != si1.ItemID)
// Console.WriteLine("Different");
// if (si.ActiveFormat.FullName != si1.ActiveFormat.FullName)
// Console.WriteLine("Different");
// if (si.ActiveParent != si1.ActiveParent)
// Console.WriteLine("Different");
// if (si.ActiveSection.ItemID != si1.ActiveSection.ItemID)
// Console.WriteLine("Different");
// if (si.MyDocStyle.Name != si1.MyDocStyle.Name)
// Console.WriteLine("Different");
//}
private void AddFootNote(PdfContentByte cb) private void AddFootNote(PdfContentByte cb)
{ {
// for calvert valve lists footnotes, if there is footnote data, save it for vlnSvgPageHelper // for calvert valve lists footnotes, if there is footnote data, save it for vlnSvgPageHelper