Keep RO Link for RO Images

Changed AddRtfText to public
Center figures in the PDF
Added debug output for figures.
This commit is contained in:
Rich 2016-11-04 13:22:54 +00:00
parent c6da832041
commit c014652d90
3 changed files with 21 additions and 3 deletions

View File

@ -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)
{

View File

@ -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)

View File

@ -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;