Equation Editor interface support

This commit is contained in:
2016-11-17 15:05:15 +00:00
parent 3e212834ea
commit 0b7371367c
26 changed files with 2129 additions and 855 deletions

View File

@@ -271,5 +271,52 @@ namespace Volian.Print.Library
cb.EndLayer();
cb.RestoreState();
}
internal static float RtfRawAt(PdfContentByte cb, System.Drawing.Image image, float XOffset, float yLocation, float Width, float Height, string debug, float yBottomMargin, bool hasBorder)
{
VlnSvgPageHelper _MyPageHelper = cb.PdfWriter.PageEvent as VlnSvgPageHelper;
PdfLayer textLayer = _MyPageHelper == null ? null : _MyPageHelper.TextLayer;
float left = XOffset + Offset.X;
float top = yLocation + Offset.Y;
float bottom = top - Height;
float scale = .6f;
iTextSharp.text.Image it_image=null;
try
{
it_image = iTextSharp.text.Image.GetInstance(image,iTextSharp.text.Color.WHITE);
float itxtWid = scale * Width * 300 / 72;
float itxtHt = scale * Height * 300 / 72;
it_image.ScaleAbsoluteWidth(scale * Width);
it_image.ScaleAbsoluteHeight(scale * Height);
it_image.SetAbsolutePosition(left, top-(scale*Height));
cb.AddImage(it_image);
}
catch (Exception ex)
{
Console.WriteLine("Exception {0}", ex.Message);
}
if (hasBorder)
{
iTextSharp.text.Color boxColor = new iTextSharp.text.Color(System.Drawing.Color.Black);
cb.SetColorStroke(boxColor);
cb.SetLineWidth(.85F);
cb.Rectangle(left - 1.5F, top - (scale * Height) - 1.5F, (scale * Width) + 3, (scale * Height) + 3);
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
string dbt = string.Format("[{0}]{1}", next, debug ?? "");
DrawPdfDebug(cb, left, top, left + (scale*Width), top-(scale*Height), dbt, 0);
}
return bottom;
}
}
}