B2019-102 Fix PDF Links for Word Sections

STP EOP E-0
This commit is contained in:
Rich 2019-08-06 21:02:40 +00:00
parent 20b41ec7c8
commit d7ed3062a8

View File

@ -743,7 +743,7 @@ namespace Volian.Print.Library
get { return _AllowAllWatermarks; }
set { _AllowAllWatermarks = value; }
}
private PdfReader readerWord;
//private PdfReader readerWord;
private string PrintProcedureOrFoldout(ProcedureInfo myProcedure, SectionInfo myFoldoutSection, string outputFileName, bool makePlacekeeper, bool makeContinuousActionSummary)
{
int profileDepth = ProfileTimer.Push(">>>> PrintProcedureOrFoldout");
@ -1165,6 +1165,26 @@ namespace Volian.Print.Library
// C2018-004 create meta file for baseline compares
Volian.Base.Library.BaselineMetaFile.WriteLine("WD Height={0} Width={1} scPgCnt={2} locEnd={3} pdfSz={4} xOff={5} yOff={6} ScPgNum {7}", fgPage.Height, fgPage.Width, sectPageCount, locEndOfWordDoc, pdfSize, (float)(mySection.MyDocStyle.Layout.MSWordXAdj ?? 0.0), (float)(mySection.MyDocStyle.Layout.MSWordYAdj ?? 0.0) + yoff, pageNumber);
AddImportedPageToLayer(cb.PdfWriter.DirectContent, _MSWordLayer, fgPage, (float)(mySection.MyDocStyle.Layout.MSWordXAdj ?? 0), (float)(mySection.MyDocStyle.Layout.MSWordYAdj ?? 0) + yoff);
// B2019-102 Handle PDF Destinations for Word Sections
if (ii == 0 && _MyHelper.MyPromsPrinter.SaveLinks)
{
ColumnText ct = new ColumnText(cb);
iTextSharp.text.Font font = FontFactory.GetFont("Arial", BaseFont.IDENTITY_H, BaseFont.EMBEDDED, 12, iTextSharp.text.Font.NORMAL, new iTextSharp.text.Color(PrintOverride.TextColor));
Chunk chk = new Chunk(mySection.DisplayNumber, font);
chk.SetLocalDestination(string.Format("ItemID={0}", mySection.ItemID));
//Console.WriteLine("++++ ItemID={0}", mySection.ItemID);
//float x1 = cb.PdfDocument.PageSize.Width / 2;
//float y1 = cb.PdfDocument.PageSize.Height ; // 1.8f;
float height = 12 * 1.5F;
// B2019-102 Locate the chunk below the bottom of the page
ct.SetSimpleColumn(0, -height, chk.GetWidthPoint() * 1.01F, -2*height );
ct.AddElement(new Phrase(chk));
cb.SetColorFill(new iTextSharp.text.Color(PrintOverride.TextColor));
int status = ct.Go();
if(status > 1)
_MyLog.WarnFormat("\r\n.-.-.-. Failed to add a PDF destination for {0}", mySection.ShortPath);
}
if(DebugPagination.IsOpen) DebugPagination.WriteLine("{0:D6},'{1}',{2}",
_MyHelper.MyPdfContentByte.PdfWriter.CurrentPageNumber, mySection.ShortPath,pageNumber);
}