Outlines can be included in the PDF document to allow quick access to specific pages in the PDF document. These can be added to the document in one of two ways.
Outlines
Outlines can be added to the document through AddOutline, AddXYOutline, AddZoomOutline and AddUrlOutline Method of the Document object or using the same Methods for Outline, XYOutline, ZoomOutline and UrlOutline object. The Document contains a hierarchical list of outlines to associate with the Document. These outlines have properties for controlling the color and style as well as a property to control if it is expanded by default:
[ASP - VBScript]
<!-- METADATA TYPE="typelib" UUID="{DF9225FE-94A4-490D-8CAD-E8366CE621D3}" -->
<%
' Create a PDF Document
Dim MyDocument
Set MyDocument = Server.CreateObject( "DynamicPDF.Document" )
' Add three blank pages
MyDocument.AddPage()
MyDocument.AddPage()
MyDocument.AddPage()
' Add a top level outline and set properties
Dim MyOutline1
Set MyOutline1 = MyDocument.AddOutline( "Outline1" )
MyOutline1.Style = DPDF_TextStyle_Bold
MyOutline1.Color = "FF0000"
' Add child outlines
Dim MyOutline1A
Set MyOutline1A = MyOutline1.AddZoomOutline( "Outline1A", 2, DPDF_Zoom_FitPage )
MyOutline1A.IsExpanded = False
Dim MyOutline1A1
Set MyOutline1A1 = MyOutline1A.AddXYOutline( "Outline1A1", 2, 0, 0 )
Dim MyOutline1A2
Set MyOutline1A2 = MyOutline1A.AddZoomOutline( "Outline1A2", 2, DPDF_Zoom_FitHeight )
Dim MyOutline1B
Set MyOutline1B = MyOutline1.AddZoomOutline( "Outline1B", 2, DPDF_Zoom_FitWidth )
' Add a second top level outline
Dim MyOutline2
Set MyOutline2 = MyDocument.AddXYOutline( "Outline2", 3, 0, 300 )
' Add a child outline
Dim MyOutline2A
Set MyOutline2A = MyOutline2.AddOutline( "Outline2A" )
' Save the PDF document
MyDocument.DrawToWeb
Set MyDocument = Nothing
%>
The location that the outline links to can be specified using Action objects.
Bookmarks
Outlines can also be added to the document using the Bookmark Page Element. This object can be used to add outlines to the root of the document or to add outlines beneath a parent outline. These bookmarks always link to a coordinate on the page that contains them:
[ASP - VBScript]
<!-- METADATA TYPE="typelib" UUID="{DF9225FE-94A4-490D-8CAD-E8366CE621D3}" -->
<%
Dim MyDocument
Dim MyPage1
Dim MyPage2
Dim MyPage3
Set MyDocument = Server.CreateObject( "DynamicPDF.Document" )
Dim MyTemplate
Set MyTemplate = MyDocument.SetTemplate
Dim MyPageNumberLabel
Set MyPageNumberLabel = MyTemplate.AddPageNumberingLabel( "Page %%CP(i)%% OF %%TP(i)%%", 300, 40, 220, 40 )
Set MyPage1 = MyDocument.AddPage()
Set MyPage2 = MyDocument.AddPage()
Set MyPage3 = MyDocument.AddPage()
Dim MyParentOutline
Set MyParentOutline = MyDocument.AddOutline( "Parent Outline" )
MyPage1.AddBookmark "Top Level BookMark to Page 1", 0, 0
Dim MyChildBookMark1
Dim MyChildBookMark2
Dim MyChildBookMark3
Set MyChildBookMark1 = MyPage1.AddBookMark( "BookMark to Page 1", 0, 0 )
MyChildBookMark1.ParentOutline = MyParentOutline
Set MyChildBookMark2 = MyPage2.AddBookMark( "BookMark to Page 2", 0, 0 )
MyChildBookMark2.ParentOutline = MyParentOutline
Set MyChildBookMark3 = MyPage3.AddBookMark( "BookMark to Page 3", 0, 0 )
MyChildBookMark3.ParentOutline = MyParentOutline
MyDocument.DrawToWeb
Set MyDocument = Nothing
%>
| See Also |
Outline Class | UrlOutline Class | XYOutline Class | ZoomOutline Class | Bookmark Class | UrlLink Class | XYLink Class | ZoomLink Class | Programming with Generator for COM-ActiveX

