From 72fda5e4aeeb390f623a81149aac3bc16b4b04e7 Mon Sep 17 00:00:00 2001 From: John Date: Wed, 13 Nov 2019 17:12:37 +0000 Subject: [PATCH] =?UTF-8?q?B2019-165=20check=20for=20use=20of=20the=20?= =?UTF-8?q?=E2=80=9CDon=E2=80=99t=20Include=20Duplex=20Foldout=E2=80=9D=20?= =?UTF-8?q?checkbox=20to=20prevent=20the=20foldout=20from=20printing=20on?= =?UTF-8?q?=20the=20back=20side=20of=20the=20last=20page=20of=20a=20Word?= =?UTF-8?q?=20section=20(Byron/Braidwood)=20B2019-166=20corrected=20issue?= =?UTF-8?q?=20where=20the=20margins=20for=20the=20next=20section=20was=20b?= =?UTF-8?q?eing=20gotten=20prematurely=20(when=20current=20section=20had?= =?UTF-8?q?=20multiple=20pages)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PROMS/Volian.Print.Library/PromsPrinter.cs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/PROMS/Volian.Print.Library/PromsPrinter.cs b/PROMS/Volian.Print.Library/PromsPrinter.cs index 7ffdbe7e..a7d0aeef 100644 --- a/PROMS/Volian.Print.Library/PromsPrinter.cs +++ b/PROMS/Volian.Print.Library/PromsPrinter.cs @@ -508,7 +508,10 @@ namespace Volian.Print.Library // the first time we come in here we already printed the first page. // we are now setting up the page size for the next page iTextSharp.text.Rectangle rct = MyReaderHelper.MyPromsPrinter.MyContentByte.PdfDocument.PageSize; - if (_MyHelper != null) + // B2019-166 Only check for Word margins if the section changed + // - was getting next section's page margins prematurely (while still processing the a multi-page section) + // - this was changing the margins/orientation of other pages in the same Word section. + if (_MyHelper != null && sectionChange) { SectionInfo currentSection = _MyHelper.MySection; SectionInfo nextSection = GetNextSection(currentSection); // _MyHelper.MySection.NextItem as SectionInfo; @@ -558,7 +561,8 @@ namespace Volian.Print.Library // Bug Fix: B2016-135 when using a large page size word section, that large page size was being used for the foldout page // save this for the next section which will be the large page size word section. // Bug Fix: B2018-049 supplemental printing throws off page sizes (need to do same thing as fix for foldouts) - if (_MyFoldoutReader.Count > 0 || (_MyHelper!=null && _MyHelper.MySection != null && _MyHelper.MySection.MyProcedure.ProcHasSupInfoData)) + // Bug Fix: B2019-165 (Byron/Braidwood) also don't do this if the current section has Don't Include Duplex Foldout checkbox checked (automation tab of section properties) + if ((_MyFoldoutReader.Count > 0) && (_MyHelper != null && !((_MyHelper.MySection.MyConfig as SectionConfig).Section_DontIncludeDuplexFoldout) || (_MyHelper != null && _MyHelper.MySection != null && _MyHelper.MySection.MyProcedure.ProcHasSupInfoData))) MyContentByte.PdfDocument.SetPageSize(NxtRCT); else MyContentByte.PdfDocument.SetPageSize(rct); @@ -758,7 +762,7 @@ namespace Volian.Print.Library // Setup a pdf Document for printing OnStatusChanged("Before OpenDoc", PromsPrinterStatusType.Before); iTextSharp.text.Rectangle rct = PageSize.LETTER; - if (myProcedure.Sections != null && !myProcedure.Sections[0].IsStepSection) + if (myProcedure.Sections != null && !myProcedure.Sections[0].IsStepSection && !doingFoldout) // B2019-166 also don't do this if doing a foldout else it will use the margins set in word { SectionInfo si = myProcedure.Sections[0] as SectionInfo; SectionConfig sc = si.MyConfig as SectionConfig; @@ -943,7 +947,8 @@ namespace Volian.Print.Library { // get first step to send to floating foldout indx.&& MyItemInfo.FoldoutIndex>-1) ItemInfo firstStep = mySection.Steps[0]; - if (firstStep.FoldoutIndex() > -1) + // B2019-165 Don't print the duplex foldout (on the back of the page) if the Don't Include Duplex Foldout check box was checked in section properties + if (firstStep.FoldoutIndex() > -1 && (mySection.MyPrevious == null || !((mySection.MyPrevious.MyConfig as SectionConfig).Section_DontIncludeDuplexFoldout))) DoFoldoutPage(cb, "Beginning of Step Section", _TextLayer, _MyHelper, firstStep.FoldoutIndex(), InsertBlankPages); else if (!_MyHelper.CreatingFoldoutPage && _MyFoldoutReader.Count > 0 && InsertBlankPages) { @@ -2417,7 +2422,7 @@ namespace Volian.Print.Library key = string.Format("{0}.{1}", si.ItemID, i); dicPage.Add(key, MyPromsPrinter.MyContentByte.PdfWriter.GetImportedPage(MyReader, i)); iTextSharp.text.Rectangle rectgl = MyReader.GetPageSizeWithRotation(i); - // If the word page is set to landscape, but the the document sytle is not landscape, then flip the height and width (put back to portrait) + // If the word page is set to landscape, but the document style is not landscape, then flip the height and width (put back to portrait) if (!((si.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_WordContentLandscaped) == E_DocStructStyle.DSS_WordContentLandscaped) && rectgl.Height < rectgl.Width) rectgl = new iTextSharp.text.Rectangle(rectgl.Height, rectgl.Width); dicSize.Add(key, rectgl);