Posted by a ceTe Software moderator
Hello,
You can add the overflow contents of the FormattedTextArea to a new page by retrieving the overflow text using GetOverFlowFormattedTextArea() method. You can also get the height required to add the text using GetRequiredHeight() method of FormattedTextArea. Please refer to the documentation on text continuation
here. Here is the ASP/VB Script code sample for adding overflow text to the new position within the same page by calculating the new Y position dynamically.
<!-- METADATA TYPE="typelib" UUID="{DF9225FE-94A4-490D-8CAD-E8366CE621D3}"-->
<%
Dim MyDocument, MyPage, MyFormattedText, MyFormattedTextArea, XPosition, NewYPosition, MyOverFlowFormattedTextArea
'Create Document object and set properties
Set MyDocument = Server.CreateObject( "DynamicPDF.Document" )
MyDocument.Creator = "location.asp"
MyDocument.Author = "ceTe Software"
MyDocument.Title = "Hello World"
'Add a page to the document
Set MyPage = MyDocument.AddPage()
MyFormattedText = "<p>Formatted text area provide rich formatting support for " + _
"text that appears in the document. You have complete control over 8 paragraph " + _
"properties: spacing before, spacing after, first line indentation, left indentation," + _
" right indentation, alignment, allowing orphan lines, and white space preservation; " + _
"6 font properties: <font face='Times'>font face, </font><font " + _
"pointSize='6'>font size, </font><font color='FF0000'>color, " + _
"</font><b>bold, </b><i>italic and </i><u>" + _
"underline</u>; and 2 line properties: leading, and leading type. Text can " + _
"also be rotated.</p><p>Formatted text area provide rich formatting support for " + _
"text that appears in the document. You have complete control over 8 paragraph " + _
"properties: spacing before, spacing after, first line indentation, left indentation," + _
" right indentation, alignment, allowing orphan lines, and white space preservation; " + _
"6 font properties: <font face='Times'>font face, </font><font " + _
"pointSize='6'>font size, </font><font color='FF0000'>color, " + _
"</font><b>bold, </b><i>italic and </i><u>" + _
"underline</u>; and 2 line properties: leading, and leading type. Text can " + _
"also be rotated.</p>"
Set MyFormattedTextArea = MyPage.AddFormattedTextArea(MyFormattedText, 0, 0, 256, 50, DPDF_FontFamily_Helvetica, 12, False)
XPosition = MyFormattedTextArea.X
NewYPosition = MyFormattedTextArea.Y + MyFormattedTextArea.Height + 10
Set MyOverFlowFormattedTextArea = MyFormattedTextArea.GetOverFlowFormattedTextArea(XPosition, NewYPosition)
If Not (MyOverFlowFormattedTextArea Is Nothing) Then
MyOverFlowFormattedTextArea.Height = MyOverFlowFormattedTextArea.GetRequiredHeight()
Set MyOverFlowFormattedTextArea = MyPage.AddOverflowFormattedTextArea(MyOverFlowFormattedTextArea)
End If
' Output the Document to the Browser
MyDocument.DrawToWeb
Set MyPage = Nothing
Set MyDocument = Nothing
%>
Thanks,
ceTe Software Support Team.