Added Enhanced Document Menus

SetAdministrator Support for Import and Export Procedure Sets, Import Procedure, Export Procedure
Added ROID PDF Destinations to Complete RO Report so that PDF Links can go to a specific Refenced Object in the Complete RO Report PDF.
Add PDF Links for Enhanced Documents and Complete RO Report
This commit is contained in:
Rich
2015-09-12 15:49:37 +00:00
parent a87decdbe3
commit 4c0fed9dce
4 changed files with 192 additions and 8 deletions

View File

@@ -375,6 +375,12 @@ namespace Volian.Print.Library
}
private string processingRO = "";
private string _MyROID = null;
public string MyROID
{
get { return _MyROID; }
set { _MyROID = value; }
}
public void PrintReport()
{
@@ -416,6 +422,9 @@ namespace Volian.Print.Library
case 7:
processingRO = KeyField();
break;
case 8:
MyROID = ROIDField();
break;
case 100: // Text Field - sometimes also XY Plot
Text();
Application.DoEvents();
@@ -825,6 +834,12 @@ namespace Volian.Print.Library
Chunk chk = LastHeader();
Phrase p = new Phrase();
PdfPCell cell = new PdfPCell();
if (MyROID != null)
{
chk.SetLocalDestination(string.Format("ROID={0}", MyROID)); // Destination
//Console.WriteLine("\"ROID\"\t\"{0}\"", MyROID);
MyROID = null;
}
p.Add(chk); // add the header chunk
cell.BackgroundColor = Color.WHITE;
cell.BorderColor = Color.WHITE;
@@ -880,6 +895,18 @@ namespace Volian.Print.Library
//Console.WriteLine("Key Text: {0}", szStr);
//Console.WriteLine("----------------------------------------------");
}
public string ROIDField()
{
// use the key field as the PDF bookbark
string szStr = RO_df.ReadText();
//PdfDestination pdfDest = new PdfDestination(PdfDestination.FITH, _MyPDFWriter.DirectContent.PdfDocument.PageSize.Height);
//PdfOutline outl = new PdfOutline(MyDocOutline[Hdrs.HdrCnt - 1].MyOutline, MyPdfDestTop, szStr);
//DestSample(outl);
return szStr;
//Console.WriteLine("Key Field");
//Console.WriteLine("Key Text: {0}", szStr);
//Console.WriteLine("----------------------------------------------");
}
// Read in the image filename, height, and width
public void ImageFile()

View File

@@ -943,14 +943,28 @@ namespace Volian.Print.Library
}
}
else // Remote Go To
{
foreach (Chunk chk in IParagraph.Chunks)
{
//Console.WriteLine("\"RemoteGoTo\"\t{0}", tiDefault.ItemID);
chk.SetRemoteGoto(ti.MyItemToID.MyProcedure.DisplayNumber.Replace("/", "_") + ".pdf", string.Format("ItemID={0}", tiDefault.ItemID));
chk.SetBackground(new Color(System.Drawing.Color.PeachPuff));
}
}
}
// MyPageHelper.BottomContent = yLocation - Height;
if (MyItemInfo.MyContent.ContentRoUsageCount > 0)
{
RoUsageInfo ru = MyItemInfo.MyContent.ContentRoUsages[0];
foreach (Chunk chk in IParagraph.Chunks)
{
chk.SetRemoteGoto("completeroreport.pdf", string.Format("ROID={0}", ru.ROID.Substring(0, 12)));
chk.SetBackground(new Color(System.Drawing.Color.LightGreen));
}
}
StepConfig sc = new StepConfig(MyItemInfo.MyContent.Config);
AddLinkToEnhancedDocument(cb, yLocation, sc.Step_SourceToBackground, "B", 6);
AddLinkToEnhancedDocument(cb, yLocation, sc.Step_SourceToDeviation, "D", 20);
// MyPageHelper.BottomContent = yLocation - Height;
//if (MyItemInfo.InList(39048)) Console.WriteLine("Here");
}
MyPageHelper.BottomContent = yLocation - (Height * MyPageHelper.YMultiplier);
@@ -983,6 +997,31 @@ namespace Volian.Print.Library
}
return retval;
}
private static void AddLinkToEnhancedDocument(PdfContentByte cb, float yLocation, string bdItemID, 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();
//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)
{