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 VlnSvgPageHelper _MyHelper = null;
private static PdfReader _MyFoldoutReader = null; private static PdfReader _MyFoldoutReader = null;
private static SectionInfo _MyFoldoutSection = 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) private string Print(ProcedureInfo myProcedure, string pdfFolder)
{ {
_MyFoldoutReader = null; _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) if (myProcedure.Sections != null)
{ {
foreach (SectionInfo mySection in myProcedure.Sections) 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 = mySection;
//_MyFoldoutSection.Add(mySection);
string foldoutPdf = PrintProcedureOrFoldout(myProcedure, true, Volian.Base.Library.VlnSettings.TemporaryFolder + @"\Foldout.pdf"); string foldoutPdf = PrintProcedureOrFoldout(myProcedure, true, Volian.Base.Library.VlnSettings.TemporaryFolder + @"\Foldout.pdf");
_MyFoldoutReader = foldoutPdf != null ? new PdfReader(foldoutPdf) : null; _MyFoldoutReader = foldoutPdf != null ? new PdfReader(foldoutPdf) : null;
} }
@ -337,9 +348,9 @@ namespace Volian.Print.Library
foreach (SectionInfo mySection in myProcedure.Sections) foreach (SectionInfo mySection in myProcedure.Sections)
{ {
if ((mySection.MyContent.Number.ToUpper() == "FOLDOUT") != doingFoldout) continue; if ((mySection.MyContent.Number.ToUpper() == "FOLDOUT"
//if ((mySection.MyContent.Number.ToUpper() == "FOLDOUT" || mySection.MyContent.Text.ToUpper() == "FOLDOUT" ) != doingFoldout) continue; || (myProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.AlternateFloatingFoldout && mySection.MyContent.Text.ToUpper().Contains("FOLDOUT")))
SectionConfig sc = mySection.MyConfig as SectionConfig; != doingFoldout) continue;
PrintOverride.CompressSuper = mySection.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.CompressHPSuper; PrintOverride.CompressSuper = mySection.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.CompressHPSuper;
PrintOverride.CompressSub = mySection.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.CompressHPSub; PrintOverride.CompressSub = mySection.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.CompressHPSub;
OnStatusChanged((mySection.DisplayNumber ?? "") == "" ? mySection.DisplayText : mySection.DisplayNumber, PromsPrinterStatusType.Progress, progress++); OnStatusChanged((mySection.DisplayNumber ?? "") == "" ? mySection.DisplayText : mySection.DisplayNumber, PromsPrinterStatusType.Progress, progress++);
@ -364,7 +375,7 @@ namespace Volian.Print.Library
// characters per inch. // characters per inch.
// 16bit OverrideLeftMargin, defined as -2 in driver\drvin.rtf, - override took 2 characters out, so we're adding it back in: // 16bit OverrideLeftMargin, defined as -2 in driver\drvin.rtf, - override took 2 characters out, so we're adding it back in:
if (_MyHelper.Back32BitPROMS) // compare folder contains PROMS generated PDF if (_MyHelper.Back32BitPROMS) // compare folder contains PROMS generated PDF
_MyHelper.BackgroundOffset = new PointF(0, 0); _MyHelper.BackgroundOffset = new PointF(0, 0);
else else
_MyHelper.BackgroundOffset = new PointF(2 * 72F / (float)myProcedure.ActiveFormat.PlantFormat.FormatData.Font.CPI, -9.5F); _MyHelper.BackgroundOffset = new PointF(2 * 72F / (float)myProcedure.ActiveFormat.PlantFormat.FormatData.Font.CPI, -9.5F);
_MyHelper.BackgroundPageOffset = 0; _MyHelper.BackgroundPageOffset = 0;
@ -398,8 +409,13 @@ namespace Volian.Print.Library
{ {
if (mySection.IsStepSection) if (mySection.IsStepSection)
{ {
if ((mySection.MyDocStyle.StructureStyle.Style ?? 0 & E_DocStructStyle.UseSectionFoldout) != 0) // || _MyHelper.DoFloatingFoldout) if (mySection.Steps != null && mySection.Steps.Count > 0)
DoFoldoutPage(cb, "Beginning of Step Section", _TextLayer, _MyHelper); {
// 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); CreateStepPdf(mySection, cb);
} }
else else