Hi,
I'm getting very frustrated trying to do what i think should be fairly simple, i wonder if you can help.
I have many paragraphs of text which could be any number of length (some paragraphs may need to flow to several pages depending on length). Each paragraph must span the width of the page (A4 portrait). Each paragraph must have a line space after (before the next paragraph)
If i use the New FormattedTextArea(text, 0, 0, 480, 50, style) i seem to have to put the coordinates for this area, i dont understand why this has to be done as I dont know what the height is going to be.
Can anyone point me on the right direction please.
Many Thanks
Steve
FormattedTextArea height
Re: FormattedTextArea height
Support · May 9, 2006Hey Steve,
Actually the Height in this case should initially be set to the total amount of space that you have on the page that text could potentially be place. Let’s just say that hypothetically you had a page with a total amount of page height of 850 points. Then let’s assume you have a top and bottom margin of 50 each. This leaves you with 750 points of height on the page. Let's then assume that before placing the FormattedTextArea you want to add a title or something. We put the title at X-Y location 0, 0 and it has a height of 30. We now have a total height of available space to place text on the page of about 720 points (maybe 710 if we add in there a little padding between the title and the FormattedTextArea).
Now you will know that you could place your FormattedTextArea at (approximately) X-Y location 0, 40 (because your title come down to 30 plus 10 for padding) with a width of whatever the width of you page is (say 480 like you have) and a height of 710 (from above). Your constructor might look like this:
Dim MyFTA As FormattedTextArea = New FormattedTextArea(text, 0, 40, 480, 710, style)
But now that you have defined the height of the FormattedTextArea to be the full available length of the page you now need to find out exactly how much height was actually required to fit that "text" you passed into it. The next thing that you would do is call the MyFTA.GetRequiredHeight() method. This will return the exact amount of height that it will take to fit all the "text" that was supplied. If the height returned from this method is greater than 720 you know that you will need to overflow onto the next page. If the GetRequireHeight method returns less than 720 then you know all the text did fit on the first page and you now have the exact location that you can begin your next page elements (if need be).
Keep in mind that you can always just use the MyFTA.HasOverflowText method to check very quickly whether all the text fit into that height defined. Using this HasOverflowText is illustrated in the "Text Continuation" Help topic in our documentation here
.
Thanks,
ceTe Software Support Team
Re: FormattedTextArea height
Forum member · May 11, 2006Hi,
Thanks for your help. I have another question for you complicates things a bit.
I need to have the variable length paragraphs described above inside a table which may span many pages, the reason why is because each paragraph has a title to the left hand side.
I want to be able to have two columns spanning the wedth of the page: in the left column will be the title & in the right will be a paragraph.
Any ideas how i might acehive this?
Kind Regards
Steve
Re: FormattedTextArea height
Support · May 11, 2006Our Table, TextArea and FormattedTextArea classes all contain the GetRequiredHeight method for figuring out page placement and overflow from page to page.
Very similar logic will be used regardless of the type of page element that you are placing on the PDF. You will still need to check the Required Height against how much available Height that is remaining on the page. If it fits then place it if not then create a new page.
Thanks,
ceTe Software Support Team