Floating foldout support
This commit is contained in:
parent
c91e57c8e6
commit
d279eba9ed
@ -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++);
|
||||
@ -364,7 +375,7 @@ namespace Volian.Print.Library
|
||||
// characters per inch.
|
||||
// 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
|
||||
_MyHelper.BackgroundOffset = new PointF(0, 0);
|
||||
_MyHelper.BackgroundOffset = new PointF(0, 0);
|
||||
else
|
||||
_MyHelper.BackgroundOffset = new PointF(2 * 72F / (float)myProcedure.ActiveFormat.PlantFormat.FormatData.Font.CPI, -9.5F);
|
||||
_MyHelper.BackgroundPageOffset = 0;
|
||||
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user