Floating foldout support

This commit is contained in:
Kathy Ruffing 2012-11-27 15:17:59 +00:00
parent c91e57c8e6
commit d279eba9ed

View File

@ -266,16 +266,27 @@ namespace Volian.Print.Library
private VlnSvgPageHelper _MyHelper = null;
private static PdfReader _MyFoldoutReader = null;
private static SectionInfo _MyFoldoutSection = null;
//private static List<PdfReader> _MyFoldoutReader = null;
//private static List<SectionInfo> _MyFoldoutSection = null;
private string Print(ProcedureInfo myProcedure, string pdfFolder)
{
_MyFoldoutReader = null;
//if (_MyFoldoutReader != null) _MyFoldoutReader.Clear();
//else _MyFoldoutReader = new List<PdfReader>();
//if (_MyFoldoutSection != null) _MyFoldoutSection.Clear();
//else _MyFoldoutSection = new List<SectionInfo>();
if (myProcedure.Sections != null)
{
foreach (SectionInfo mySection in myProcedure.Sections)
{
if (mySection.MyContent.Number.ToUpper() == "FOLDOUT") // || mySection.MyContent.Text.ToUpper() == "FOLDOUT")
if (mySection.MyContent.Number.ToUpper() == "FOLDOUT"
|| (myProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.AlternateFloatingFoldout && mySection.MyContent.Text.ToUpper().Contains("FOLDOUT")))
{
// if floating foldouts, need a list of sections & foldoutreaders. Just do first for now.
_MyFoldoutSection = mySection;
//_MyFoldoutSection.Add(mySection);
string foldoutPdf = PrintProcedureOrFoldout(myProcedure, true, Volian.Base.Library.VlnSettings.TemporaryFolder + @"\Foldout.pdf");
_MyFoldoutReader = foldoutPdf != null ? new PdfReader(foldoutPdf) : null;
}
@ -337,9 +348,9 @@ namespace Volian.Print.Library
foreach (SectionInfo mySection in myProcedure.Sections)
{
if ((mySection.MyContent.Number.ToUpper() == "FOLDOUT") != doingFoldout) continue;
//if ((mySection.MyContent.Number.ToUpper() == "FOLDOUT" || mySection.MyContent.Text.ToUpper() == "FOLDOUT" ) != doingFoldout) continue;
SectionConfig sc = mySection.MyConfig as SectionConfig;
if ((mySection.MyContent.Number.ToUpper() == "FOLDOUT"
|| (myProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.AlternateFloatingFoldout && mySection.MyContent.Text.ToUpper().Contains("FOLDOUT")))
!= doingFoldout) continue;
PrintOverride.CompressSuper = mySection.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.CompressHPSuper;
PrintOverride.CompressSub = mySection.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.CompressHPSub;
OnStatusChanged((mySection.DisplayNumber ?? "") == "" ? mySection.DisplayText : mySection.DisplayNumber, PromsPrinterStatusType.Progress, progress++);
@ -398,8 +409,13 @@ namespace Volian.Print.Library
{
if (mySection.IsStepSection)
{
if ((mySection.MyDocStyle.StructureStyle.Style ?? 0 & E_DocStructStyle.UseSectionFoldout) != 0) // || _MyHelper.DoFloatingFoldout)
DoFoldoutPage(cb, "Beginning of Step Section", _TextLayer, _MyHelper);
if (mySection.Steps != null && mySection.Steps.Count > 0)
{
// get first step to send to floading foldout indx.&& MyItemInfo.FoldoutIndex>-1)
ItemInfo firstStep = mySection.Steps[0];
if (firstStep.FoldoutIndex() > -1)
DoFoldoutPage(cb, "Beginning of Step Section", _TextLayer, _MyHelper);
}
CreateStepPdf(mySection, cb);
}
else