This commit is contained in:
parent
30c1bcbdfb
commit
1063d6592d
@ -21,11 +21,11 @@ namespace Volian.Print.Library
|
||||
get { return _ParaBreaks; }
|
||||
set { _ParaBreaks = value; }
|
||||
}
|
||||
private VlnDestinations _VlnDestinations = new VlnDestinations();
|
||||
public VlnDestinations VlnDestinations
|
||||
private PageBookmarks _PageBookmarks = new PageBookmarks();
|
||||
public PageBookmarks PageBookmarks
|
||||
{
|
||||
get { return _VlnDestinations; }
|
||||
set { _VlnDestinations = value; }
|
||||
get { return _PageBookmarks; }
|
||||
set { _PageBookmarks = value; }
|
||||
}
|
||||
private PdfOutline _MyPdfOutline = null;
|
||||
public PdfOutline MyPdfOutline
|
||||
@ -134,24 +134,25 @@ namespace Volian.Print.Library
|
||||
}
|
||||
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.MoveTo(0, 504);
|
||||
cb.LineTo(612, 504);
|
||||
float yRuler = 612;
|
||||
cb.MoveTo(0, yRuler);
|
||||
cb.LineTo(612, yRuler);
|
||||
for (float x1 = 0; x1 < 612; x1 += 6) // tic marks every 1/8 inch
|
||||
{
|
||||
if (x1 % 72 == 0)
|
||||
{
|
||||
cb.MoveTo(x1, 484);
|
||||
cb.LineTo(x1, 524);
|
||||
cb.MoveTo(x1, yRuler-20);
|
||||
cb.LineTo(x1, yRuler+20);
|
||||
}
|
||||
else if (x1 % 36 == 0)
|
||||
{
|
||||
cb.MoveTo(x1, 494);
|
||||
cb.LineTo(x1, 514);
|
||||
cb.MoveTo(x1, yRuler-10);
|
||||
cb.LineTo(x1, yRuler+10);
|
||||
}
|
||||
else
|
||||
{
|
||||
cb.MoveTo(x1, 499);
|
||||
cb.LineTo(x1, 509);
|
||||
cb.MoveTo(x1, yRuler-5);
|
||||
cb.LineTo(x1, yRuler+5);
|
||||
}
|
||||
}
|
||||
//cb.MoveTo(122.4F, 0); //WCN2 HLS
|
||||
@ -168,20 +169,17 @@ namespace Volian.Print.Library
|
||||
}
|
||||
private void AddBookmarks(PdfWriter writer)
|
||||
{
|
||||
if (MySectionTitle != null)
|
||||
foreach (PageBookmark pb in PageBookmarks)
|
||||
{
|
||||
if (!pb.MyItemInfo.IsSection && MyPdfOutline != null)
|
||||
new PdfOutline(MyPdfOutline, pb.PdfDestination, pb.Title, false);
|
||||
else
|
||||
{
|
||||
PdfDestination dest = new PdfDestination(PdfDestination.FIT);
|
||||
MyPdfOutline = new PdfOutline(writer.DirectContent.RootOutline, dest, MySectionTitle, false);
|
||||
MySectionTitle = null;
|
||||
MyPdfOutline = new PdfOutline(writer.DirectContent.RootOutline, dest, pb.Title, false);
|
||||
}
|
||||
if (VlnDestinations.Count > 0 && MyPdfOutline != null)
|
||||
{
|
||||
foreach (VlnDestination vd in VlnDestinations)
|
||||
{
|
||||
new PdfOutline(MyPdfOutline, vd.PdfDestination, vd.Title, false);
|
||||
}
|
||||
VlnDestinations.Clear();
|
||||
}
|
||||
PageBookmarks.Clear();
|
||||
}
|
||||
private void DrawMessages(PdfContentByte cb)
|
||||
{
|
||||
@ -545,7 +543,9 @@ namespace Volian.Print.Library
|
||||
case "{PROCTITLE}":
|
||||
case "{PROCTITLE1}":
|
||||
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;
|
||||
case "{EOPNUM}":
|
||||
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
|
||||
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)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
@ -786,18 +789,25 @@ namespace Volian.Print.Library
|
||||
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;
|
||||
public string Title
|
||||
{
|
||||
@ -810,8 +820,9 @@ namespace Volian.Print.Library
|
||||
get { return _PdfDestination; }
|
||||
set { _PdfDestination = value; }
|
||||
}
|
||||
public VlnDestination(string title, PdfDestination pdfDestination)
|
||||
public PageBookmark(ItemInfo itemInfo, string title, PdfDestination pdfDestination)
|
||||
{
|
||||
_MyItemInfo = itemInfo;
|
||||
_Title = title;
|
||||
_PdfDestination = pdfDestination;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user