diff --git a/PROMS/Volian.Controls.Library/ImageItem.cs b/PROMS/Volian.Controls.Library/ImageItem.cs index e6c2cadc..25d42635 100644 --- a/PROMS/Volian.Controls.Library/ImageItem.cs +++ b/PROMS/Volian.Controls.Library/ImageItem.cs @@ -761,11 +761,15 @@ namespace Volian.Controls.Library } else if (InsType == E_ImageSource.RoFigure) { + DisplayText vlntxt = new DisplayText(MyItemInfo, E_EditPrintMode.Edit, E_ViewMode.View, false, E_FieldToEdit.Text, true, null, null, false); if (MyStepRTB.OrigDisplayText == null) { - DisplayText vlntxt = new DisplayText(MyItemInfo, E_EditPrintMode.Edit, E_ViewMode.View, false, E_FieldToEdit.Text, true, null, null, false); MyStepRTB.OrigDisplayText = vlntxt; } + if (MyStepRTB.Text == "") + { + MyStepRTB.AddRtfText(vlntxt.StartText); + } bool success = MyStepRTB.OrigDisplayText.Save((RichTextBox)MyStepRTB); if (success && _newSizeHt != 0) { diff --git a/PROMS/Volian.Controls.Library/StepRTB.cs b/PROMS/Volian.Controls.Library/StepRTB.cs index 8ae286fb..8bbcd340 100644 --- a/PROMS/Volian.Controls.Library/StepRTB.cs +++ b/PROMS/Volian.Controls.Library/StepRTB.cs @@ -1047,7 +1047,7 @@ namespace Volian.Controls.Library { return string.Format("[StepRTB {0},{1},{2}]", MyItemInfo.ItemID, MyItemInfo.DisplayNumber, MyItemInfo.DisplayText); } - private void AddRtfText(string txt) + public void AddRtfText(string txt) { //Console.WriteLine("ItemID:{0}", MyItemInfo.ItemID); //if(MyItemInfo.ItemID==10256) diff --git a/PROMS/Volian.Print.Library/Rtf2Pdf.cs b/PROMS/Volian.Print.Library/Rtf2Pdf.cs index e1797bdb..672a6a2e 100644 --- a/PROMS/Volian.Print.Library/Rtf2Pdf.cs +++ b/PROMS/Volian.Print.Library/Rtf2Pdf.cs @@ -188,7 +188,7 @@ namespace Volian.Print.Library VlnSvgPageHelper _MyPageHelper = cb.PdfWriter.PageEvent as VlnSvgPageHelper; PdfLayer textLayer = _MyPageHelper == null ? null : _MyPageHelper.TextLayer; float left = x + Offset.X; - float top = y + Offset.Y; + float top = y + Offset.Y+ 12; float bottom = top - height; image.ScaleAbsoluteWidth(width); image.ScaleAbsoluteHeight(height); @@ -204,6 +204,20 @@ namespace Volian.Print.Library cb.Stroke(); } if (textLayer != null) cb.EndLayer(); + if (PdfDebug) + { + // be very careful around the following line, if the cursor 'touches' + // NextTextAtCounter, it is incremented and the 'next' value may not be what + // was seen as the UniqueNumber in the pdf. + int next = NextTextAtCounter; + // buffer (unnecessary comments) so + // that cursor does NOT touch 'NextTextAtCounter' + // as easily + //if (InList(next,2958, 2961)) Console.WriteLine("Stop at UniqueNumber"); + string dbt = string.Format("[{0}]{1}", next, debugText ?? ""); + DrawPdfDebug(cb, left, top, left + width, top-height, dbt, 0); + } + return bottom; } private static float _GridTopAdjust = -10;