added check for null MacroDef

additional checks for checkoffs and logic support or NSP script Cautions with bullets
fixed pagelist processing issue when pagelist row has more than one token
support for NSP script Cautions
fixed problem where the END message was not printing for NSP (the Y location was negative – off the page)
This commit is contained in:
John Jenko 2011-12-07 14:04:53 +00:00
parent b48e39be12
commit f7cb594d76
5 changed files with 172 additions and 70 deletions

View File

@ -561,6 +561,11 @@ namespace Volian.Print.Library
MatchCollection matches = regexFindToken.Matches(pageItem.Token);
if (matches.Count>0)
{
string plstr = "";
// When a pagelist line (row) has more than one token that is resolved to text, each resolved token text was place on top
// of each other. Use a temporary string (plstr) to process the pagelist tokens for each pagelist line (row) before adding
// it to the svgGroup.
plstr = pageItem.Token;
foreach (Match match in matches)
{
string token = match.Value;
@ -569,9 +574,11 @@ namespace Volian.Print.Library
{
case "{!atom}":
// Add an Atom Figure to the SVG
plstr = plstr.Replace(token, "");
AddImage(svgGroup,160.5f, 170.5f,288f, 323f,"atom.bmp");
break;
case "{!cpllogo}":
plstr = plstr.Replace(token, "");
AddImage(svgGroup, 10f, 10f, 78.7f, 29.8f, "cpllogo.bmp");
break;
//case "{!domlogo}":
@ -594,6 +601,7 @@ namespace Volian.Print.Library
case "{BOX7}":
case "{BOX8}":
case "{BOX9}":
plstr = plstr.Replace(token, "");
svgGroup.Add(PageItemToSvgUse(pageItem, FirstAndLast(token)));
break;
case "{PMODEBOX}": // need to set either 1 or 2 depending on number of columns
@ -605,6 +613,7 @@ namespace Volian.Print.Library
else if (_MySection.SectionConfig.Section_ColumnMode == SectionConfig.SectionColumnMode.Two)
box = "2";
box = "{BOX" + box + "}";
plstr = plstr.Replace(token, "");
svgGroup.Add(PageItemToSvgUse(pageItem, FirstAndLast(box)));
break;
case "{DRAFTPAGE}":
@ -627,14 +636,14 @@ namespace Volian.Print.Library
case "{PROCTITLE2}":
case "{COVERPROCTITLE}":
float linelen = (int)section.ActiveFormat.PlantFormat.FormatData.ProcData.TitleLength * (float)pageItem.Font.CPI / 12;
SplitTitle(svgGroup, pageItem, section.MyProcedure.MyContent.Text.ToUpper(), (int)linelen, token); //,rowAdj);
plstr = SplitTitle(svgGroup, pageItem, section.MyProcedure.MyContent.Text.ToUpper(), (int)linelen, token, plstr); //,rowAdj);
//SplitTitle(svgGroup, pageItem, section.MyProcedure.MyContent.Text, (int)section.ActiveFormat.PlantFormat.FormatData.ProcData.TitleLength, token);
break;
case "{COVERTITLE1}":
case "{COVERTITLE2}":
int ctlen = section.ActiveFormat.PlantFormat.FormatData.ProcData.CoverTitleLength??0;
float coverlinelen = ((ctlen == 0) ? (int)section.ActiveFormat.PlantFormat.FormatData.ProcData.TitleLength : ctlen) * (float)pageItem.Font.CPI / 12;
SplitCoverTitle(svgGroup, pageItem, section.MyProcedure.MyContent.Text, (int)coverlinelen, token);//, rowAdj);
plstr = SplitCoverTitle(svgGroup, pageItem, section.MyProcedure.MyContent.Text, (int)coverlinelen, token, plstr);//, rowAdj);
//SplitTitle(svgGroup, pageItem, section.MyProcedure.MyContent.Text, (int)section.ActiveFormat.PlantFormat.FormatData.ProcData.TitleLength, token);
break;
case "{EOPNUM}":
@ -642,18 +651,21 @@ namespace Volian.Print.Library
string unitnum = MySection.MyDocVersion.DocVersionConfig.Unit_ProcedureNumber;
if (unitnum.Length > 0)
eopnum = unitnum.Replace("#", eopnum);
svgGroup.Add(PageItemToSvgText(pageItem, pageItem.Token.Replace(token, eopnum)));
plstr = plstr.Replace(token, eopnum);
//svgGroup.Add(PageItemToSvgText(pageItem, pageItem.Token.Replace(token, eopnum)));
//svgGroup.Add(PageItemToSvgText(pageItem, pageItem.Token.Replace(token, section.MyProcedure.MyContent.Number)));
break;
case "{SECTIONLEVELTITLE}":
SplitTitle(svgGroup, pageItem, section.DisplayText, section.ActiveFormat.PlantFormat.FormatData.SectData.SectionTitleLength, token);
svgGroup.Add(PageItemToSvgText(pageItem, section.DisplayText));
plstr = SplitTitle(svgGroup, pageItem, section.DisplayText, section.ActiveFormat.PlantFormat.FormatData.SectData.SectionTitleLength, token, plstr);
//svgGroup.Add(PageItemToSvgText(pageItem, section.DisplayText));
break;
case "{SECTIONLEVELNUMBER}":
svgGroup.Add(PageItemToSvgText(pageItem, pageItem.Token.Replace(token,section.DisplayNumber)));
plstr = plstr.Replace(token, section.DisplayNumber);
//svgGroup.Add(PageItemToSvgText(pageItem, pageItem.Token.Replace(token, section.DisplayNumber)));
break;
case "{UNITTEXT}":
svgGroup.Add(PageItemToSvgText(pageItem, pageItem.Token.Replace(token,MySection.MyDocVersion.DocVersionConfig.Unit_Text)));
plstr = plstr.Replace(token, MySection.MyDocVersion.DocVersionConfig.Unit_Text);
//svgGroup.Add(PageItemToSvgText(pageItem, pageItem.Token.Replace(token, MySection.MyDocVersion.DocVersionConfig.Unit_Text)));
break;
case "{CHKOFFHEADING}":
int sindx = section.CheckOffHeadingIndex();
@ -661,6 +673,7 @@ namespace Volian.Print.Library
// which is always '{NO HEADING}".
if (sindx > 0)
{
plstr = plstr.Replace(token, "");
svgGroup.Add(PageItemToSvgText(pageItem, section.ActiveFormat.PlantFormat.FormatData.ProcData.CheckOffData.CheckOffHeaderList[sindx].CheckOffHeading, section.ActiveFormat.PlantFormat.FormatData.ProcData.CheckOffData.CheckOffHeaderList[sindx].Font));
}
break;
@ -673,7 +686,8 @@ namespace Volian.Print.Library
{
int indx = token.IndexOf("-");
string val = procConfig.GetValue("PSI", token.Substring(4,token.Length-5));
svgGroup.Add(PageItemToSvgText(pageItem, pageItem.Token.Replace(token,val)));
plstr = plstr.Replace(token, val);
//svgGroup.Add(PageItemToSvgText(pageItem, pageItem.Token.Replace(token, val)));
}
}
else if (token.Contains(@"PS="))
@ -683,7 +697,7 @@ namespace Volian.Print.Library
{
int indx = token.IndexOf("=");
int qindx = token.IndexOf("?", indx);
string pstok = token.Substring(indx + 1, qindx-indx-1);
string pstok = token.Substring(indx + 1, qindx - indx - 1);
string val = procConfig.GetValue("PSI", pstok);
int bindx = token.IndexOf("|", indx);
if (val == "Y")
@ -693,7 +707,9 @@ namespace Volian.Print.Library
int eindx = token.IndexOf("}", bindx);
val = token.Substring(bindx + 1, eindx - bindx - 1);
}
if (val != null && val != "")svgGroup.Add(PageItemToSvgText(pageItem, val));
if (val != null && val != "")
plstr = plstr.Replace(token, val);
//if (val != null && val != "") svgGroup.Add(PageItemToSvgText(pageItem, val));
}
}
//else if (token.Contains(@"{DRV:Lpi "))
@ -706,16 +722,20 @@ namespace Volian.Print.Library
// PrevRow = (float)pageItem.Row;
//}
else
svgGroup.Add(PageItemToSvgText(pageItem, pageItem.Token));
{
if (plstr != "")
svgGroup.Add(PageItemToSvgText(pageItem, plstr));
//svgGroup.Add(PageItemToSvgText(pageItem, pageItem.Token));
}
//_MyLog.InfoFormat("Token not processed {0}", token);
break;
}
}
} // end foreach matches
if (plstr != "")
svgGroup.Add(PageItemToSvgText(pageItem, plstr));
}
else
{
svgGroup.Add(PageItemToSvgText(pageItem, pageItem.Token));
}
}
// Proms page numbering designed requires a "{PAGE}" token to increment the page counter. So the easiest way
// to do that was to add a "{PAGE}" token to every page that is flagged as not to be printed.
@ -729,14 +749,16 @@ namespace Volian.Print.Library
svgGroup.Add(new SvgImage(new System.Drawing.PointF(x, y), new System.Drawing.SizeF(w, h),
System.Windows.Forms.Application.StartupPath + @"\Resources\" + figure));
}
private void SplitTitle(SvgGroup svgGroup, VEPROMS.CSLA.Library.PageItem pageItem, string title, int? len, string match)
private string SplitTitle(SvgGroup svgGroup, VEPROMS.CSLA.Library.PageItem pageItem, string title, int? len, string match, string plstr)
//private void SplitTitle(SvgGroup svgGroup, VEPROMS.CSLA.Library.PageItem pageItem, string title, int? len, string match)
{
if (match == "{PROCTITLE2}") return;
if (len == null || ItemInfo.StripRtfFormatting(title).Length < len)
if (match == "{PROCTITLE2}") return plstr;
if (len == 0 || ItemInfo.StripRtfFormatting(title).Length < len)
{
if (match == "{PROCTITLE2}") return; // this would have been done in proctitle1
svgGroup.Add(PageItemToSvgText(pageItem, title));
return;
if (match == "{PROCTITLE2}") return plstr; // this would have been done in proctitle1
plstr = plstr.Replace(match, title);
//svgGroup.Add(PageItemToSvgText(pageItem, title));
return plstr;
}
// Otherwise determine how many line to split the text into
List<string> titleLines = SplitText(title, (int)len);
@ -745,27 +767,35 @@ namespace Volian.Print.Library
// move down 6.
int adj = pageItem.Token.Contains("1") || pageItem.Token.Contains("2") ? 0 : -6;
float yOffset = adj * (titleLines.Count - 1);
int cnt = 0;
foreach (string line in titleLines)
{
svgGroup.Add(PageItemToSvgText(pageItem, line, yOffset));
cnt++;
if (cnt == 1)
plstr = plstr.Replace(match, line);
else
svgGroup.Add(PageItemToSvgText(pageItem, line, yOffset));
yOffset += 12;
}
return plstr;
}
private void SplitCoverTitle(SvgGroup svgGroup, VEPROMS.CSLA.Library.PageItem pageItem, string title, int? len, string match)
private string SplitCoverTitle(SvgGroup svgGroup, VEPROMS.CSLA.Library.PageItem pageItem, string title, int? len, string match, string plstr)
//private void SplitCoverTitle(SvgGroup svgGroup, VEPROMS.CSLA.Library.PageItem pageItem, string title, int? len, string match)
{
if (len == null || ItemInfo.StripRtfFormatting(title).Length < len)
{
if (match == "{COVERTITLE2}") return; // this would have been done in COVERTITLE1
svgGroup.Add(PageItemToSvgText(pageItem, title));
return;
if (match == "{COVERTITLE2}") return plstr; // this would have been done in COVERTITLE1
plstr = plstr.Replace(match, title);
//svgGroup.Add(PageItemToSvgText(pageItem, title));
return plstr;
}
// Otherwise determine how many line to split the text into
List<string> titleLines = SplitText(title, (int)len);
if (match == "{COVERTITLE1}")
{
svgGroup.Add(PageItemToSvgText(pageItem, titleLines[0]));
return;
plstr = plstr.Replace(match, titleLines[0]);
//svgGroup.Add(PageItemToSvgText(pageItem, titleLines[0]));
return plstr;
}
// if the token was proctitle, dont' adjust. If the token was PROCTITLE1/2 then
// move down 6.
@ -780,6 +810,7 @@ namespace Volian.Print.Library
svgGroup.Add(PageItemToSvgText(pageItem, line, yOffset));
yOffset += 12;
}
return plstr;
}
private List<string> SplitText(string text, int len)
{

View File

@ -34,7 +34,7 @@ namespace Volian.Print.Library
MyContentByte = cb;
System.Drawing.Color push = PrintOverride.SvgColor;
PrintOverride.SvgColor = PrintOverride.TextColor == System.Drawing.Color.Empty ? System.Drawing.Color.Black : PrintOverride.TextColor;
if (MyPageHelper != null && MyPageHelper.MySvg != null)
if (MyPageHelper != null && MyPageHelper.MySvg != null && MacroDef != null)
{
// PageList items are located with respect to the left margin, macros are not.
MyPageHelper.MySvg.DrawMacro(MacroDef, XOffset - MyPageHelper.MySvg.LeftMargin, yLocation, cb);

View File

@ -919,6 +919,13 @@ namespace Volian.Print.Library
if (itemInfo.MyHeader != null && itemInfo.MyHeader.Text != null && !doSectTab)
yoff += SetHeader(this, cb, itemInfo, formatInfo);
YOffset = yoff;
if (mytab != null && mytab.SeparateBullet)
{
string identB = formatInfo.PlantFormat.FormatData.SectData.StepSectionData.IdentB;
vlnText myBullet = new vlnText(cb, this, identB, identB, XOffset - 12, YOffset, MyItemInfo.FormatStepData.TabData.Bullet.Font);
myBullet.Rtf = myBullet.Rtf.Replace("\u25CF", @"\f1\u9679?\f0 ");
PartsLeft.Add(myBullet);
}
if (itemInfo.IsRNOPart)
{
// there may be other places that double space, but this supports it for RNOs (the DoubleRNOspace flag)
@ -1005,7 +1012,10 @@ namespace Volian.Print.Library
CheckOff co = itemInfo.GetCheckOffStep();
if (co != null)
{
float xloc_co = (float)formatInfo.PlantFormat.FormatData.ProcData.CheckOffData.XLocation + (float)itemInfo.MyDocStyle.Layout.LeftMargin;
//float xloc_co = (float)formatInfo.PlantFormat.FormatData.ProcData.CheckOffData.XLocation + (float)itemInfo.MyDocStyle.Layout.LeftMargin;
float xloc_co = (float)itemInfo.MyDocStyle.Layout.LeftMargin;
if (formatInfo.PlantFormat.FormatData.ProcData.CheckOffData.XLocation != null)
xloc_co += (float)formatInfo.PlantFormat.FormatData.ProcData.CheckOffData.XLocation;
PartsRight.Add(new vlnMacro(xloc_co, yForCheckoff, co.Macro));
}
float yOffRight = yoff;
@ -1493,10 +1503,15 @@ namespace Volian.Print.Library
//if (myTab != null) myTab.XOffset += xoff;
//xoff = MyParent.XOffset - myTab.XOffset;
//XOffset += xoff;
float tabOffset = (myTab == null?0: myTab.XOffset) - XOffset;
XOffset = (float)colOvrd;
if (myTab != null)
{
myTab.XOffset += (MyParent.XOffset - myTab.XOffset);
//myTab.XOffset += (MyParent.XOffset - myTab.XOffset);
myTab.XOffset = XOffset + tabOffset;
//if (myTab.ScriptCaution)
// myTab.XOffset += 10.8F;
//myTab.XOffset += xoff;
}
return;
@ -1642,30 +1657,34 @@ namespace Volian.Print.Library
float CheckOffAdj = 0;
if (itemInfo.MyDocStyle.UseCheckOffs)
{
CheckOffAdj = -(float)formatInfo.PlantFormat.FormatData.ProcData.CheckOffData.CheckOffAdjustment;
if (!HasCheckOffHeading(itemInfo, formatInfo))
if (formatInfo.PlantFormat.FormatData.ProcData.CheckOffData.CheckOffAdjustment != null)
CheckOffAdj = -(float)formatInfo.PlantFormat.FormatData.ProcData.CheckOffData.CheckOffAdjustment;
if (!HasCheckOffHeading(itemInfo, formatInfo) && CheckOffAdj < 0)
CheckOffAdj += (float)(9 * 7.2); // 9 is the size of the SIGNOFF adjustment
}
float adjwidth = CheckOffAdj;
SectData sd = formatInfo.PlantFormat.FormatData.SectData;
if (sd.StepSectionData.StepSectionLayoutData.TieTabToLevel && sd.UseMetaSections)
if (sd.UseMetaSections)
{
if (itemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ShowSectionTitles
&& !itemInfo.MyDocStyle.CancelSectTitle
&& !(itemInfo.MyDocStyle.SpecialStepsFoldout && itemInfo.MyDocStyle.UseColSByLevel))
if (sd.StepSectionData.StepSectionLayoutData.TieTabToLevel)
{
int indxLevel = itemInfo.PrintLevel + itemInfo.CurrentSectionLevel();
adjwidth += formatInfo.PlantFormat.FormatData.SectData.MetaSectionList[indxLevel % formatInfo.PlantFormat.FormatData.SectData.MetaSectionList.Count].WidSAdjByLevel ?? 0; ;
float colsbylevel = (float)formatInfo.PlantFormat.FormatData.SectData.MetaSectionList[indxLevel % formatInfo.PlantFormat.FormatData.SectData.MetaSectionList.Count].ColSByLevel;
float seclvlindent = colsbylevel - (float)formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ColS;
adjwidth -= seclvlindent;
adjwidth -= AdjustForSectionLevelTab();
if (itemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ShowSectionTitles
&& !itemInfo.MyDocStyle.CancelSectTitle
&& !(itemInfo.MyDocStyle.SpecialStepsFoldout && itemInfo.MyDocStyle.UseColSByLevel))
{
int indxLevel = itemInfo.PrintLevel + itemInfo.CurrentSectionLevel();
adjwidth += formatInfo.PlantFormat.FormatData.SectData.MetaSectionList[indxLevel % formatInfo.PlantFormat.FormatData.SectData.MetaSectionList.Count].WidSAdjByLevel ?? 0; ;
float colsbylevel = (float)formatInfo.PlantFormat.FormatData.SectData.MetaSectionList[indxLevel % formatInfo.PlantFormat.FormatData.SectData.MetaSectionList.Count].ColSByLevel;
float seclvlindent = colsbylevel - (float)formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ColS;
adjwidth -= seclvlindent;
adjwidth -= AdjustForSectionLevelTab();
}
}
else
{
if (formatInfo.PlantFormat.FormatData.SectData.MetaSectionList.Count > 0)
adjwidth += (float)formatInfo.PlantFormat.FormatData.SectData.MetaSectionList[itemInfo.PrintLevel % formatInfo.PlantFormat.FormatData.SectData.MetaSectionList.Count].ColSByLevel;
}
}
else
{
if (formatInfo.PlantFormat.FormatData.SectData.MetaSectionList.Count > 0)
adjwidth += (float)formatInfo.PlantFormat.FormatData.SectData.MetaSectionList[itemInfo.PrintLevel % formatInfo.PlantFormat.FormatData.SectData.MetaSectionList.Count].ColSByLevel;
}
Width = ToInt(formatInfo.MyStepSectionLayoutData.WidSTablePrint, maxRNO);

View File

@ -96,8 +96,23 @@ namespace Volian.Print.Library
//float w = iFont.BaseFont.GetWidthPointKerned(Text.Replace("\u25CF","@"), (float)vefont.Size);
return w;
}
bool _ScriptCaution = false;
public bool ScriptCaution
{
get { return _ScriptCaution; }
set { _ScriptCaution = value; }
}
bool _SeparateBullet = false;
public bool SeparateBullet
{
get { return _SeparateBullet; }
set { _SeparateBullet = value; }
}
public vlnTab(PdfContentByte cb, vlnParagraph myparent, string origTab, string cleanTab, float xoffset, float yoffset, VE_Font vFont, bool doSectTab, string symblFontName)
{
ScriptCaution = (origTab.Contains("Caution") && vFont.Family == "VolianScript");
MyContentByte = cb;
MyParent = myparent;
YOffset = yoffset;
@ -105,10 +120,20 @@ namespace Volian.Print.Library
MyFont = vFont;
float CCCs = GetTextWidth(MyFont, "CCCCCCCCCC", symblFontName);
float IIIs = GetTextWidth(MyFont, "iiiiiiiiii", symblFontName);
if (CCCs != IIIs)
if (ScriptCaution)
{
Text = origTab.Replace("Caution ", "\uF043\uF061\uF069\uF06E\uF06F\uF074\uF075\uF020\uF020");
Width = 90;
}
else if ((myparent.MyItemInfo.FormatStepData.TabData.IdentWidth ?? 0) > 0)
Width = (float)myparent.MyItemInfo.FormatStepData.TabData.IdentWidth;
else if (CCCs != IIIs)
Width = Text.Length * 6; //proportial font (7 chars * 6)
else
Width = GetTextWidth(MyFont, (Text != null ? Text : origTab), symblFontName);//MyFont.CharsToTwips * (Text != null ? Text.Length : origTab.Length);
if (myparent.MyItemInfo.FormatStepData.TabData.Bullet.Separate)
if (myparent.MyItemInfo.MyPrevious != null || myparent.MyItemInfo.NextItem != null)
SeparateBullet = true;
//if (MyParent.MyItemInfo.ItemID == 108)//120)
// Console.WriteLine("here");
if (origTab.Contains(@"{!"))
@ -128,28 +153,52 @@ namespace Volian.Print.Library
Width = GetTextWidth(MyFont, (cleanTab != null ? cleanTab : origTab), symblFontName);//MyFont.CharsToTwips * (cleanTab != null ? cleanTab.Length : origTab.Length);
}
Rtf = GetRtf(origTab, vFont);
if (Rtf.Contains("Caution") && vFont.Family == "VolianScript")
Rtf = Rtf.Replace("\u0394", @"\f1\u916?\f0 "); // delta 0x0394
if (ScriptCaution)
{
Rtf = GetRtf("\u25CFCaution ", vFont);
Rtf = Rtf.Replace("\u25CF", @"\f1\fs20 \u9679?\f0\par\f0\fs64 "); // bullet 25CF // jsj- force bullet size (is different than tab text)
if (myparent.MyItemInfo.FormatStepData != null && !myparent.MyItemInfo.FormatStepData.AlwaysTab && myparent.MyItemInfo.MyPrevious != null)
Rtf = Rtf.Replace("Caution ", @"\u61472?\u61472?\u61472?\u61472?\u61472?\u61472?\u61472?\u61472?\u61472?");
else
{
if (myparent.MyItemInfo.FormatStepData != null && !myparent.MyItemInfo.FormatStepData.AlwaysTab && myparent.MyItemInfo.NextItem == null)
Rtf = Rtf.Replace(@"\u9679?", "");
Rtf = Rtf.Replace("Caution ", @"\u61507?\u61537?\u61557?\u61556?\u61545?\u61551?\u61550?\u61472?\u61472?");
}
}
else
{
if (SeparateBullet)
Rtf = Rtf.Replace("\u25CF", "");
else
Rtf = Rtf.Replace("\u25CF", @"\f1\u9679?\f0 "); // bullet 25CF // jsj- add space after \f0
//Rtf = Rtf.Replace("\u25CF", @"\f1\fs18\b0\i0 \u9679?\f0 "); // bullet 25CF // jsj- add space after \f0
if (myparent.MyItemInfo.FormatStepData != null && !myparent.MyItemInfo.FormatStepData.AlwaysTab && myparent.MyItemInfo.MyPrevious != null)
{
//if (scriptCaution)
// Rtf = Rtf.Replace("CAUTION ", @"\u61472?\u61472?\u61472?\u61472?\u61472?\u61472?\u61472?\u61472?\u61472?");
Rtf = Rtf.Replace("Caution:", " ");
Rtf = Rtf.Replace("Note:", " ");
Rtf = Rtf.Replace("CAUTION:", " ");
Rtf = Rtf.Replace("NOTE:", " ");
Rtf = Rtf.Replace("Caution", " ");
Rtf = Rtf.Replace("Note", " ");
Rtf = Rtf.Replace("CAUTION", " ");
Rtf = Rtf.Replace("NOTE", " ");
}
}
if (ScriptCaution && Rtf.Contains("Caution"))
{
// NSP script caution
iTextSharp.text.Font myfont = pdf.GetFont(vFont.Family, 24, 0, iTextSharp.text.Color.BLACK);
if (myfont.BaseFont.CharExists(0x43)) // Capital 'C' exists as text
Rtf = Rtf; // no change necessary
else // Capital 'C' exists as Symbol
//Rtf = Rtf.Replace("Caution", @"\u61507?\u61537?\u61557?\u61556?\u61545?\u61551?\u61550?");
Rtf = Rtf.Replace("Caution", @"\u61507?a\u61557?t\u61545?o\u61550?");
}
Rtf = Rtf.Replace("\u25CF", @"\f1\u9679?\f0 "); // bullet 25CF // jsj- add space after \f0
Rtf = Rtf.Replace("\u0394", @"\f1\u916?\f0 "); // delta 0x0394
if (myparent.MyItemInfo.FormatStepData != null && !myparent.MyItemInfo.FormatStepData.AlwaysTab && myparent.MyItemInfo.MyPrevious != null)
{
Rtf = Rtf.Replace("Caution:", " ");
Rtf = Rtf.Replace("Note:", " ");
Rtf = Rtf.Replace("CAUTION:", " ");
Rtf = Rtf.Replace("NOTE:", " ");
Rtf = Rtf.Replace("Caution", " ");
Rtf = Rtf.Replace("Note", " ");
Rtf = Rtf.Replace("CAUTION", " ");
Rtf = Rtf.Replace("NOTE", " ");
iTextSharp.text.Font myfont = pdf.GetFont(vFont.Family, 28, 0, iTextSharp.text.Color.BLACK);
if (!myfont.BaseFont.CharExists(0x43)) // Capital 'C' exists as text
{
//VE_Font vf = new VE_Font("VolianScript", 28, E_Style.Italics, 12);
// Capital 'C' exists as Symbol
Rtf = Rtf.Replace("Caution ", @"\u61507?\u61537?\u61557?\u61556?\u61545?\u61551?\u61550?\u61472?\u61472?");
}
}

View File

@ -42,8 +42,11 @@ namespace Volian.Print.Library
}
public override float ToPdf(PdfContentByte cb, float yPageStart, float yTopMargin, float yBottomMargin)
{
// The END message was not printing for NSP. The yLocation was getting set to a negative number, thus printing off the page.
// Found that the YOffset, cacluated when the bottom message was created, is really the actual location, at least in this case.
float yLocation = CalculateYOffset(yPageStart, yTopMargin);
Rtf2Pdf.TextAt(cb, IParagraph, XOffset, YOffset, Width, 100, "", yBottomMargin);
if (yLocation < 0) yLocation = YOffset;
Rtf2Pdf.TextAt(cb, IParagraph, XOffset, yLocation, Width, 100, "", yBottomMargin);
return yPageStart;
}
}