This commit is contained in:
parent
30c1bcbdfb
commit
1063d6592d
@ -21,11 +21,11 @@ namespace Volian.Print.Library
|
|||||||
get { return _ParaBreaks; }
|
get { return _ParaBreaks; }
|
||||||
set { _ParaBreaks = value; }
|
set { _ParaBreaks = value; }
|
||||||
}
|
}
|
||||||
private VlnDestinations _VlnDestinations = new VlnDestinations();
|
private PageBookmarks _PageBookmarks = new PageBookmarks();
|
||||||
public VlnDestinations VlnDestinations
|
public PageBookmarks PageBookmarks
|
||||||
{
|
{
|
||||||
get { return _VlnDestinations; }
|
get { return _PageBookmarks; }
|
||||||
set { _VlnDestinations = value; }
|
set { _PageBookmarks = value; }
|
||||||
}
|
}
|
||||||
private PdfOutline _MyPdfOutline = null;
|
private PdfOutline _MyPdfOutline = null;
|
||||||
public PdfOutline MyPdfOutline
|
public PdfOutline MyPdfOutline
|
||||||
@ -134,24 +134,25 @@ namespace Volian.Print.Library
|
|||||||
}
|
}
|
||||||
Layout layout = MySection.MyDocStyle.Layout;
|
Layout layout = MySection.MyDocStyle.Layout;
|
||||||
cb.Rectangle((float)layout.LeftMargin, (float)(cb.PdfWriter.PageSize.Height - layout.TopMargin), (float)layout.PageWidth - (float)layout.LeftMargin, (float)-layout.PageLength);
|
cb.Rectangle((float)layout.LeftMargin, (float)(cb.PdfWriter.PageSize.Height - layout.TopMargin), (float)layout.PageWidth - (float)layout.LeftMargin, (float)-layout.PageLength);
|
||||||
cb.MoveTo(0, 504);
|
float yRuler = 612;
|
||||||
cb.LineTo(612, 504);
|
cb.MoveTo(0, yRuler);
|
||||||
|
cb.LineTo(612, yRuler);
|
||||||
for (float x1 = 0; x1 < 612; x1 += 6) // tic marks every 1/8 inch
|
for (float x1 = 0; x1 < 612; x1 += 6) // tic marks every 1/8 inch
|
||||||
{
|
{
|
||||||
if (x1 % 72 == 0)
|
if (x1 % 72 == 0)
|
||||||
{
|
{
|
||||||
cb.MoveTo(x1, 484);
|
cb.MoveTo(x1, yRuler-20);
|
||||||
cb.LineTo(x1, 524);
|
cb.LineTo(x1, yRuler+20);
|
||||||
}
|
}
|
||||||
else if (x1 % 36 == 0)
|
else if (x1 % 36 == 0)
|
||||||
{
|
{
|
||||||
cb.MoveTo(x1, 494);
|
cb.MoveTo(x1, yRuler-10);
|
||||||
cb.LineTo(x1, 514);
|
cb.LineTo(x1, yRuler+10);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
cb.MoveTo(x1, 499);
|
cb.MoveTo(x1, yRuler-5);
|
||||||
cb.LineTo(x1, 509);
|
cb.LineTo(x1, yRuler+5);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//cb.MoveTo(122.4F, 0); //WCN2 HLS
|
//cb.MoveTo(122.4F, 0); //WCN2 HLS
|
||||||
@ -168,20 +169,17 @@ namespace Volian.Print.Library
|
|||||||
}
|
}
|
||||||
private void AddBookmarks(PdfWriter writer)
|
private void AddBookmarks(PdfWriter writer)
|
||||||
{
|
{
|
||||||
if (MySectionTitle != null)
|
foreach (PageBookmark pb in PageBookmarks)
|
||||||
{
|
{
|
||||||
PdfDestination dest = new PdfDestination(PdfDestination.FIT);
|
if (!pb.MyItemInfo.IsSection && MyPdfOutline != null)
|
||||||
MyPdfOutline = new PdfOutline(writer.DirectContent.RootOutline, dest, MySectionTitle, false);
|
new PdfOutline(MyPdfOutline, pb.PdfDestination, pb.Title, false);
|
||||||
MySectionTitle = null;
|
else
|
||||||
}
|
|
||||||
if (VlnDestinations.Count > 0 && MyPdfOutline != null)
|
|
||||||
{
|
|
||||||
foreach (VlnDestination vd in VlnDestinations)
|
|
||||||
{
|
{
|
||||||
new PdfOutline(MyPdfOutline, vd.PdfDestination, vd.Title, false);
|
PdfDestination dest = new PdfDestination(PdfDestination.FIT);
|
||||||
|
MyPdfOutline = new PdfOutline(writer.DirectContent.RootOutline, dest, pb.Title, false);
|
||||||
}
|
}
|
||||||
VlnDestinations.Clear();
|
|
||||||
}
|
}
|
||||||
|
PageBookmarks.Clear();
|
||||||
}
|
}
|
||||||
private void DrawMessages(PdfContentByte cb)
|
private void DrawMessages(PdfContentByte cb)
|
||||||
{
|
{
|
||||||
@ -545,7 +543,9 @@ namespace Volian.Print.Library
|
|||||||
case "{PROCTITLE}":
|
case "{PROCTITLE}":
|
||||||
case "{PROCTITLE1}":
|
case "{PROCTITLE1}":
|
||||||
case "{PROCTITLE2}":
|
case "{PROCTITLE2}":
|
||||||
SplitTitle(svgGroup, pageItem, section.MyProcedure.MyContent.Text, (int)section.ActiveFormat.PlantFormat.FormatData.ProcData.TitleLength, token);
|
float linelen = (int)section.ActiveFormat.PlantFormat.FormatData.ProcData.TitleLength * (float)pageItem.Font.CPI / 12;
|
||||||
|
SplitTitle(svgGroup, pageItem, section.MyProcedure.MyContent.Text, (int)linelen, token);
|
||||||
|
//SplitTitle(svgGroup, pageItem, section.MyProcedure.MyContent.Text, (int)section.ActiveFormat.PlantFormat.FormatData.ProcData.TitleLength, token);
|
||||||
break;
|
break;
|
||||||
case "{EOPNUM}":
|
case "{EOPNUM}":
|
||||||
svgGroup.Add(PageItemToSvgText(pageItem, pageItem.Token.Replace(token, section.MyProcedure.MyContent.Number)));
|
svgGroup.Add(PageItemToSvgText(pageItem, pageItem.Token.Replace(token, section.MyProcedure.MyContent.Number)));
|
||||||
@ -614,8 +614,11 @@ namespace Volian.Print.Library
|
|||||||
}
|
}
|
||||||
// Otherwise determine how many line to split the text into
|
// Otherwise determine how many line to split the text into
|
||||||
List<string> titleLines = SplitText(title, (int)len);
|
List<string> titleLines = SplitText(title, (int)len);
|
||||||
// Move up 6 Points per line to find the starting point
|
|
||||||
float yOffset = -6 * (titleLines.Count - 1);
|
// if the token was proctitle, dont' adjust. If the token was PROCTITLE1/2 then
|
||||||
|
// move down 6.
|
||||||
|
int adj = pageItem.Token.Contains("1") || pageItem.Token.Contains("2") ? 0 : -6;
|
||||||
|
float yOffset = adj * (titleLines.Count - 1);
|
||||||
foreach (string line in titleLines)
|
foreach (string line in titleLines)
|
||||||
{
|
{
|
||||||
svgGroup.Add(PageItemToSvgText(pageItem, line, yOffset));
|
svgGroup.Add(PageItemToSvgText(pageItem, line, yOffset));
|
||||||
@ -681,7 +684,7 @@ namespace Volian.Print.Library
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if (width > 0) results.Add(nextprefix+text.Substring(start));
|
if (width > 0 || start < text.Length) results.Add(nextprefix + text.Substring(start));
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -786,18 +789,25 @@ namespace Volian.Print.Library
|
|||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public class VlnDestinations : List<VlnDestination>
|
public class PageBookmarks : List<PageBookmark>
|
||||||
{
|
{
|
||||||
public VlnDestinations() : base()
|
public PageBookmarks()
|
||||||
|
: base()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
public void Add(string title, PdfDestination pdfDestination)
|
public void Add(ItemInfo itemInfo, string title, PdfDestination pdfDestination)
|
||||||
{
|
{
|
||||||
Add(new VlnDestination(title, pdfDestination));
|
Add(new PageBookmark(itemInfo, title, pdfDestination));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public class VlnDestination
|
public class PageBookmark
|
||||||
{
|
{
|
||||||
|
private ItemInfo _MyItemInfo;
|
||||||
|
public ItemInfo MyItemInfo
|
||||||
|
{
|
||||||
|
get { return _MyItemInfo; }
|
||||||
|
set { _MyItemInfo = value; }
|
||||||
|
}
|
||||||
private string _Title;
|
private string _Title;
|
||||||
public string Title
|
public string Title
|
||||||
{
|
{
|
||||||
@ -810,8 +820,9 @@ namespace Volian.Print.Library
|
|||||||
get { return _PdfDestination; }
|
get { return _PdfDestination; }
|
||||||
set { _PdfDestination = value; }
|
set { _PdfDestination = value; }
|
||||||
}
|
}
|
||||||
public VlnDestination(string title, PdfDestination pdfDestination)
|
public PageBookmark(ItemInfo itemInfo, string title, PdfDestination pdfDestination)
|
||||||
{
|
{
|
||||||
|
_MyItemInfo = itemInfo;
|
||||||
_Title = title;
|
_Title = title;
|
||||||
_PdfDestination = pdfDestination;
|
_PdfDestination = pdfDestination;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user