This commit is contained in:
2011-04-06 14:28:12 +00:00
parent 92a879bb6b
commit f1074ce770
3 changed files with 102 additions and 10 deletions

View File

@@ -442,8 +442,7 @@ namespace Volian.Print.Library
// For example Header1 becomes H1 and Box2 becomes B2
return token.Substring(1, 1) + token.Substring(token.Length - 2, 1);
}
private static Regex regexJustTokens = new Regex(@"^{([^{}\?]*}{)*[^{}\?]*}$");
private static Regex regexJustTokens = new Regex(@"^{([^{}]*}{)*[^{}]*}$");
private void AddPageListItems(Volian.Svg.Library.Svg mySvg, VEPROMS.CSLA.Library.PageStyle pageStyle, VEPROMS.CSLA.Library.SectionInfo section)
{
SvgGroup svgGroup = new SvgGroup();
@@ -492,7 +491,39 @@ namespace Volian.Print.Library
svgGroup.Add(PageItemToSvgText(pageItem, section.DisplayNumber));
break;
default:
svgGroup.Add(PageItemToSvgText(pageItem, pageItem.Token));
// see if it's a PSI token:
if (token.Contains(@"PS-"))
{
ProcedureConfig procConfig = section.MyProcedure.MyConfig as ProcedureConfig;
if (procConfig != null)
{
int indx = token.IndexOf("-");
string val = procConfig.GetValue("PSI", token.Substring(4,token.Length-5));
svgGroup.Add(PageItemToSvgText(pageItem, val));
}
}
else if (token.Contains(@"PS="))
{
ProcedureConfig procConfig = section.MyProcedure.MyConfig as ProcedureConfig;
if (procConfig != null)
{
int indx = token.IndexOf("=");
int qindx = token.IndexOf("?", indx);
string pstok = token.Substring(indx + 1, qindx-indx-1);
string val = procConfig.GetValue("PSI", pstok);
int bindx = token.IndexOf("|", indx);
if (val == "Y")
val = token.Substring(qindx + 1, bindx - qindx - 1);
else
{
int eindx = token.IndexOf("}", bindx);
val = token.Substring(bindx + 1, eindx - bindx - 1);
}
if (val != null && val != "")svgGroup.Add(PageItemToSvgText(pageItem, val));
}
}
else
svgGroup.Add(PageItemToSvgText(pageItem, pageItem.Token));
//_MyLog.InfoFormat("Token not processed {0}", token);
break;
}

View File

@@ -119,7 +119,7 @@ namespace Volian.Print.Library
myColumnText.AddElement(iParagraph);
//myColumnText.UseAscender = true;// Adjusts to the top of the text box.
int status = myColumnText.Go(true); // Check to see if it will fit on the page.
if (ColumnText.HasMoreText(status) && throwException)
if (ColumnText.HasMoreText(status) && throwException)
throw (new Exception("Paragraph longer than a page"));
return 792F - myColumnText.YLine; // This gives the height of the Paragraph
}
@@ -245,7 +245,7 @@ namespace Volian.Print.Library
}
private static bool FontIsFixed(System.Drawing.Font font)
{
iTextSharp.text.Font iFont = Rtf2iTextSharp.GetFont(font);
iTextSharp.text.Font iFont = Volian.Svg.Library.VolianPdf.GetFont(font);
float fW = iFont.BaseFont.GetWidthPointKerned("W", 12);
float fE = iFont.BaseFont.GetWidthPointKerned("!", 12);
return fW == fE;