New Enhanced Document Properties

Fixed Find and Replace logic to keep it from getting into an infinite loop
Used new CSLA code to hanndle deletion of procedures with external transitions
New Enhanced Document properties
This commit is contained in:
Rich
2015-10-27 13:34:33 +00:00
parent e22458bd1a
commit 58e58083c2
7 changed files with 242 additions and 197 deletions

View File

@@ -962,8 +962,12 @@ namespace Volian.Print.Library
}
}
StepConfig sc = new StepConfig(MyItemInfo.MyContent.Config);
AddLinkToEnhancedDocument(cb, yLocation, sc.Step_SourceToBackground, "B", 6);
AddLinkToEnhancedDocument(cb, yLocation, sc.Step_SourceToDeviation, "D", 20);
DVEnhancedDocuments dveds = MyItemInfo.MyDocVersion.DocVersionConfig.MyEnhancedDocuments;
foreach (EnhancedDocument ed in sc.MyEnhancedDocuments)
{
DVEnhancedDocument dved = dveds[ed.Type];
AddLinkToEnhancedDocument(cb, yLocation, ed.ItemID, dved.PdfToken, dved.PdfX);
}
// MyPageHelper.BottomContent = yLocation - Height;
//if (MyItemInfo.InList(39048)) Console.WriteLine("Here");
}
@@ -997,32 +1001,27 @@ namespace Volian.Print.Library
}
return retval;
}
private static void AddLinkToEnhancedDocument(PdfContentByte cb, float yLocation, string bdItemID, String token, int xLocation)
private static void AddLinkToEnhancedDocument(PdfContentByte cb, float yLocation, int itemID, String token, int xLocation)
{
if (bdItemID != null)
{
int i = int.Parse(bdItemID);
ItemInfo ii = ItemInfo.Get(i);
string prefix = ii.MyDocVersion.DocVersionConfig.Print_PDFFilePrefix ?? "";
string suffix = ii.MyDocVersion.DocVersionConfig.Print_PDFFileSuffix ?? "";
ColumnText ct = new ColumnText(cb);
ct.SetSimpleColumn(xLocation, yLocation - 12, xLocation + 30, 12 + yLocation);
iTextSharp.text.Font font = FontFactory.GetFont("Arial", BaseFont.IDENTITY_H, BaseFont.EMBEDDED, 12);
Chunk chk = new Chunk(token);
chk.SetRemoteGoto(prefix + ii.MyProcedure.DisplayNumber.Replace("/", "_") + suffix + ".pdf", string.Format("ItemID={0}", ii.ItemID));
chk.SetBackground(new Color(System.Drawing.Color.LemonChiffon));
ct.AddElement(chk);
cb.SetColorFill(Color.BLUE);
ct.Go();
ItemInfo ii = ItemInfo.Get(itemID);
string prefix = ii.MyDocVersion.DocVersionConfig.Print_PDFFilePrefix ?? "";
string suffix = ii.MyDocVersion.DocVersionConfig.Print_PDFFileSuffix ?? "";
ColumnText ct = new ColumnText(cb);
ct.SetSimpleColumn(xLocation, yLocation - 12, xLocation + 30, 12 + yLocation);
iTextSharp.text.Font font = FontFactory.GetFont("Arial", BaseFont.IDENTITY_H, BaseFont.EMBEDDED, 12);
Chunk chk = new Chunk(token);
chk.SetRemoteGoto(prefix + ii.MyProcedure.DisplayNumber.Replace("/", "_") + suffix + ".pdf", string.Format("ItemID={0}", itemID));
chk.SetBackground(new Color(System.Drawing.Color.LemonChiffon));
ct.AddElement(chk);
cb.SetColorFill(Color.BLUE);
ct.Go();
//foreach (Chunk chk in IParagraph.Chunks)
//{
// chk.SetRemoteGoto(ii.MyProcedure.DisplayNumber.Replace("/", "_") + ".pdf", string.Format("ItemID={0}",ii.ItemID));
// chk.SetBackground(new Color(System.Drawing.Color.LemonChiffon));
//}
}
//foreach (Chunk chk in IParagraph.Chunks)
//{
// chk.SetRemoteGoto(ii.MyProcedure.DisplayNumber.Replace("/", "_") + ".pdf", string.Format("ItemID={0}",ii.ItemID));
// chk.SetBackground(new Color(System.Drawing.Color.LemonChiffon));
//}
}
private ItemInfo GetDefaultItemInfo(ItemInfo myItemInfo)
{
if (myItemInfo.IsProcedure &&myItemInfo.Sections != null)