Posted by a ceTe Software moderator
Hello,
The behavior you are seeing is expected behavior. Initially when a certain height is defined for the TextArea the overflow TextArea returned by the GetOverflowTextArea( 0, 0 ) will have the same height. In the code you are using the x & y co-ordinates of the overflow TextArea are 0 & 0 respectively, so you will see it start at the beginning of the second page, when the predefined height is filled it overflows to the third page. If you want the overflow TextArea to fill the page you would need to set the height of the overflow TextArea. Below is the sample code that adjusts the height of overflow TextArea to fill the page.
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
MyText = MyText & MyText
MyText = MyText & MyText
Dim MyPage
Dim MyTextArea
Dim MyOverflowTextArea
Set MyPage = MyDocument.AddPage()
Set MyTextArea = MyPage.AddTextArea( MyText, 0, 500, 200, 200 )
Do
If MyTextArea.HasOverflowText Then
Set MyOverflowTextArea = MyTextArea.GetOverflowTextArea( 0, 0 )
Set MyPage = MyDocument.AddPage()
MyOverflowTextArea.Height = MyPage.PageHeight - MyPage.MarginBottom
Set MyTextArea = MyPage.AddOverflowTextArea( MyOverflowTextArea )
End if
Loop While MyTextArea.HasOverflowText = True
' Output the PDF.
MyDocument.DrawToWeb
Set MyPage = Nothing
Set MyDocument = Nothing
Thanks,
ceTe Software Support Team.