diff --git a/PROMS/VEPROMS User Interface/DlgPrintProcedure.Designer.cs b/PROMS/VEPROMS User Interface/DlgPrintProcedure.Designer.cs index 66a114f3..c506779f 100644 --- a/PROMS/VEPROMS User Interface/DlgPrintProcedure.Designer.cs +++ b/PROMS/VEPROMS User Interface/DlgPrintProcedure.Designer.cs @@ -1151,9 +1151,9 @@ namespace VEPROMS this.cbxBlankPgsForDuplex.Location = new System.Drawing.Point(138, 340); this.cbxBlankPgsForDuplex.Margin = new System.Windows.Forms.Padding(2); this.cbxBlankPgsForDuplex.Name = "cbxBlankPgsForDuplex"; - this.cbxBlankPgsForDuplex.Size = new System.Drawing.Size(323, 19); + this.cbxBlankPgsForDuplex.Size = new System.Drawing.Size(262, 19); this.cbxBlankPgsForDuplex.TabIndex = 101; - this.cbxBlankPgsForDuplex.Text = "Add Blank Pages For Duplex Foldouts or SAMG Facing Pages"; + this.cbxBlankPgsForDuplex.Text = "Add Blank Pages For Duplex Printing\r\n"; this.cbxBlankPgsForDuplex.UseVisualStyleBackColor = false; // // cbxGeneratePlacekeeper @@ -1196,7 +1196,7 @@ namespace VEPROMS this.cbxRemoveManualPageBreaks.Location = new System.Drawing.Point(138, 306); this.cbxRemoveManualPageBreaks.Margin = new System.Windows.Forms.Padding(2); this.cbxRemoveManualPageBreaks.Name = "cbxRemoveManualPageBreaks"; - this.cbxRemoveManualPageBreaks.Size = new System.Drawing.Size(91, 19); + this.cbxRemoveManualPageBreaks.Size = new System.Drawing.Size(370, 19); this.cbxRemoveManualPageBreaks.TabIndex = 101; this.cbxRemoveManualPageBreaks.Text = "Remove Trailing Hard Returns && Manual Page Breaks"; this.cbxRemoveManualPageBreaks.UseVisualStyleBackColor = false; @@ -1336,4 +1336,4 @@ namespace VEPROMS private DevComponents.DotNetBar.ButtonX btnPdfLocation; private System.Windows.Forms.CheckBox cbxGenerateConActSum; } -} \ No newline at end of file +} diff --git a/PROMS/VEPROMS User Interface/DlgPrintProcedure.cs b/PROMS/VEPROMS User Interface/DlgPrintProcedure.cs index f7df0664..f0566a3c 100644 --- a/PROMS/VEPROMS User Interface/DlgPrintProcedure.cs +++ b/PROMS/VEPROMS User Interface/DlgPrintProcedure.cs @@ -126,7 +126,7 @@ namespace VEPROMS _AllProcedures = true; _DocVersionConfig = dvi.DocVersionConfig; _DocVersionInfo = dvi; - _MyProcedure = dvi.Procedures[0].MyProcedure; + MyProcedure = dvi.Procedures[0].MyProcedure; btnCreatePDF.Text = "Create PDFs"; HandleDocVersionSettings(); PrepForAllOrOne(false); @@ -141,13 +141,13 @@ namespace VEPROMS _AllProcedures = true; _DocVersionConfig = dvi.DocVersionConfig; _DocVersionInfo = dvi; - _MyProcedure = dvi.Procedures[0].MyProcedure; + cbxBlankPgsForDuplex.Checked = dvi.DocVersionConfig.Print_AddBlankPagesWhenUsingDuplexFoldouts; + MyProcedure = dvi.Procedures[0].MyProcedure; btnCreatePDF.Text = "Create PDFs"; HandleDocVersionSettings(); PrepForAllOrOne(false); // don't open all PDFs if doing All Procedures //cbxOpenAfterCreate2.Checked = dvi.DocVersionConfig.Print_AlwaysViewPDFAfterCreate; - cbxBlankPgsForDuplex.Checked = dvi.DocVersionConfig.Print_AddBlankPagesWhenUsingDuplexFoldouts; } private void PrepForAllOrOne(bool oneProcedure) { @@ -182,12 +182,12 @@ namespace VEPROMS InitializeComponent(); _AllProcedures = false; _DocVersionConfig = pi.MyDocVersion.DocVersionConfig; - _MyProcedure = pi; + cbxBlankPgsForDuplex.Checked = pi.MyDocVersion.DocVersionConfig.Print_AddBlankPagesWhenUsingDuplexFoldouts; + MyProcedure = pi; btnCreatePDF.Text = "Create PDF"; HandleDocVersionSettings(); PrepForAllOrOne(true); cbxOpenAfterCreate2.Checked = pi.MyDocVersion.DocVersionConfig.Print_AlwaysViewPDFAfterCreate; - cbxBlankPgsForDuplex.Checked = pi.MyDocVersion.DocVersionConfig.Print_AddBlankPagesWhenUsingDuplexFoldouts; } public DlgPrintProcedure(ProcedureInfo pi, bool automatic) // RHM20150506 Multiline ItemID TextBox { @@ -196,12 +196,12 @@ namespace VEPROMS Rtf2iTextSharp.DoingComparison = cbxDebug.Checked; _AllProcedures = false; _DocVersionConfig = pi.MyDocVersion.DocVersionConfig; - _MyProcedure = pi; + cbxBlankPgsForDuplex.Checked = pi.MyDocVersion.DocVersionConfig.Print_AddBlankPagesWhenUsingDuplexFoldouts; + MyProcedure = pi; btnCreatePDF.Text = "Create PDF"; HandleDocVersionSettings(); PrepForAllOrOne(true); cbxOpenAfterCreate2.Checked = pi.MyDocVersion.DocVersionConfig.Print_AlwaysViewPDFAfterCreate; - cbxBlankPgsForDuplex.Checked = pi.MyDocVersion.DocVersionConfig.Print_AddBlankPagesWhenUsingDuplexFoldouts; } /// /// RHM 20120925 Added so that the dialog would center over the PROMS window @@ -526,7 +526,13 @@ namespace VEPROMS public ProcedureInfo MyProcedure { get { return _MyProcedure; } - set { _MyProcedure = value; } + set + { + _MyProcedure = value; + // if procedure has supplemental information, the automatially check the add blank pages for duplex printing + if (_MyProcedure.ProcHasSupInfoData) + cbxBlankPgsForDuplex.Checked = true; + } } private int _SelectedSlave = 0; public int SelectedSlave diff --git a/PROMS/Volian.Print.Library/Pagination.cs b/PROMS/Volian.Print.Library/Pagination.cs index 44557fb3..5b2153c0 100644 --- a/PROMS/Volian.Print.Library/Pagination.cs +++ b/PROMS/Volian.Print.Library/Pagination.cs @@ -99,7 +99,7 @@ namespace Volian.Print.Library } else if (MyItemInfo.MyDocStyle.SupplementalInformation && MyItemInfo.IsStep) { - if (MyItemInfo.IsHigh && MyItemInfo.MyPrevious == null) return 1; + //if (MyItemInfo.IsHigh && MyItemInfo.MyPrevious == null) return 1; // appears we don't need this line any more Forced Pagination on OR substep Ginna SAG-8 Step 1 jsj/RHM 05-19-2017 StepConfig sci = MyItemInfo.MyConfig as StepConfig; if (sci.Step_PreferredPagebreak) { diff --git a/PROMS/Volian.Print.Library/PromsPrinter.cs b/PROMS/Volian.Print.Library/PromsPrinter.cs index ea5103fd..0bc909de 100644 --- a/PROMS/Volian.Print.Library/PromsPrinter.cs +++ b/PROMS/Volian.Print.Library/PromsPrinter.cs @@ -1735,9 +1735,7 @@ namespace Volian.Print.Library myPageHealper.ChangeBarDefinition = MyChangeBarDefinition; float yPageStart = yTopMargin; vlnParagraph._yPageStartForSupInfo = yTopMargin; - FindSupInfoLengths(vlnParagraph); // creates a dictionary of the sup info paragraph heights - _AdjustForParagraphShrinkage = new Dictionary(); - AdjustSupInfoFontSize(vlnParagraph,cb); // try to shrink the sup info page font to fix on the page + SupInfoAjustGroupings(vlnParagraph,cb); vlnParagraph.ToPdf(cb, yPageStart, ref yTopMargin, ref yBottomMargin); try { @@ -1753,40 +1751,208 @@ namespace Volian.Print.Library MyReaderHelper = savMyReaderHelper; } #region ShrinkSupInfoGroupAtATime - - /* - * Find Groups - * Foreach group - * while measure group is greater than page length - * reduce the size for the group - */ - private float _Decrement = 2f; - private void SupInfoAjustGroupings(vlnParagraph vlnParagraph) + private Dictionary _AdjustForParagraphShrinkage; + private float _LastOffset; + private float _LastBottom; + /// + /// Adjust the font size so that the Supplemental Information will fit on a single page. + /// + /// supinfo paragraphs + /// pdfcontentbyte + private void SupInfoAjustGroupings(vlnParagraph vlnParagraph, PdfContentByte cb) { + // Get groups of SupInfo paragraphs List> supInfoGroups = FindSupInfoGroups(vlnParagraph); float pageLength = (float)vlnParagraph.MyItemInfo.MyDocStyle.Layout.PageLength; + // Process Each Group of SupInfo paragraphs foreach (List grp in supInfoGroups) { + // Initialize font decrement + float decrement = 2f; float fontSize = grp[0].IParagraph.Leading; // current font size - // reduce the font size by _Decrement until the entire grouping fits on one page - while (MeasureLength(grp) > pageLength) + float mpglen = MeasureSupInfoGroupLength(grp, cb,pageLength); // Measure the length of the group of supinfo paragraphs + // If the group does not fit on a page then reduce the font size + if (mpglen > pageLength) { - float newFontSize = fontSize - _Decrement; - float scaler = newFontSize / fontSize; - ReduceGroupFontSize(grp, scaler); - fontSize = newFontSize; + float newFontSize=fontSize; + // reduce the font size by _Decrement until the entire grouping fits on one page + while (mpglen > pageLength) // While the measured supinfo group length is greatere than the page length + { + newFontSize = fontSize - decrement; + float scaler = newFontSize / fontSize;// Calculate the reduction + ReduceSupInfoGroupFontSize(grp, scaler, cb); // Apply the smaller font size + fontSize = newFontSize; // adjust the base font size + mpglen = MeasureSupInfoGroupLength(grp, cb, pageLength);// Measure the length of the group of supinfo paragraphs + } + // Binary Search to find proper font size within .1 + while (decrement > .1f) + { + decrement = decrement / 2f; //Reduce the decrement by half + if (mpglen > pageLength) // If the measured length is too big + newFontSize -= decrement;// Reduce the font size + else + newFontSize += decrement;//Otherwise increase the font size + float scaler = newFontSize / fontSize;// Calculate the reduction + ReduceSupInfoGroupFontSize(grp, scaler, cb);// apply the new font size + fontSize = newFontSize;// adjust the base font size + mpglen = MeasureSupInfoGroupLength(grp, cb, pageLength);// Measure the length of the group of supinfo paragraphs + } + if (mpglen > pageLength) //If the measured lenght is greater than the page length reduce the font size + { + newFontSize -= decrement;// Reduce the font size + float scaler = newFontSize / fontSize;// Calculate the reduction + ReduceSupInfoGroupFontSize(grp, scaler, cb);// apply the new font size + fontSize = newFontSize;// adjust the base font size + mpglen = MeasureSupInfoGroupLength(grp, cb, pageLength);// Measure the length of the group of supinfo paragraphs + } } } } - - private void ReduceGroupFontSize(List grp, float scaler) + /// + /// Method to apply a multiplier to the font size to a group of supinfo paragraphs + /// + /// group of SupInfo paragraphs + /// multiplier for font size + /// The PDFContentByte which is needed to calculate the adjusted the paragraph height + private void ReduceSupInfoGroupFontSize(List grp, float scaler, PdfContentByte cb) { + foreach (vlnParagraph pg in grp) // For each paragraph and children apply the scaler + { + // When adjusting the font size if the change causes the paragraph to change due to the number of characters + // per line these changes will impact the paragraphs below the affected paragraph + // This is kept in a dictionary. The key is the vertical offset to the affected paragraph. + // The value is the impact on the paragraph height. + _AdjustForParagraphShrinkage = new Dictionary(); + // Apply the scaler to each paragraph + ReduceSupInfoGroupFontSize(pg, scaler, cb); + } } - - private float MeasureLength(List grp) + /// + /// Method to apply a multiplier to the font size to a supinfo paragraph and children + /// + /// supinfo paragraph + /// font multiplier + /// pdfcontentbyte + private void ReduceSupInfoGroupFontSize(vlnParagraph pg, float scaler, PdfContentByte cb) { - return 0; + float hBefore = pg.Height;// Save initial paragraph height + NewSupInfoFixChunks(pg,scaler);// Apply multiplier to font size + pg.IParagraph.Leading = scaler * pg.IParagraph.Leading; // Adjust leading (line spacing) + float hAfter = pg.GetParagraphHeight(cb, pg.IParagraph, "", pg.Width); // Calculate new paragraph height + pg.Height = hAfter; // Save new Height; + pg.YBottomMost += hAfter - hBefore; // Adjust YbottomMost for font size and leading + float hleading = hBefore * scaler; // Calcuate leading change + // If the change in font size effects the paragraph height due to word wrapping save the impact to adjust + // Offsets below + if ((hleading > hAfter + 1 && scaler < 1f) || (hleading < hAfter + 1 && scaler > 1f)) + { + if (!_AdjustForParagraphShrinkage.ContainsKey(pg.YOffset)) + _AdjustForParagraphShrinkage.Add(pg.YOffset, hleading - hAfter); + } + float yoBefore = pg.YOffset;// Save the offset before + float yoAfter = pg.YOffset = NewSupInfoFixOffset(pg,scaler);// Calculate the offset after + pg.YBottomMost += yoAfter - yoBefore;// Adjust YbottomMost for changes to yOffset + foreach (vlnParagraph cpg in pg.ChildrenAbove)// Process Children Above + ReduceSupInfoGroupFontSize(cpg, scaler, cb); + foreach (vlnParagraph cpg in pg.ChildrenBelow)// Process Children Below + ReduceSupInfoGroupFontSize(cpg, scaler, cb); + foreach (vlnParagraph cpg in pg.ChildrenLeft)// Process Children Left + ReduceSupInfoGroupFontSize(cpg, scaler, cb); + foreach (vlnParagraph cpg in pg.ChildrenRight)// Process Children Right + ReduceSupInfoGroupFontSize(cpg, scaler, cb); + foreach (vlnPrintObject po in pg.PartsAbove) // Process Parts Above (headers) + NewSupInfoFixParts(po, scaler); + foreach (vlnPrintObject po in pg.PartsBelow) // Process Parts Below (unknown) + NewSupInfoFixParts(po, scaler); + foreach (vlnPrintObject po in pg.PartsLeft) // Process Parts Left (Tabs) + NewSupInfoFixParts(po, scaler); + foreach (vlnPrintObject po in pg.PartsRight) // Process Parts Right (unknown) + NewSupInfoFixParts(po, scaler); } + /// + /// Adjust YOffset for Print Objects + /// + /// Print Object (tab, paragraph, etc.) + /// multiplier + /// + private float NewSupInfoFixOffset(vlnPrintObject vpo, float scaler) + { + float fixOffSet = 0; + // determine impact of paragraphs above due to word-wrap + foreach (float off in _AdjustForParagraphShrinkage.Keys) + if (off < vpo.YOffset) + fixOffSet += _AdjustForParagraphShrinkage[off]; + // combine this impact with the scaler on the YOffset + return scaler * vpo.YOffset - fixOffSet; + } + /// + /// Adjust Font Size and offset for Parts + /// + /// PrintObject + /// Multiplier + private void NewSupInfoFixParts(vlnPrintObject po, float scaler) + { + // Adjust the font size by the multiplier + foreach (Chunk chk in po.IParagraph.Chunks) + chk.Font.Size = scaler * chk.Font.Size; + po.IParagraph.Leading = scaler * po.IParagraph.Leading;// Apply the multiplier to the leading (line spacing) + po.YOffset = NewSupInfoFixOffset(po,scaler);// Adjust the YOffset + } + /// + /// Adjust the Font Size + /// + /// Paragraph + /// Multiplier + private void NewSupInfoFixChunks(vlnParagraph vlnParagraph, float scaler) + { + // Adjust the font size by the multiplier + foreach (Chunk chk in vlnParagraph.IParagraph.Chunks) + chk.Font.Size = scaler * chk.Font.Size; + } + /// + /// Measure the Length of the Group + /// + /// Group of SupInfo Paragraphs + /// pdfContentByte + /// Page Length + /// Length + private float MeasureSupInfoGroupLength(List grp, PdfContentByte cb, float pagelength) + { + _LastBottom = 0; + _LastOffset = 12;// 24; // account for the Sup Info header (two lines) + float fontSize = grp[0].IParagraph.Leading; // current font size + // For each SupInfo Paragraph calculate length + foreach (vlnParagraph pg in grp) + { + MeasureSupInfoGroupLength(pg, cb);// Measure a SupInfo Paragraph and children + _LastOffset += _LastBottom; + _LastBottom = 0; + } + //Console.WriteLine("MeasureSupInfoGroupLength {0} {1} {2} {3}", grp[0].MyItemInfo.ItemID, _LastOffset, fontSize, pagelength); + return _LastOffset; + } + /// + /// Measure the height of a supinfo paragraph and children + /// + /// SupInfo paragraph + /// pdfContentByte + private void MeasureSupInfoGroupLength(vlnParagraph pg, PdfContentByte cb) + { + _LastBottom = pg.YBottomMost; + foreach (vlnParagraph cpg in pg.ChildrenAbove) // Measure Children Above + MeasureSupInfoGroupLength(cpg, cb); + foreach (vlnParagraph cpg in pg.ChildrenBelow) // Measure Children Below + MeasureSupInfoGroupLength(cpg, cb); + foreach (vlnParagraph cpg in pg.ChildrenLeft) // Measure Children Left + MeasureSupInfoGroupLength(cpg, cb); + foreach (vlnParagraph cpg in pg.ChildrenRight) // Measure Children Right + MeasureSupInfoGroupLength(cpg, cb); + } + /// + /// Find Groups of SupInfo Paragraphs + /// + /// SupInfo Paragraph + /// List of supinfo paragraph groups private List> FindSupInfoGroups(vlnParagraph vlnParagraph) { List> supInfoGroups; @@ -1801,153 +1967,8 @@ namespace Volian.Print.Library return supInfoGroups; } #endregion //ShrinkSupInfoGroupAtATime - #region ShrinkSupplementInfoTextFont - /* - * The logic in this region will look a the text that should appear on a supplemental information page - * and reduce the size of the text and spacing between paragraphs so that it will fit on the one page. - */ - private Dictionary _SupInfoLengths; - static int _LastSupInfoItemID; - static float _LastBottom; - static float _LastOffset; - - // create a dictionary of Supplemental Info pargraph heights - private void FindSupInfoLengths(vlnParagraph vlnParagraph) - { - _SupInfoLengths = new Dictionary(); - _LastBottom = 0; - _LastSupInfoItemID = 0; - _LastOffset = 0; - FindSupInfoLength(vlnParagraph); - if (_LastSupInfoItemID != 0) - _SupInfoLengths.Add(_LastSupInfoItemID, _LastBottom); - //ShowSupInfoPages(); //debug - - } - //private void ShowSupInfoPages() // used for debug - //{ - // foreach (int key in _SupInfoPages.Keys) - // Console.WriteLine("SupInfoPage {0} {1}", key, _SupInfoPages[key]); - //} - - // add the supplemental info page paragraph length (height) the dictionary - private void FindSupInfoLength(vlnParagraph vlnParagraph) - { - //Console.WriteLine("{0} {1} ybottommost {2} yoffset {3} LastOffSet {4} LastBottom {5} PrefPgBreak {6}", vlnParagraph.MyItemInfo.ItemID, vlnParagraph.MyItemInfo.ShortPath, vlnParagraph.YBottomMost, vlnParagraph.YOffset, _LastOffset, _LastBottom,vlnParagraph.PrefPageBreak); - SectionInfo supInfoSect = vlnParagraph.MyItemInfo.MyActiveSection as SectionInfo; - if (supInfoSect.StepSectPageBreaksForSupInfo != null && supInfoSect.StepSectPageBreaksForSupInfo.Contains(vlnParagraph.MyItemInfo.ItemID)) - { - if (_LastSupInfoItemID != 0) - _SupInfoLengths.Add(_LastSupInfoItemID, _LastBottom + _LastOffset); - _LastOffset = 24; // account for the Sup Info header (two lines) - _LastBottom = 0; - _LastSupInfoItemID = vlnParagraph.MyItemInfo.ItemID; - } - if (vlnParagraph.YOffset == 0) - _LastOffset += _LastBottom + 12f; // the +12 accounts for blank lines between paragraphs - _LastBottom = vlnParagraph.YBottomMost; - foreach (vlnParagraph pg in vlnParagraph.ChildrenAbove) - FindSupInfoLength(pg); - foreach (vlnParagraph pg in vlnParagraph.ChildrenBelow) - FindSupInfoLength(pg); - foreach (vlnParagraph pg in vlnParagraph.ChildrenLeft) - FindSupInfoLength(pg); - foreach (vlnParagraph pg in vlnParagraph.ChildrenRight) - FindSupInfoLength(pg); - - } - private Dictionary _AdjustForParagraphShrinkage; - private float _AdjustSupInfoSize = 0; - private void AdjustSupInfoFontSize(vlnParagraph vlnParagraph, PdfContentByte cb) - { - AdjustSupInfoFontSize(vlnParagraph, cb, 0); - } - // if there is too much supplemental info text to fit on the page at the normal font, - // reduce the size of font so it fits on the page, but only if the reduced font size is still easly readable. - private void AdjustSupInfoFontSize(vlnParagraph vlnParagraph, PdfContentByte cb, int level) - { - if (vlnParagraph.MyItemInfo.ItemID == 62805) - Console.WriteLine("stop"); - if (_SupInfoLengths.ContainsKey(vlnParagraph.MyItemInfo.ItemID)) - { - float hsize = _SupInfoLengths[vlnParagraph.MyItemInfo.ItemID]; - //if (hsize > 900) - // Console.WriteLine("stop"); - //if (hsize < 504 || hsize > 900) // not bigger than the page and not too big to shrink - float hMin = (float)vlnParagraph.MyItemInfo.MyDocStyle.Layout.PageLength; - float hMax = 1.75f * hMin; - float hMult = (1.0f - .67f) / (hMin - hMax); - float hOffSet = 1.0f - (hMult * hMin); - if (hsize < hMin)// || hsize > hMax) // not bigger than the page and not too big to shrink - _AdjustSupInfoSize = 1f; // don't adjust the font size - else - _AdjustSupInfoSize = hOffSet + hsize * hMult; // shrink the font size and line spacing - //_AdjustSupInfoSize = 1.4447F - hsize * .00088F; // shrink the font size and line spacing - } - //if (vlnParagraph.PrefPageBreak || vlnParagraph.HasPrefPageBreak) - // Console.WriteLine("path {0}, PrePageBeak = {1}, ItemID = {2}", vlnParagraph.MyItemInfo.ShortPath, vlnParagraph.PrefPageBreak, vlnParagraph.MyItemInfo.ItemID); - //if (level == 1) - // Console.WriteLine("bottom most {0}", vlnParagraph.YBottomMost - vlnParagraph.YOffset); - float hBefore = vlnParagraph.Height; - SupInfoFixChunks(vlnParagraph); - //Console.WriteLine("Orig Font Size {0}", vlnParagraph.IParagraph.Leading); - vlnParagraph.IParagraph.Leading = _AdjustSupInfoSize * vlnParagraph.IParagraph.Leading; - float hAfter = vlnParagraph.GetParagraphHeight(cb, vlnParagraph.IParagraph, "", vlnParagraph.Width); - float hleading = hBefore * _AdjustSupInfoSize; - if (vlnParagraph.YOffset == 0) - _AdjustForParagraphShrinkage = new Dictionary(); - if (hleading > hAfter +1) - { - if (!_AdjustForParagraphShrinkage.ContainsKey(vlnParagraph.YOffset)) - _AdjustForParagraphShrinkage.Add(vlnParagraph.YOffset, hleading - hAfter); - //Console.WriteLine("hbefore = {0} hAfter {1} hLeading {2}", hBefore, hAfter, hleading); - } - vlnParagraph.YOffset = SupInfoFixOffset(vlnParagraph); - foreach (vlnParagraph pg in vlnParagraph.ChildrenAbove) - AdjustSupInfoFontSize(pg,cb,level +1); - foreach (vlnParagraph pg in vlnParagraph.ChildrenBelow) - AdjustSupInfoFontSize(pg,cb,level +1); - foreach (vlnParagraph pg in vlnParagraph.ChildrenLeft) - AdjustSupInfoFontSize(pg,cb,level +1); - foreach (vlnParagraph pg in vlnParagraph.ChildrenRight) - AdjustSupInfoFontSize(pg,cb,level +1); - foreach (vlnPrintObject po in vlnParagraph.PartsAbove) - SupInfoFixParts(po); - foreach (vlnPrintObject po in vlnParagraph.PartsBelow) - SupInfoFixParts(po); - foreach (vlnPrintObject po in vlnParagraph.PartsLeft) - SupInfoFixParts(po); - foreach (vlnPrintObject po in vlnParagraph.PartsRight) - SupInfoFixParts(po); - } - - // adjust the step tabs - private float SupInfoFixOffset( vlnPrintObject vpo) - { - float fixOffSet = 0; - foreach (float off in _AdjustForParagraphShrinkage.Keys) - if (off < vpo.YOffset) - fixOffSet += _AdjustForParagraphShrinkage[off]; - return _AdjustSupInfoSize * vpo.YOffset - fixOffSet; - } - - // adjust the space between the paragraphs - private void SupInfoFixParts(vlnPrintObject po) - { - foreach (Chunk chk in po.IParagraph.Chunks) - chk.Font.Size = _AdjustSupInfoSize * chk.Font.Size; - po.IParagraph.Leading = _AdjustSupInfoSize * po.IParagraph.Leading; - po.YOffset = SupInfoFixOffset(po); - } - - // adjust the font size of the paragraph text - private void SupInfoFixChunks(vlnParagraph vlnParagraph) - { - foreach (Chunk chk in vlnParagraph.IParagraph.Chunks) - chk.Font.Size = _AdjustSupInfoSize * chk.Font.Size; - } - #endregion // ShrinkSupplementInfoTextFont + public void DoSupInfoPage(PdfContentByte cb, string str, PdfLayer textLayer, VlnSvgPageHelper myPageHelper, int itemid, bool insertBlankPages) { // see if the ID is in the facing page pdf - if so, get the page: