Fixed issue where the first page of a word section was not properly rotated to account for the contents being set to landscape in word (this section is set to use Word margins)
Fixed issue where a couple of default buttons were appearing when they shouldn’t.
This commit is contained in:
		@@ -283,7 +283,7 @@ namespace VEPROMS
 | 
			
		||||
			ppCmbxSectPagination.ValueMember = "EValue";
 | 
			
		||||
			ppCmbxSectPagination.SelectedIndex = -1;
 | 
			
		||||
			SectionConfig.SectionPagination sp = _SectionConfig.Section_Pagination;
 | 
			
		||||
			if (!(sp.ToString().Equals(_DefaultPaginationStyle)))
 | 
			
		||||
			if (!(sp.ToString().Equals(_DefaultPaginationStyle)) && _isStepSection)
 | 
			
		||||
			{
 | 
			
		||||
				ppBtnDefaultPaginationStyle.Visible = true;
 | 
			
		||||
				ppCmbxSectPagination.SelectedValue = sp;
 | 
			
		||||
@@ -300,7 +300,7 @@ namespace VEPROMS
 | 
			
		||||
			ppCmbxNumColumns.ValueMember = "EValue";
 | 
			
		||||
			ppCmbxNumColumns.SelectedIndex = -1;
 | 
			
		||||
			SectionConfig.SectionColumnMode sc = _SectionConfig.Section_ColumnMode;
 | 
			
		||||
			if (!(sc.ToString().Equals(_DefaultNumColumns)))
 | 
			
		||||
			if (!(sc.ToString().Equals(_DefaultNumColumns)) && _isStepSection)
 | 
			
		||||
			{
 | 
			
		||||
				ppBtnDefaultNumColumns.Visible = true;
 | 
			
		||||
				ppCmbxNumColumns.SelectedValue = sc;
 | 
			
		||||
 
 | 
			
		||||
@@ -377,12 +377,17 @@ namespace Volian.Print.Library
 | 
			
		||||
		}
 | 
			
		||||
		public void NewPage(bool sectionChange)
 | 
			
		||||
		{
 | 
			
		||||
			// 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)
 | 
			
		||||
			{
 | 
			
		||||
				SectionInfo currentSection = _MyHelper.MySection;
 | 
			
		||||
				SectionInfo nextSection = GetNextSection(currentSection); // _MyHelper.MySection.NextItem as SectionInfo;
 | 
			
		||||
				SectionConfig sc = (nextSection ?? currentSection).MyConfig as SectionConfig;
 | 
			
		||||
				//SectionConfig sc = (nextSection ?? currentSection).MyConfig as SectionConfig;
 | 
			
		||||
				// If we are changing to a different section, then get the config from the nextSection
 | 
			
		||||
				// else we are still printing in the same section so get the config from the current section
 | 
			
		||||
				SectionConfig sc = ((!sectionChange || nextSection == null)? currentSection.MyConfig : nextSection.MyConfig) as SectionConfig;
 | 
			
		||||
				bool wordMargins = (sc != null && sc.Section_WordMargin == "Y");
 | 
			
		||||
				if (wordMargins)
 | 
			
		||||
				{
 | 
			
		||||
@@ -408,7 +413,7 @@ namespace Volian.Print.Library
 | 
			
		||||
						rct = MyReaderHelper.GetSize(LastWordSection, _PageCountOfWordSection);
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
				else
 | 
			
		||||
				else // don't use Word margins
 | 
			
		||||
				{
 | 
			
		||||
					rct = PageSize.LETTER;
 | 
			
		||||
				}
 | 
			
		||||
@@ -1720,7 +1725,12 @@ namespace Volian.Print.Library
 | 
			
		||||
							{
 | 
			
		||||
								key = string.Format("{0}.{1}", si.ItemID, i);
 | 
			
		||||
								dicPage.Add(key, MyPromsPrinter.MyContentByte.PdfWriter.GetImportedPage(MyReader, i));
 | 
			
		||||
								dicSize.Add(key, MyReader.GetPageSizeWithRotation(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 (!((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);
 | 
			
		||||
									//dicSize.Add(key, MyReader.GetPageSizeWithRotation(i));
 | 
			
		||||
							}
 | 
			
		||||
						}
 | 
			
		||||
						catch (Exception ex)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user