Replace words for bolding [Bxxx], i.e. support for regular expression text in replaceword/with

Added TextAt counter for debug
Added debug of TextAt by allowing specifying of ItemIds
This commit is contained in:
2014-08-18 13:34:09 +00:00
parent c24d6b94ea
commit a33347b22a
3 changed files with 35 additions and 3 deletions

View File

@@ -401,6 +401,7 @@ namespace Volian.Print.Library
}
private string PrintProcedureOrFoldout(ProcedureInfo myProcedure, SectionInfo myFoldoutSection, string outputFileName, bool makePlacekeeper)
{
Rtf2Pdf.TextAtCounter = 0;
bool doingFoldout = myFoldoutSection != null;
// The following line accounts for 16bit OverrideLeftMargin when the 'Absolute' attribute is used in the genmac.
// We don't want to use the OverrideLeftMargin when 'Absolute' is used in the genmac.

View File

@@ -73,6 +73,16 @@ namespace Volian.Print.Library
set { Rtf2Pdf._Offset = value; }
}
public static float FillWidth = 0; // max text width (used in autoToc code)
private static int _TextAtCounter = 0;
public static int TextAtCounter
{
get { return Rtf2Pdf._TextAtCounter; }
set { Rtf2Pdf._TextAtCounter = value; }
}
private static int NextTextAtCounter
{
get { return ++TextAtCounter; }
}
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;
@@ -100,9 +110,20 @@ namespace Volian.Print.Library
if (iParagraph.Font.BaseFont != null)
yDescent = -iParagraph.Font.BaseFont.GetDescentPoint("Almg", iParagraph.Font.Size);
if (PdfDebug)
DrawPdfDebug(cb, left, top, left + width, myColumnText.YLine, debugText, yDescent);
{
int next = NextTextAtCounter;
if (InList(next,258,259)) Console.WriteLine("here");
string dbt = string.Format("[{0}]{1}", next, debugText ?? "");
DrawPdfDebug(cb, left, top, left + width, myColumnText.YLine, dbt, yDescent);
}
return myColumnText.YLine;
}
private static bool InList(int value, params int [] examples)
{
foreach (int ex in examples)
if (ex == value) return true;
return false;
}
public static float FigureAt(PdfContentByte cb, iTextSharp.text.Image image, float x, float y, float width, float height, string debugText, float yBottommargin, bool hasBorder)
{
VlnSvgPageHelper _MyPageHelper = cb.PdfWriter.PageEvent as VlnSvgPageHelper;