This example shows how to flow text from 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 on the same page.

 

   
Setup
 
     

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("ABCpdf3.Doc")
theDoc.Width = 4
theDoc.FontSize = 32
theDoc.TextStyle.Justification = 1
theDoc.Rect.Inset 20, 20

 

   
Adding
 
     

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.

theDoc.FrameRect
theID = theDoc.AddHTML(theText)
While theDoc.GetInfo(theID, "Truncated") = "1"
  theDoc.Page = theDoc.AddPage()
  theDoc.FrameRect
  theID = theDoc.AddHTML("", theID)
Wend

 

   
Save
 
     

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

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

 

   
Results
 
     


textflow.pdf [Page 1]


textflow.pdf [Page 2]


textflow.pdf [Page 3]

 

 

   

 

Browser Based Help. Published by chm2web software.