This commit is contained in:
@@ -56,7 +56,7 @@ namespace Volian.Print.Library
|
||||
{
|
||||
while (yTop > 0)
|
||||
{
|
||||
float newYTop = TextAt(cb, para, x, yTop - 12F, width, 100,"");
|
||||
float newYTop = TextAt(cb, para, x, yTop - 12F, width, 100,"",36);
|
||||
//Console.WriteLine("{0},{1},{2}", yTop, width, newYTop);
|
||||
width -= 16;
|
||||
yTop = newYTop;
|
||||
@@ -74,7 +74,7 @@ namespace Volian.Print.Library
|
||||
get { return Rtf2Pdf._Offset; }
|
||||
set { Rtf2Pdf._Offset = value; }
|
||||
}
|
||||
public static float TextAt(PdfContentByte cb, Paragraph iParagraph, float x, float y, float width, float height, string debugText)
|
||||
public static float TextAt(PdfContentByte cb, Paragraph iParagraph, float x, float y, float width, float height, string debugText, float yBottomMargin)
|
||||
{
|
||||
VlnSvgPageHelper _MyPageHelper = cb.PdfWriter.PageEvent as VlnSvgPageHelper;
|
||||
PdfLayer textLayer = _MyPageHelper == null ? null : _MyPageHelper.TextLayer;
|
||||
@@ -83,7 +83,7 @@ namespace Volian.Print.Library
|
||||
float right = left + width;
|
||||
float bottom = top - height;
|
||||
ColumnText myColumnText = new ColumnText(cb);
|
||||
myColumnText.SetSimpleColumn(left, top, left + width,36); // Bottom margin
|
||||
myColumnText.SetSimpleColumn(left, top, left + width, yBottomMargin);
|
||||
myColumnText.AddElement(iParagraph);
|
||||
float pos = myColumnText.YLine; // Save the position to be used if the paragraph fits
|
||||
int status = myColumnText.Go(true); // Check to see if it will fit on the page.
|
||||
@@ -100,16 +100,18 @@ namespace Volian.Print.Library
|
||||
if (iParagraph.Font.BaseFont != null)
|
||||
yDescent = -iParagraph.Font.BaseFont.GetDescentPoint("Almg", iParagraph.Font.Size);
|
||||
if (PdfDebug)
|
||||
DrawPdfDebug(cb, System.Drawing.Color.CadetBlue, left, top, left + width, myColumnText.YLine, debugText,yDescent);
|
||||
DrawPdfDebug(cb, left, top, left + width, myColumnText.YLine, debugText,yDescent);
|
||||
return myColumnText.YLine;
|
||||
}
|
||||
private static void DrawPdfDebug(PdfContentByte cb, System.Drawing.Color sysColor, float left, float top, float right, float bottom, string debugText, float yDescent)
|
||||
private static void DrawPdfDebug(PdfContentByte cb, float left, float top, float right, float bottom, string debugText, float yDescent)
|
||||
{
|
||||
// yAdj is dependent on the size of the font and the spacing between lines.
|
||||
cb.SaveState();
|
||||
VlnSvgPageHelper _MyPageHelper = cb.PdfWriter.PageEvent as VlnSvgPageHelper;
|
||||
PdfLayer debugLayer = _MyPageHelper == null ? null : _MyPageHelper.DebugLayer;
|
||||
if (debugLayer != null) cb.BeginLayer(debugLayer);
|
||||
if (debugLayer == null) return;
|
||||
System.Drawing.Color sysColor = PrintOverride.OverrideDebugColor(System.Drawing.Color.Gray);
|
||||
// yAdj is dependent on the size of the font and the spacing between lines.
|
||||
cb.SaveState();
|
||||
cb.BeginLayer(debugLayer);
|
||||
cb.SetColorStroke(new Color(sysColor));
|
||||
cb.SetLineWidth(.1F);
|
||||
cb.MoveTo(left, top - yDescent);
|
||||
@@ -129,7 +131,7 @@ namespace Volian.Print.Library
|
||||
cb.SetColorFill(new Color(sysColor));
|
||||
ct.Go();
|
||||
}
|
||||
if (debugLayer != null) cb.EndLayer();
|
||||
cb.EndLayer();
|
||||
cb.RestoreState();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user