If the current section is a foldout, then make the Link a remote link since the rest of the procedure is not part of the foldout page.

Import Links from the Foldout PDF.
This commit is contained in:
Rich 2016-02-25 19:46:34 +00:00
parent c7c8d7f4ec
commit f1f71e06bf
2 changed files with 15 additions and 3 deletions

View File

@ -324,7 +324,7 @@ namespace Volian.Print.Library
DateTime tStart = DateTime.Now;
string MSWordFile = null;
if (section.MyContent.ContentEntryCount == 1)
{
{
MSWordToPDF.DocReplace = DocReplace;
MSWordFile = MSWordToPDF.GetDocPdf(section, PrintOverride.TextColor);
MSWordToPDF.DocReplace = null;
@ -1511,6 +1511,11 @@ namespace Volian.Print.Library
//pt.Description = "vlnParagrph";
vlnParagraph myParagraph = new vlnParagraph(null, cb, myItemInfo, (float)myItemInfo.MyDocStyle.Layout.LeftMargin, _NoBreakYOffset, 0, myItemInfo.ColumnMode, myItemInfo.ActiveFormat, null, null, 0,true,this);
//pt.Description = "After vlnParagrph";
//if (myParagraph.MyItemInfo.InList(15906))
//{
// CPSGen myGen = new CPSGen(myParagraph);
// myGen.Generate("TestCPSGEN.xml");
//}
float localYPageStart = 0;
float yPageStart = yTopMargin;
if (myItemInfo.HasChildren || myItemInfo.MyDocVersion.DocVersionConfig.SelectedSlave > 0 || (myItemInfo.ActiveFormat.PlantFormat.FormatData.Express && myItemInfo.MyDocStyle.OptionalSectionContent))
@ -1615,6 +1620,12 @@ namespace Volian.Print.Library
if (doimport2)
{// put the saved foldout page into the PDF
AddImportedPageToLayer(cb.PdfWriter.DirectContent, textLayer, fgPage, 0, 0);
foreach (iTextSharp.text.pdf.PdfAnnotation.PdfImportedLink il in _MyFoldoutReader[foldoutindx].GetLinks(1))
{
if(!il.IsInternal() )
cb.PdfWriter.AddAnnotation(il.CreateAnnotation(cb.PdfWriter));
}
if (DebugPagination.IsOpen) DebugPagination.WriteLine("{0:D6},'{1}',{2}",
myPageHelper.MyPdfContentByte.PdfWriter.CurrentPageNumber, "Foldout", 1);
}
@ -1773,7 +1784,7 @@ namespace Volian.Print.Library
catch (Exception ex)
{
if (_MyPromsPrinter.DocReplace == null)
MessageBox.Show(ex.Message, ex.GetType().FullName, MessageBoxButtons.OK, MessageBoxIcon.Error);
MessageBox.Show(ex.Message, ex.GetType().FullName, MessageBoxButtons.OK, MessageBoxIcon.Error);
_MyLog.Warn(string.Format("Error in LoadSectionTree [{0}],{1}.{2}", si.ItemID, si.DisplayNumber, si.DisplayText), ex);
}
}

View File

@ -954,7 +954,8 @@ namespace Volian.Print.Library
{
TransitionInfo ti = MyItemInfo.MyContent.ContentTransitions[0];
ItemInfo tiDefault = GetDefaultItemInfo(ti.MyItemToID);
if (ti.MyItemToID.MyProcedure.ItemID == MyItemInfo.MyProcedure.ItemID)
if (ti.MyItemToID.MyProcedure.ItemID == MyItemInfo.MyProcedure.ItemID &&
! MyItemInfo.ActiveSection.DisplayNumber.ToUpper().StartsWith("FOLDOUT"))
{ // Local Go To
if (ti.MyItemToID.MyContent.Type > 19999)
foreach (Chunk chk in IParagraph.Chunks)