This commit is contained in:
2010-06-16 14:12:14 +00:00
parent ef5f141b03
commit 7b018d1abb
5 changed files with 110 additions and 41 deletions

View File

@@ -32,7 +32,12 @@ namespace Volian.Print.Library
protected static float _WidthAdjust = 1; // 1 Point - adjusted to match 16-bit line wrapping. For editting it's 3.
protected static float _WidthAdjustBox = 6;
protected static float _CharsToTwips = 6; // assumes 12 char per inch
internal static float _SixLinesPerInch = 12; // twips
private static float _SixLinesPerInch = 12; // twips
public static float SixLinesPerInch
{
get { return vlnPrintObject._SixLinesPerInch; }
set { vlnPrintObject._SixLinesPerInch = value; }
}
protected static float _SevenLinesPerInch = 10.1F;//72F / 7F;
protected float _XOffset;
@@ -196,7 +201,8 @@ namespace Volian.Print.Library
StringBuilder rtfSB = new StringBuilder();
//DisplayText vlntxt = new DisplayText(text.TrimStart(" ".ToCharArray()), vFont, false);
DisplayText vlntxt = new DisplayText(text, vFont, false);
rtfSB.Append(AddFontTable(vlntxt.TextFont.WindowsFont));
//rtfSB.Append(AddFontTable(vlntxt.TextFont.WindowsFont));
rtfSB.Append(AddFontTable(vFont.WindowsFont));
rtfSB.Append(vlntxt.StartText);
rtfSB.Append("}");
return rtfSB.ToString();
@@ -266,19 +272,20 @@ namespace Volian.Print.Library
}
public void DebugPdf(PdfContentByte cb, float left, float top)
{
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;
cb.SaveState();
cb.BeginLayer(debugLayer);
ColumnText ct = new ColumnText(cb);
ct.SetSimpleColumn(left, top, left+50, top - 50);
iTextSharp.text.Font font = FontFactory.GetFont("Arial", 2);
Chunk chk = new Chunk(DebugId.ToString(), font);
Phrase ph = new Phrase(chk);
ct.AddElement(ph);
cb.SetColorFill(new iTextSharp.text.Color(System.Drawing.Color.CadetBlue));
cb.SetColorFill(new iTextSharp.text.Color(PrintOverride.OverrideDebugColor(System.Drawing.Color.Gray)));
ct.Go();
if (debugLayer != null) cb.EndLayer();
cb.EndLayer();
cb.RestoreState();
}
}