This example shows how to flow text to multiple pages using a Text Area Page Element:
[ASP - VBScript]
<!-- METADATA TYPE="typelib" UUID="{DF9225FE-94A4-490D-8CAD-E8366CE621D3}"-->
<%
' Create a document.
Dim MyDocument
Set MyDocument = Server.CreateObject( "DynamicPDF.Document" )
' Make a large text string.
Dim MyText
MyText = "This is a test of the overflow text functionality."
MyText = MyText & MyText
MyText = MyText & MyText
MyText = MyText & MyText
MyText = MyText & MyText
MyText = MyText & MyText ' Adds pages until all text is displayed.
Dim MyPage
Dim MyTextArea
Dim MyOverflowTextArea
Set MyPage = MyDocument.AddPage()
Set MyTextArea = MyPage.AddTextArea( MyText, 0, 0, 200, 200 )
Do
Set MyOverflowTextArea = MyTextArea.GetOverflowTextArea( 0, 0 )
If Not( MyOverflowTextArea is Nothing ) Then
Set MyPage = MyDocument.AddPage()
Set MyTextArea = MyPage.AddOverflowTextArea( MyOverflowTextArea )
End if
Loop While Not ( MyOverflowTextArea is Nothing )
' Output the PDF.
MyDocument.DrawToWeb
Set MyPage = Nothing
Set MyDocument = Nothing
%>
The GetOverFlowTextArea (or GetOverFlowFormattedTextArea) method can be used to create a new TextArea (or FormattedTextArea) containing the overflow text. This object can then be placed in a different location on the same page or on the next page using AddOverflowTextArea method. If there is no overflow text the GetOverflowTextArea (or GetOverFlowFormattedTextArea) method will return a null value. This makes it possible to place this object in a while loop until a null value is returned.
The RequiredHeight method can be used to get the height required to place all text in the TextArea (or FormattedTextArea) on the page.
| See Also |
FormattedTextArea Class | TextArea Class
Generator: Programming with Generator for COM-ActiveX

