This example shows how to flow text from one area to another. The techniques shown here are used to flow text between pages, but they could equally well be applied to flowing text between areas - such as columns - on the same page.




First, we'll set up some convenient variables including the text we want to display.

theID = 0
thePad = 10
theText = "Gallia est omnis divisa in partes tres, quarum unam incolunt Belgae, aliam Aquitani, tertiam qui ipsorum lingua Celtae, nostra Galli appellantur. Hi omnes..." ' truncated for clarity



Doc Obj

Next, we create an ABCpdf Doc object and give it our basic settings.

We enlarge the line width, increase the font size, enable justification and inset the drawing rectangle from the edges of the document.

Set theDoc = Server.CreateObject("ABCpdf10.Doc")
theDoc.Width = 4
theDoc.FontSize = 32
theDoc.TextStyle.Justification = 1
theDoc.Rect.Inset 20, 20




We add our base text to the current page of the document. We then enter a loop, adding pages and chaining HTML boxes together until we run out of text to display.

theID = theDoc.AddHtml(theText)
While theDoc.Chainable(theID)
  theDoc.Page = theDoc.AddPage()
  theID = theDoc.AddHtml("", theID)




After adding all our text, we save the document to a specified location.

theDoc.Save "c:\mypdfs\textflow.pdf"




textflow.pdf [Page 1]

textflow.pdf [Page 2]

textflow.pdf [Page 3]