Posted by a ceTe Software moderator
Hello,
The issue you are experiencing may happen if the height of an UnOrderedList is set in such a way that part of the list falls outside the bounds of the page. To resolve this, you will have to set the height to be equal to or less than the height of the space available on the page. Then the GetOverFlowList method will return the remaining content that can be added to next page. Here is the VB6 code sample.
'Create a Document
Dim MyDocument As DynamicPDF.Document
Set MyDocument = New DynamicPDF.Document
Dim MyPage As DynamicPDF.Page
Set MyPage = MyDocument.AddPage()
'Add an UnOrdered list
Dim unorderedList As DynamicPDF.unorderedList
Set unorderedList = MyPage.AddUnOrderedList(10, 10, 400, 200, DPDF_Font_Helvetica, 10)
Dim listItemU1
Set listItemU1 = unorderedList.AddListItem("Fruits")
Dim index As Integer
For index = 1 To 100 Step 1
Dim unorderedSubList1 As DynamicPDF.UnOrderedSubList
Set unorderedSubList1 = listItemU1.AddUnOrderedSubList()
Dim subListItemU1
Set subListItemU1 = unorderedSubList1.AddListItem(" Citrus " & index)
Dim subListItemU2
Set subListItemU2 = unorderedSubList1.AddListItem(" Non-Citrus " & index)
Next
unorderedList.Height = unorderedList.GetRequiredHeight()
If unorderedList.Height < MyPage.PageHeight Then
unorderedList.Height = unorderedList.GetRequiredHeight()
Else
unorderedList.Height = MyPage.PageHeight - (MyPage.MarginTop + MyPage.MarginBottom)
End If
'Add over flow UnorderedList to the new page.
Do
Dim MyOverflowUnorderedList As DynamicPDF.unorderedList
Set MyOverflowUnorderedList = unorderedList.GetOverFlowList(0, 0)
If Not (MyOverflowUnorderedList Is Nothing) Then
Set MyPage = MyDocument.AddPage()
Set unorderedList = MyPage.AddOverflowUnOrderedList(MyOverflowUnorderedList)
unorderedList.Height = unorderedList.GetRequiredHeight()
If unorderedList.Height < MyPage.PageHeight Then
unorderedList.Height = unorderedList.GetRequiredHeight()
Else
unorderedList.Height = MyPage.PageHeight - (MyPage.MarginTop + MyPage.MarginBottom)
End If
End If
Loop While Not (MyOverflowUnorderedList Is Nothing)
'Draw the output PDF
MyDocument.DrawToFile ("C:\Temp\MyDocument.pdf")
If you continue facing any issues then please send over the following details to
support@cete.com so we can look into it further.
1.Exact version and build number of the DynamicPDF for Com/ActiveX product installed.
2.Code sample which uses static data to recreate the behavior.
3.Output PDF.
4.More details about the problem and what you are trying to achieve using DynamicPDF products.
Thanks,
ceTe Software Support Team.